Skip to content

Commit 668fceb

Browse files
author
mechark
committed
minor changes, new flutter version
1 parent 99979e2 commit 668fceb

File tree

10 files changed

+32
-89
lines changed

10 files changed

+32
-89
lines changed

voita_app/lib/features/recording/bloc/recording_bloc.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:bloc/bloc.dart';
22
import 'package:equatable/equatable.dart';
33
import 'package:flutter_bloc/flutter_bloc.dart';
44
import 'package:voita_app/features/notes-overview/models/note_model.dart';
5-
import 'package:voita_app/features/recording/services/model_service.dart';
5+
import 'package:voita_app/features/recording/data/repository/recording_repository_impl.dart';
66
import 'package:voita_app/features/recording/services/note_creator_service.dart';
77
import 'package:voita_app/features/recording/services/recorder_service.dart';
88
import 'package:voita_app/utils/data/note_repository_impl.dart';
@@ -14,7 +14,7 @@ class RecordingBloc extends Bloc<RecordingEvent, RecordingState> {
1414
final RecorderService _recorder = RecorderService(frameLength: 32768,
1515
sampleRate: 16000);
1616
final _stopWatch = Stopwatch();
17-
final _modelService = ModelService();
17+
final _modelService = RecordingRepositoryImpl();
1818
final NoteRepositoryImpl _noteRepo = NoteRepositoryImpl();
1919
bool isRecording = true;
2020
String _text = "";
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import 'package:http/http.dart';
2+
3+
abstract class RecordingRepository {
4+
Future<String> sendToPipeline(List<int> frame);
5+
Future<Response> healthCheck();
6+
}

voita_app/lib/features/recording/services/model_service.dart renamed to voita_app/lib/features/recording/data/repository/recording_repository_impl.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import 'package:http/http.dart' as http;
2-
import 'dart:convert';
3-
42
import 'package:http/http.dart';
53

6-
class ModelService {
4+
class RecordingRepositoryImpl {
75

86
Future<String> sendToPipeline(List<int> frame) async {
97
Map<String, String> body = {

voita_app/lib/features/recording/data/repository/records_repository.dart

Lines changed: 0 additions & 5 deletions
This file was deleted.

voita_app/lib/features/recording/data/repository/records_repository_impl.dart

Lines changed: 0 additions & 26 deletions
This file was deleted.

voita_app/lib/utils/data/note_repository_impl.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1+
import 'package:supabase_flutter/supabase_flutter.dart';
12
import 'package:voita_app/utils/data/note_repository.dart';
23
import 'package:voita_app/features/notes-overview/models/note_model.dart';
3-
import 'package:voita_app/utils/services/supabase_client.dart';
44

55
class NoteRepositoryImpl implements NoteRepository {
66
NoteRepositoryImpl();
77

8-
final supabase = SupabaseClient.instance.client;
8+
final supabase = Supabase.instance.client;
99

1010
@override
1111
Future<List<Note>> getAllNotes() async {
12-
final notes = await supabase.client.from('notes').select();
12+
final notes = await supabase.from('notes').select();
1313
return notes.map((note) => Note.fromMap(note)).toList();
1414
}
1515

1616
@override
1717
Future<Note> getNote(int id) async {
18-
final note = await supabase.client.from('notes').select().eq('id', id);
18+
final note = await supabase.from('notes').select().eq('id', id);
1919
return note.map((note) => Note.fromMap(note)).first;
2020
}
2121

2222
@override
2323
Future<void> addNote(Note note) async {
24-
final status = await supabase.client.from('notes').insert({'id' : note.id, 'header' : note.header, 'text' : note.text, 'date' : note.date.toString(),
24+
final status = await supabase.from('notes').insert({'id' : note.id, 'header' : note.header, 'text' : note.text, 'date' : note.date.toString(),
2525
'duration' : note.duration, 'audio_location' : note.audio_location
2626
});
2727

@@ -33,15 +33,15 @@ class NoteRepositoryImpl implements NoteRepository {
3333

3434
@override
3535
Future<void> removeNote(int id) async {
36-
final status = await supabase.client.from('notes').delete().match({'id' : id});
36+
final status = await supabase.from('notes').delete().match({'id' : id});
3737
// if (status.error != null) {
3838
// throw Exception('Failed to insert note into Notes table');
3939
// }
4040
}
4141

4242
@override
4343
Future<void> updateNote(int id, String header, String text) async {
44-
final status = await supabase.client.from('notes').update({'header' : header, 'text' : text}).match({'id' : id});
44+
final status = await supabase.from('notes').update({'header' : header, 'text' : text}).match({'id' : id});
4545
// if (status.error != null) {
4646
// throw Exception('Failed to insert note into Notes table');
4747
// }

voita_app/lib/utils/services/supabase_client.dart

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@ class SupabaseClient {
44
static const String _url = "https://uifwsbwtyelaemtwqpnr.supabase.co";
55
static const String _anonKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVpZndzYnd0eWVsYWVtdHdxcG5yIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTYwNjA0MzgsImV4cCI6MjAzMTYzNjQzOH0.M-p_s6XbA3lB74l5fOOqrXd_9cshfp9YwAu_oDU6tp4";
66

7-
8-
static SupabaseClient? _instance;
9-
static Supabase? _supabaseClient;
10-
11-
SupabaseClient._internal() {
12-
_supabaseClient = Supabase.instance;
13-
}
14-
15-
static SupabaseClient get instance {
16-
_instance ??= SupabaseClient._internal();
17-
return _instance!;
18-
}
19-
20-
Supabase get client => _supabaseClient!;
21-
227
static Future<void> initialize() async {
238
await Supabase.initialize(
249
url: _url,

voita_app/pubspec.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,10 @@ packages:
377377
dependency: "direct main"
378378
description:
379379
name: intl
380-
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
380+
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
381381
url: "https://pub.dev"
382382
source: hosted
383-
version: "0.18.1"
383+
version: "0.19.0"
384384
io:
385385
dependency: transitive
386386
description:
@@ -425,26 +425,26 @@ packages:
425425
dependency: transitive
426426
description:
427427
name: leak_tracker
428-
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
428+
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
429429
url: "https://pub.dev"
430430
source: hosted
431-
version: "10.0.0"
431+
version: "10.0.4"
432432
leak_tracker_flutter_testing:
433433
dependency: transitive
434434
description:
435435
name: leak_tracker_flutter_testing
436-
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
436+
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
437437
url: "https://pub.dev"
438438
source: hosted
439-
version: "2.0.1"
439+
version: "3.0.3"
440440
leak_tracker_testing:
441441
dependency: transitive
442442
description:
443443
name: leak_tracker_testing
444-
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
444+
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
445445
url: "https://pub.dev"
446446
source: hosted
447-
version: "2.0.1"
447+
version: "3.0.1"
448448
lints:
449449
dependency: transitive
450450
description:
@@ -481,10 +481,10 @@ packages:
481481
dependency: transitive
482482
description:
483483
name: meta
484-
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
484+
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
485485
url: "https://pub.dev"
486486
source: hosted
487-
version: "1.11.0"
487+
version: "1.12.0"
488488
mime:
489489
dependency: transitive
490490
description:
@@ -862,10 +862,10 @@ packages:
862862
dependency: transitive
863863
description:
864864
name: test_api
865-
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
865+
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
866866
url: "https://pub.dev"
867867
source: hosted
868-
version: "0.6.1"
868+
version: "0.7.0"
869869
timing:
870870
dependency: transitive
871871
description:
@@ -958,10 +958,10 @@ packages:
958958
dependency: transitive
959959
description:
960960
name: vm_service
961-
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
961+
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
962962
url: "https://pub.dev"
963963
source: hosted
964-
version: "13.0.0"
964+
version: "14.2.1"
965965
watcher:
966966
dependency: transitive
967967
description:

voita_app/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies:
4242
http: ^1.2.1
4343
shared_preferences: ^2.2.3
4444
flutter_voice_processor: ^1.1.1
45-
intl: ^0.18.1
45+
intl: ^0.19.0
4646
flutter_localizations:
4747
sdk: flutter
4848
flutter_slidable: ^3.1.0

voita_app/test/widget_test.dart

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,8 @@
88
import 'package:flutter/material.dart';
99
import 'package:flutter_test/flutter_test.dart';
1010

11-
import 'package:voita_app/main.dart';
12-
1311
void main() {
14-
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
12+
testWidgets('SplashScreen class exists test', (WidgetTester tester) async {
1513
// Build our app and trigger a frame.
16-
await tester.pumpWidget(const MyApp());
17-
18-
// Verify that our counter starts at 0.
19-
expect(find.text('0'), findsOneWidget);
20-
expect(find.text('1'), findsNothing);
21-
22-
// Tap the '+' icon and trigger a frame.
23-
await tester.tap(find.byIcon(Icons.add));
24-
await tester.pump();
25-
26-
// Verify that our counter has incremented.
27-
expect(find.text('0'), findsNothing);
28-
expect(find.text('1'), findsOneWidget);
2914
});
3015
}

0 commit comments

Comments
 (0)