From 637dbe08d8555ea4615a846175b7c4e81b9f546f Mon Sep 17 00:00:00 2001 From: Ademola Fadumo Date: Wed, 29 Nov 2023 11:29:46 +0100 Subject: [PATCH] refactor: setting up for riverpod implementation --- backend/.idea/.gitignore | 3 + backend/.idea/backend.iml | 9 + backend/.idea/misc.xml | 6 + backend/.idea/modules.xml | 8 + backend/.idea/vcs.xml | 6 + backend/functions/src/modules/create_todo.ts | 51 ++++++ frontend/.gitignore | 6 +- frontend/analysis_options.yaml | 2 +- frontend/l10n.yaml | 4 - frontend/lib/main_development.dart | 15 +- frontend/lib/main_production.dart | 19 +- frontend/lib/main_staging.dart | 19 +- .../lib/src/core/constants/environment.dart | 3 - frontend/lib/src/core/global_imports.dart | 7 - frontend/lib/src/data/api/settings_api.dart | 1 - .../connection_checker.dart | 6 - .../settings/settings_repository.dart | 1 - .../settings/settings_repository_impl.dart | 3 - frontend/lib/src/l10n/arb/app_en.arb | 7 - frontend/lib/src/l10n/arb/app_es.arb | 7 - frontend/lib/src/l10n/l10n.dart | 8 - .../settings/cubit/settings_cubit.dart | 9 - .../cubit/settings_cubit.freezed.dart | 164 ------------------ .../settings/cubit/settings_state.dart | 6 - .../bloc_implementation/analysis_options.yaml | 4 + .../lib/bloc_implementation.dart | 2 + .../bloc_implementation}/lib/src/app/app.dart | 0 .../lib/src/app/view/app.dart | 58 ++----- .../lib/src}/bootstrap.dart | 16 +- .../bloc/connection_checker_bloc.dart | 3 +- .../bloc/connection_checker_bloc.freezed.dart | 141 +++++++-------- .../bloc/connection_checker_event.dart | 0 .../bloc/connection_checker_state.dart | 0 .../src/features}/home/bloc/home_bloc.dart | 11 +- .../home/bloc/home_bloc.freezed.dart | 160 +++++++---------- .../src/features}/home/bloc/home_event.dart | 0 .../src/features}/home/bloc/home_state.dart | 0 .../src/features}/home/view/home_view.dart | 22 +-- .../home/view/pages/queues_view.dart | 6 +- .../view/widgets/animated_sync_status.dart | 3 +- .../home/view/widgets/custom_tab.dart | 2 +- .../home/view/widgets/empty_list_state.dart | 2 +- .../view/widgets/todays_todos_list_view.dart | 6 +- .../home/view/widgets/todo_list_item.dart | 9 +- .../view/widgets/todo_list_view_builder.dart | 8 +- .../bloc/landing_loading_bloc.dart | 2 +- .../bloc/landing_loading_bloc.freezed.dart | 102 +++++------ .../bloc/landing_loading_event.dart | 0 .../bloc/landing_loading_state.dart | 0 .../view/landing_loading_view.dart | 8 +- .../sign_in/cubit/sign_in_cubit.dart | 4 +- .../sign_in/cubit/sign_in_cubit.freezed.dart | 92 +++++----- .../sign_in/cubit/sign_in_state.dart | 0 .../features}/sign_in/view/sign_in_view.dart | 8 +- .../todo_sync/cubit/todo_sync_cubit.dart | 2 +- .../cubit/todo_sync_cubit.freezed.dart | 93 +++++----- .../todo_sync/cubit/todo_sync_state.dart | 0 .../view_todo/bloc/view_todo_bloc.dart | 9 +- .../bloc/view_todo_bloc.freezed.dart | 100 +++++------ .../view_todo/bloc/view_todo_event.dart | 0 .../view_todo/bloc/view_todo_state.dart | 0 .../view_todo/view/view_todo_view.dart | 13 +- .../view_todo/view/widgets/extras_button.dart | 4 +- .../view_todo/view/widgets/extras_menu.dart | 6 +- .../modules/bloc_implementation/pubspec.yaml | 49 ++++++ .../modules/common/apis/analysis_options.yaml | 4 + frontend/modules/common/apis/lib/apis.dart | 3 + .../common/apis/lib/src/apis/apis.dart | 10 ++ .../apis}/local_storage/local_storage.dart | 0 .../local_storage/local_storage_impl.dart | 3 +- .../lib/src/apis}/queue/local_queue_api.dart | 7 +- .../apis/lib/src/apis}/queue/queue_api.dart | 2 +- .../lib/src/apis}/queue/remote_queue_api.dart | 4 +- .../lib/src/apis}/todo/local_todo_api.dart | 7 +- .../lib/src/apis}/todo/remote_todo_api.dart | 4 +- .../apis/lib/src/apis}/todo/todo_api.dart | 3 +- .../apis/lib/src/apis/user}/user_api.dart | 6 +- .../common/apis/lib/src/models/models.dart | 3 + .../lib/src/models/queue/domain}/queue.dart | 0 .../lib/src/models/queue/dto}/queue_dto.dart | 6 +- .../src/models/queue/dto}/queue_dto.g.dart | 3 +- .../apis/lib/src/models/queue/queue.dart | 3 + .../lib/src/models/todo/domain}/todo.dart | 0 .../src/models/todo/domain}/todo.freezed.dart | 38 ++-- .../lib/src/models/todo/domain}/todo.g.dart | 6 +- .../lib/src/models/todo/dto}/todo_dto.dart | 2 +- .../lib/src/models/todo/dto}/todo_dto.g.dart | 3 +- .../common/apis/lib/src/models/todo/todo.dart | 3 + .../lib/src/models/user/dtos}/user_dto.dart | 7 +- .../lib/src/models/user/dtos}/user_dto.g.dart | 3 +- .../common/apis/lib/src/models/user/user.dart | 2 + frontend/modules/common/apis/pubspec.yaml | 24 +++ .../modules/common/core/analysis_options.yaml | 4 + frontend/modules/common/core/lib/core.dart | 11 ++ .../common/core/lib/src}/constants/theme.dart | 0 .../common/core/lib/src}/enums/enums.dart | 0 .../core/lib/src}/enums/processing_state.dart | 0 .../lib/src}/enums/todo_operation_type.dart | 0 .../core/lib/src}/enums/todo_priority.dart | 0 .../core/lib/src}/enums/todo_status.dart | 0 .../src}/extensions/date_time_helpers.dart | 0 .../core/lib/src}/extensions/extensions.dart | 1 + .../lib/src/extensions/string_helpers.dart | 6 + .../common/core/lib/src}/shared/shared.dart | 0 .../ui_kit/custom_snackbar_builder.dart | 0 frontend/modules/common/core/pubspec.yaml | 23 +++ .../common/repositories/analysis_options.yaml | 4 + .../common/repositories/lib/repositories.dart | 5 + .../repositories/lib/src/auth/auth.dart | 3 + .../lib/src}/auth/auth_repository.dart | 0 .../lib/src}/auth/auth_repository_impl.dart | 4 +- .../connection_checker.dart | 2 + .../connection_checker_impl.dart | 7 +- .../repositories/lib/src/todo/todo.dart | 3 + .../lib/src}/todo/todo_repository.dart | 2 +- .../lib/src}/todo/todo_repository_impl.dart | 11 +- .../lib/src/todo_sync/todo_sync.dart | 3 + .../src}/todo_sync/todo_sync_repository.dart | 3 +- .../todo_sync/todo_sync_repository_impl.dart | 11 +- .../modules/common/repositories/pubspec.yaml | 29 ++++ .../todo_sync_repository_test.dart | 23 ++- .../analysis_options.yaml | 0 .../riverpod_implementation/pubspec.yaml | 0 frontend/pubspec.yaml | 25 +-- 124 files changed, 819 insertions(+), 832 deletions(-) create mode 100644 backend/.idea/.gitignore create mode 100644 backend/.idea/backend.iml create mode 100644 backend/.idea/misc.xml create mode 100644 backend/.idea/modules.xml create mode 100644 backend/.idea/vcs.xml create mode 100644 backend/functions/src/modules/create_todo.ts delete mode 100644 frontend/l10n.yaml delete mode 100644 frontend/lib/src/core/constants/environment.dart delete mode 100644 frontend/lib/src/core/global_imports.dart delete mode 100644 frontend/lib/src/data/api/settings_api.dart delete mode 100644 frontend/lib/src/data/repositories/connection_checker/connection_checker.dart delete mode 100644 frontend/lib/src/data/repositories/settings/settings_repository.dart delete mode 100644 frontend/lib/src/data/repositories/settings/settings_repository_impl.dart delete mode 100644 frontend/lib/src/l10n/arb/app_en.arb delete mode 100644 frontend/lib/src/l10n/arb/app_es.arb delete mode 100644 frontend/lib/src/l10n/l10n.dart delete mode 100644 frontend/lib/src/modules/settings/cubit/settings_cubit.dart delete mode 100644 frontend/lib/src/modules/settings/cubit/settings_cubit.freezed.dart delete mode 100644 frontend/lib/src/modules/settings/cubit/settings_state.dart create mode 100644 frontend/modules/bloc_implementation/analysis_options.yaml create mode 100644 frontend/modules/bloc_implementation/lib/bloc_implementation.dart rename frontend/{ => modules/bloc_implementation}/lib/src/app/app.dart (100%) rename frontend/{ => modules/bloc_implementation}/lib/src/app/view/app.dart (51%) rename frontend/{lib => modules/bloc_implementation/lib/src}/bootstrap.dart (69%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/connection_checker/bloc/connection_checker_bloc.dart (90%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/connection_checker/bloc/connection_checker_bloc.freezed.dart (79%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/connection_checker/bloc/connection_checker_event.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/connection_checker/bloc/connection_checker_state.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/bloc/home_bloc.dart (84%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/bloc/home_bloc.freezed.dart (80%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/bloc/home_event.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/bloc/home_state.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/view/home_view.dart (87%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/view/pages/queues_view.dart (95%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/view/widgets/animated_sync_status.dart (95%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/view/widgets/custom_tab.dart (90%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/view/widgets/empty_list_state.dart (92%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/view/widgets/todays_todos_list_view.dart (67%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/view/widgets/todo_list_item.dart (93%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/home/view/widgets/todo_list_view_builder.dart (90%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/landing_loading/bloc/landing_loading_bloc.dart (93%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/landing_loading/bloc/landing_loading_bloc.freezed.dart (84%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/landing_loading/bloc/landing_loading_event.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/landing_loading/bloc/landing_loading_state.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/landing_loading/view/landing_loading_view.dart (77%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/sign_in/cubit/sign_in_cubit.dart (90%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/sign_in/cubit/sign_in_cubit.freezed.dart (83%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/sign_in/cubit/sign_in_state.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/sign_in/view/sign_in_view.dart (90%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/todo_sync/cubit/todo_sync_cubit.dart (95%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/todo_sync/cubit/todo_sync_cubit.freezed.dart (79%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/todo_sync/cubit/todo_sync_state.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/view_todo/bloc/view_todo_bloc.dart (87%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/view_todo/bloc/view_todo_bloc.freezed.dart (83%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/view_todo/bloc/view_todo_event.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/view_todo/bloc/view_todo_state.dart (100%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/view_todo/view/view_todo_view.dart (93%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/view_todo/view/widgets/extras_button.dart (94%) rename frontend/{lib/src/modules => modules/bloc_implementation/lib/src/features}/view_todo/view/widgets/extras_menu.dart (96%) create mode 100644 frontend/modules/bloc_implementation/pubspec.yaml create mode 100644 frontend/modules/common/apis/analysis_options.yaml create mode 100644 frontend/modules/common/apis/lib/apis.dart create mode 100644 frontend/modules/common/apis/lib/src/apis/apis.dart rename frontend/{lib/src/data => modules/common/apis/lib/src/apis}/local_storage/local_storage.dart (100%) rename frontend/{lib/src/data => modules/common/apis/lib/src/apis}/local_storage/local_storage_impl.dart (97%) rename frontend/{lib/src/data/api => modules/common/apis/lib/src/apis}/queue/local_queue_api.dart (90%) rename frontend/{lib/src/data/api => modules/common/apis/lib/src/apis}/queue/queue_api.dart (81%) rename frontend/{lib/src/data/api => modules/common/apis/lib/src/apis}/queue/remote_queue_api.dart (94%) rename frontend/{lib/src/data/api => modules/common/apis/lib/src/apis}/todo/local_todo_api.dart (87%) rename frontend/{lib/src/data/api => modules/common/apis/lib/src/apis}/todo/remote_todo_api.dart (95%) rename frontend/{lib/src/data/api => modules/common/apis/lib/src/apis}/todo/todo_api.dart (76%) rename frontend/{lib/src/data/api => modules/common/apis/lib/src/apis/user}/user_api.dart (90%) create mode 100644 frontend/modules/common/apis/lib/src/models/models.dart rename frontend/{lib/src/data/models/domains => modules/common/apis/lib/src/models/queue/domain}/queue.dart (100%) rename frontend/{lib/src/data/models/dtos/queue => modules/common/apis/lib/src/models/queue/dto}/queue_dto.dart (92%) rename frontend/{lib/src/data/models/dtos/queue => modules/common/apis/lib/src/models/queue/dto}/queue_dto.g.dart (96%) create mode 100644 frontend/modules/common/apis/lib/src/models/queue/queue.dart rename frontend/{lib/src/data/models/domains => modules/common/apis/lib/src/models/todo/domain}/todo.dart (100%) rename frontend/{lib/src/data/models/domains => modules/common/apis/lib/src/models/todo/domain}/todo.freezed.dart (90%) rename frontend/{lib/src/data/models/domains => modules/common/apis/lib/src/models/todo/domain}/todo.g.dart (85%) rename frontend/{lib/src/data/models/dtos/todo => modules/common/apis/lib/src/models/todo/dto}/todo_dto.dart (97%) rename frontend/{lib/src/data/models/dtos/todo => modules/common/apis/lib/src/models/todo/dto}/todo_dto.g.dart (97%) create mode 100644 frontend/modules/common/apis/lib/src/models/todo/todo.dart rename frontend/{lib/src/data/models/dtos/user => modules/common/apis/lib/src/models/user/dtos}/user_dto.dart (86%) rename frontend/{lib/src/data/models/dtos/user => modules/common/apis/lib/src/models/user/dtos}/user_dto.g.dart (96%) create mode 100644 frontend/modules/common/apis/lib/src/models/user/user.dart create mode 100644 frontend/modules/common/apis/pubspec.yaml create mode 100644 frontend/modules/common/core/analysis_options.yaml create mode 100644 frontend/modules/common/core/lib/core.dart rename frontend/{lib/src/core => modules/common/core/lib/src}/constants/theme.dart (100%) rename frontend/{lib/src/core => modules/common/core/lib/src}/enums/enums.dart (100%) rename frontend/{lib/src/core => modules/common/core/lib/src}/enums/processing_state.dart (100%) rename frontend/{lib/src/core => modules/common/core/lib/src}/enums/todo_operation_type.dart (100%) rename frontend/{lib/src/core => modules/common/core/lib/src}/enums/todo_priority.dart (100%) rename frontend/{lib/src/core => modules/common/core/lib/src}/enums/todo_status.dart (100%) rename frontend/{lib/src/core => modules/common/core/lib/src}/extensions/date_time_helpers.dart (100%) rename frontend/{lib/src/core => modules/common/core/lib/src}/extensions/extensions.dart (52%) create mode 100644 frontend/modules/common/core/lib/src/extensions/string_helpers.dart rename frontend/{lib/src/core => modules/common/core/lib/src}/shared/shared.dart (100%) rename frontend/{lib/src/core => modules/common/core/lib/src}/shared/ui_kit/custom_snackbar_builder.dart (100%) create mode 100644 frontend/modules/common/core/pubspec.yaml create mode 100644 frontend/modules/common/repositories/analysis_options.yaml create mode 100644 frontend/modules/common/repositories/lib/repositories.dart create mode 100644 frontend/modules/common/repositories/lib/src/auth/auth.dart rename frontend/{lib/src/data/repositories => modules/common/repositories/lib/src}/auth/auth_repository.dart (100%) rename frontend/{lib/src/data/repositories => modules/common/repositories/lib/src}/auth/auth_repository_impl.dart (92%) create mode 100644 frontend/modules/common/repositories/lib/src/connection_checker/connection_checker.dart rename frontend/{lib/src/data/repositories => modules/common/repositories/lib/src}/connection_checker/connection_checker_impl.dart (77%) create mode 100644 frontend/modules/common/repositories/lib/src/todo/todo.dart rename frontend/{lib/src/data/repositories => modules/common/repositories/lib/src}/todo/todo_repository.dart (78%) rename frontend/{lib/src/data/repositories => modules/common/repositories/lib/src}/todo/todo_repository_impl.dart (74%) create mode 100644 frontend/modules/common/repositories/lib/src/todo_sync/todo_sync.dart rename frontend/{lib/src/data/repositories => modules/common/repositories/lib/src}/todo_sync/todo_sync_repository.dart (65%) rename frontend/{lib/src/data/repositories => modules/common/repositories/lib/src}/todo_sync/todo_sync_repository_impl.dart (93%) create mode 100644 frontend/modules/common/repositories/pubspec.yaml rename frontend/{ => modules/common/repositories}/test/data/repositories/todo_sync_repository_test.dart (95%) create mode 100644 frontend/modules/riverpod_implementation/analysis_options.yaml create mode 100644 frontend/modules/riverpod_implementation/pubspec.yaml diff --git a/backend/.idea/.gitignore b/backend/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/backend/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/backend/.idea/backend.iml b/backend/.idea/backend.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/backend/.idea/backend.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/backend/.idea/misc.xml b/backend/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/backend/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/backend/.idea/modules.xml b/backend/.idea/modules.xml new file mode 100644 index 0000000..e066844 --- /dev/null +++ b/backend/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/backend/.idea/vcs.xml b/backend/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/backend/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/backend/functions/src/modules/create_todo.ts b/backend/functions/src/modules/create_todo.ts new file mode 100644 index 0000000..e112d63 --- /dev/null +++ b/backend/functions/src/modules/create_todo.ts @@ -0,0 +1,51 @@ +import * as functions from "firebase-functions"; +import * as admin from "firebase-admin"; +import * as logger from "firebase-functions/logger"; +import { Timestamp } from "firebase-admin/firestore"; + +const firebaseFirestore = admin.firestore(); + +export const createTodo_v0 = functions.https.onCall( + async (data, context) => { + if (!context.auth) { + throw new functions.https.HttpsError( + "failed-precondition", + "The function must be called " + "while authenticated." + ); + } + + const userId: string = data.uid; + if (!(typeof userId === "string") || userId.length === 0) { + throw new functions.https.HttpsError( + "invalid-argument", + "The function must be called with " + + "argument \"uid\" containing the user id", + ); + } + + const userDocRef = firebaseFirestore.collection('todos').doc(userId).collection('todos') + + userDocRef.get() + final todosInRemote = await _getTodosAsFuture(); + + final todosToSyncJson = >[ + ...todosInRemote.map((e) => e.toJson()), + todo.toJson(), + ]; + + await docRef.set({'todos': todosToSyncJson}); + + final docRef = _queuesRef.doc(_userId) + + final queuesInRemote = await getQueues(); + + final queueToSyncJson = [ + ...queuesInRemote.map((e) => e.toJson()), + queue.toJson(), + ]; + + await docRef.set({'queues': queueToSyncJson}); + + + } +); diff --git a/frontend/.gitignore b/frontend/.gitignore index d7a7664..c20366a 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -37,7 +37,7 @@ api_keys.json /dev/docs/pubspec.yaml /dev/integration_tests/**/xcuserdata /dev/integration_tests/**/Pods -/packages/flutter/coverage/ +/modules/flutter/coverage/ version # packages file containing multi-root paths @@ -104,7 +104,7 @@ unlinked_spec.ds coverage/ # Submodules -packages/**/pubspec.lock +modules/**/pubspec.lock # Web related lib/generated_plugin_registrant.dart @@ -120,7 +120,7 @@ app.*.map.json !**/ios/**/default.mode2v3 !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +!/modules/flutter_tools/test/data/dart_dependencies_test/**/.packages !/dev/ci/**/Gemfile.lock !.vscode/extensions.json !.vscode/launch.json diff --git a/frontend/analysis_options.yaml b/frontend/analysis_options.yaml index c4321c1..fa798a8 100644 --- a/frontend/analysis_options.yaml +++ b/frontend/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:very_good_analysis/analysis_options.5.0.0.yaml +include: package:very_good_analysis/analysis_options.5.1.0.yaml linter: rules: public_member_api_docs: false diff --git a/frontend/l10n.yaml b/frontend/l10n.yaml deleted file mode 100644 index b7235c0..0000000 --- a/frontend/l10n.yaml +++ /dev/null @@ -1,4 +0,0 @@ -arb-dir: lib/src/l10n/arb -template-arb-file: app_en.arb -output-localization-file: app_localizations.dart -nullable-getter: false diff --git a/frontend/lib/main_development.dart b/frontend/lib/main_development.dart index 1e0b0be..3f30f70 100644 --- a/frontend/lib/main_development.dart +++ b/frontend/lib/main_development.dart @@ -1,14 +1,11 @@ +import 'package:apis/apis.dart'; +import 'package:bloc_implementation/bloc_implementation.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; import 'package:realm/realm.dart' as realm_flutter; -import 'package:todo_bloc/bootstrap.dart'; import 'package:todo_bloc/firebase_options.dart'; -import 'package:todo_bloc/src/app/app.dart'; -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; -import 'package:todo_bloc/src/data/models/dtos/user/user_dto.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -29,10 +26,8 @@ void main() async { /// Configure internet connection checker final internetConnectionInstance = InternetConnection.createInstance(); - await bootstrap( - () => App( - realm: realm, - internetConnection: internetConnectionInstance, - ), + await runBlocApp( + realm: realm, + internetConnection: internetConnectionInstance, ); } diff --git a/frontend/lib/main_production.dart b/frontend/lib/main_production.dart index fa1c2f6..3f30f70 100644 --- a/frontend/lib/main_production.dart +++ b/frontend/lib/main_production.dart @@ -1,13 +1,11 @@ +import 'package:apis/apis.dart'; +import 'package:bloc_implementation/bloc_implementation.dart'; +import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; import 'package:realm/realm.dart' as realm_flutter; -import 'package:todo_bloc/bootstrap.dart'; import 'package:todo_bloc/firebase_options.dart'; -import 'package:todo_bloc/src/app/app.dart'; -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; -import 'package:todo_bloc/src/data/models/dtos/user/user_dto.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -16,6 +14,9 @@ void main() async { options: DefaultFirebaseOptions.currentPlatform, ); + FirebaseFirestore.instance.settings = + const Settings(persistenceEnabled: false); + /// Configure local storage using realm final config = realm_flutter.Configuration.local( [TodoDTO.schema, UserDTO.schema, QueueDTO.schema], @@ -25,10 +26,8 @@ void main() async { /// Configure internet connection checker final internetConnectionInstance = InternetConnection.createInstance(); - await bootstrap( - () => App( - realm: realm, - internetConnection: internetConnectionInstance, - ), + await runBlocApp( + realm: realm, + internetConnection: internetConnectionInstance, ); } diff --git a/frontend/lib/main_staging.dart b/frontend/lib/main_staging.dart index fa1c2f6..3f30f70 100644 --- a/frontend/lib/main_staging.dart +++ b/frontend/lib/main_staging.dart @@ -1,13 +1,11 @@ +import 'package:apis/apis.dart'; +import 'package:bloc_implementation/bloc_implementation.dart'; +import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; import 'package:realm/realm.dart' as realm_flutter; -import 'package:todo_bloc/bootstrap.dart'; import 'package:todo_bloc/firebase_options.dart'; -import 'package:todo_bloc/src/app/app.dart'; -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; -import 'package:todo_bloc/src/data/models/dtos/user/user_dto.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -16,6 +14,9 @@ void main() async { options: DefaultFirebaseOptions.currentPlatform, ); + FirebaseFirestore.instance.settings = + const Settings(persistenceEnabled: false); + /// Configure local storage using realm final config = realm_flutter.Configuration.local( [TodoDTO.schema, UserDTO.schema, QueueDTO.schema], @@ -25,10 +26,8 @@ void main() async { /// Configure internet connection checker final internetConnectionInstance = InternetConnection.createInstance(); - await bootstrap( - () => App( - realm: realm, - internetConnection: internetConnectionInstance, - ), + await runBlocApp( + realm: realm, + internetConnection: internetConnectionInstance, ); } diff --git a/frontend/lib/src/core/constants/environment.dart b/frontend/lib/src/core/constants/environment.dart deleted file mode 100644 index babdb27..0000000 --- a/frontend/lib/src/core/constants/environment.dart +++ /dev/null @@ -1,3 +0,0 @@ -class Environment { - -} diff --git a/frontend/lib/src/core/global_imports.dart b/frontend/lib/src/core/global_imports.dart deleted file mode 100644 index ae4b651..0000000 --- a/frontend/lib/src/core/global_imports.dart +++ /dev/null @@ -1,7 +0,0 @@ -export 'package:bloc/bloc.dart'; -export 'package:flutter/foundation.dart'; -export 'package:flutter/material.dart'; -export 'package:flutter_bloc/flutter_bloc.dart'; -export 'enums/enums.dart'; -export 'extensions/extensions.dart'; -export 'shared/shared.dart'; diff --git a/frontend/lib/src/data/api/settings_api.dart b/frontend/lib/src/data/api/settings_api.dart deleted file mode 100644 index 8b13789..0000000 --- a/frontend/lib/src/data/api/settings_api.dart +++ /dev/null @@ -1 +0,0 @@ - diff --git a/frontend/lib/src/data/repositories/connection_checker/connection_checker.dart b/frontend/lib/src/data/repositories/connection_checker/connection_checker.dart deleted file mode 100644 index 9175b5a..0000000 --- a/frontend/lib/src/data/repositories/connection_checker/connection_checker.dart +++ /dev/null @@ -1,6 +0,0 @@ -// ignore_for_file: one_member_abstracts -import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; - -abstract class ConnectionChecker { - Stream getInternetStatus(); -} diff --git a/frontend/lib/src/data/repositories/settings/settings_repository.dart b/frontend/lib/src/data/repositories/settings/settings_repository.dart deleted file mode 100644 index 064f1b6..0000000 --- a/frontend/lib/src/data/repositories/settings/settings_repository.dart +++ /dev/null @@ -1 +0,0 @@ -abstract class SettingsRepository {} diff --git a/frontend/lib/src/data/repositories/settings/settings_repository_impl.dart b/frontend/lib/src/data/repositories/settings/settings_repository_impl.dart deleted file mode 100644 index fd29090..0000000 --- a/frontend/lib/src/data/repositories/settings/settings_repository_impl.dart +++ /dev/null @@ -1,3 +0,0 @@ -import 'package:todo_bloc/src/data/repositories/settings/settings_repository.dart'; - -class SettingsRepositoryImpl extends SettingsRepository {} diff --git a/frontend/lib/src/l10n/arb/app_en.arb b/frontend/lib/src/l10n/arb/app_en.arb deleted file mode 100644 index a5484a0..0000000 --- a/frontend/lib/src/l10n/arb/app_en.arb +++ /dev/null @@ -1,7 +0,0 @@ -{ - "@@locale": "en", - "counterAppBarTitle": "Counter", - "@counterAppBarTitle": { - "description": "Text shown in the AppBar of the Counter Page" - } -} \ No newline at end of file diff --git a/frontend/lib/src/l10n/arb/app_es.arb b/frontend/lib/src/l10n/arb/app_es.arb deleted file mode 100644 index f1405f0..0000000 --- a/frontend/lib/src/l10n/arb/app_es.arb +++ /dev/null @@ -1,7 +0,0 @@ -{ - "@@locale": "es", - "counterAppBarTitle": "Contador", - "@counterAppBarTitle": { - "description": "Texto mostrado en la AppBar de la página del contador" - } -} \ No newline at end of file diff --git a/frontend/lib/src/l10n/l10n.dart b/frontend/lib/src/l10n/l10n.dart deleted file mode 100644 index 17c891b..0000000 --- a/frontend/lib/src/l10n/l10n.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'package:flutter/widgets.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - -export 'package:flutter_gen/gen_l10n/app_localizations.dart'; - -extension AppLocalizationsX on BuildContext { - AppLocalizations get l10n => AppLocalizations.of(this); -} diff --git a/frontend/lib/src/modules/settings/cubit/settings_cubit.dart b/frontend/lib/src/modules/settings/cubit/settings_cubit.dart deleted file mode 100644 index 792be73..0000000 --- a/frontend/lib/src/modules/settings/cubit/settings_cubit.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:bloc/bloc.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'settings_state.dart'; -part 'settings_cubit.freezed.dart'; - -class SettingsCubit extends Cubit { - SettingsCubit() : super(const SettingsState.initial()); -} diff --git a/frontend/lib/src/modules/settings/cubit/settings_cubit.freezed.dart b/frontend/lib/src/modules/settings/cubit/settings_cubit.freezed.dart deleted file mode 100644 index f11a0f6..0000000 --- a/frontend/lib/src/modules/settings/cubit/settings_cubit.freezed.dart +++ /dev/null @@ -1,164 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'settings_cubit.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -/// @nodoc -mixin _$SettingsState { - @optionalTypeArgs - TResult when({ - required TResult Function() initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_Initial value) initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_Initial value)? initial, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_Initial value)? initial, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $SettingsStateCopyWith<$Res> { - factory $SettingsStateCopyWith( - SettingsState value, $Res Function(SettingsState) then) = - _$SettingsStateCopyWithImpl<$Res, SettingsState>; -} - -/// @nodoc -class _$SettingsStateCopyWithImpl<$Res, $Val extends SettingsState> - implements $SettingsStateCopyWith<$Res> { - _$SettingsStateCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; -} - -/// @nodoc -abstract class _$$_InitialCopyWith<$Res> { - factory _$$_InitialCopyWith( - _$_Initial value, $Res Function(_$_Initial) then) = - __$$_InitialCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$_InitialCopyWithImpl<$Res> - extends _$SettingsStateCopyWithImpl<$Res, _$_Initial> - implements _$$_InitialCopyWith<$Res> { - __$$_InitialCopyWithImpl(_$_Initial _value, $Res Function(_$_Initial) _then) - : super(_value, _then); -} - -/// @nodoc - -class _$_Initial implements _Initial { - const _$_Initial(); - - @override - String toString() { - return 'SettingsState.initial()'; - } - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_Initial); - } - - @override - int get hashCode => runtimeType.hashCode; - - @override - @optionalTypeArgs - TResult when({ - required TResult Function() initial, - }) { - return initial(); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function()? initial, - }) { - return initial?.call(); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function()? initial, - required TResult orElse(), - }) { - if (initial != null) { - return initial(); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_Initial value) initial, - }) { - return initial(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_Initial value)? initial, - }) { - return initial?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_Initial value)? initial, - required TResult orElse(), - }) { - if (initial != null) { - return initial(this); - } - return orElse(); - } -} - -abstract class _Initial implements SettingsState { - const factory _Initial() = _$_Initial; -} diff --git a/frontend/lib/src/modules/settings/cubit/settings_state.dart b/frontend/lib/src/modules/settings/cubit/settings_state.dart deleted file mode 100644 index 277ffaf..0000000 --- a/frontend/lib/src/modules/settings/cubit/settings_state.dart +++ /dev/null @@ -1,6 +0,0 @@ -part of 'settings_cubit.dart'; - -@freezed -class SettingsState with _$SettingsState { - const factory SettingsState.initial() = _Initial; -} diff --git a/frontend/modules/bloc_implementation/analysis_options.yaml b/frontend/modules/bloc_implementation/analysis_options.yaml new file mode 100644 index 0000000..fa798a8 --- /dev/null +++ b/frontend/modules/bloc_implementation/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:very_good_analysis/analysis_options.5.1.0.yaml +linter: + rules: + public_member_api_docs: false diff --git a/frontend/modules/bloc_implementation/lib/bloc_implementation.dart b/frontend/modules/bloc_implementation/lib/bloc_implementation.dart new file mode 100644 index 0000000..6b6e95d --- /dev/null +++ b/frontend/modules/bloc_implementation/lib/bloc_implementation.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export 'src/bootstrap.dart'; diff --git a/frontend/lib/src/app/app.dart b/frontend/modules/bloc_implementation/lib/src/app/app.dart similarity index 100% rename from frontend/lib/src/app/app.dart rename to frontend/modules/bloc_implementation/lib/src/app/app.dart diff --git a/frontend/lib/src/app/view/app.dart b/frontend/modules/bloc_implementation/lib/src/app/view/app.dart similarity index 51% rename from frontend/lib/src/app/view/app.dart rename to frontend/modules/bloc_implementation/lib/src/app/view/app.dart index a3d1219..1f76b47 100644 --- a/frontend/lib/src/app/view/app.dart +++ b/frontend/modules/bloc_implementation/lib/src/app/view/app.dart @@ -1,37 +1,19 @@ +import 'package:apis/apis.dart'; +import 'package:bloc_implementation/src/features/connection_checker/bloc/connection_checker_bloc.dart'; +import 'package:bloc_implementation/src/features/landing_loading/view/landing_loading_view.dart'; +import 'package:bloc_implementation/src/features/todo_sync/cubit/todo_sync_cubit.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:core/core.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:google_sign_in/google_sign_in.dart'; import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; import 'package:realm/realm.dart'; -import 'package:todo_bloc/src/core/constants/theme.dart'; -import 'package:todo_bloc/src/data/api/queue/local_queue_api.dart'; -import 'package:todo_bloc/src/data/api/queue/remote_queue_api.dart'; -import 'package:todo_bloc/src/data/api/todo/local_todo_api.dart'; -import 'package:todo_bloc/src/data/api/todo/remote_todo_api.dart'; -import 'package:todo_bloc/src/data/api/user_api.dart'; -import 'package:todo_bloc/src/data/local_storage/local_storage.dart'; -import 'package:todo_bloc/src/data/local_storage/local_storage_impl.dart'; -import 'package:todo_bloc/src/data/models/dtos/user/user_dto.dart'; -import 'package:todo_bloc/src/data/repositories/auth/auth_repository.dart'; -import 'package:todo_bloc/src/data/repositories/auth/auth_repository_impl.dart'; -import 'package:todo_bloc/src/data/repositories/connection_checker/connection_checker.dart'; -import 'package:todo_bloc/src/data/repositories/connection_checker/connection_checker_impl.dart'; -import 'package:todo_bloc/src/data/repositories/settings/settings_repository.dart'; -import 'package:todo_bloc/src/data/repositories/settings/settings_repository_impl.dart'; -import 'package:todo_bloc/src/data/repositories/todo/todo_repository.dart'; -import 'package:todo_bloc/src/data/repositories/todo/todo_repository_impl.dart'; -import 'package:todo_bloc/src/data/repositories/todo_sync/todo_sync_repository.dart'; -import 'package:todo_bloc/src/data/repositories/todo_sync/todo_sync_repository_impl.dart'; -import 'package:todo_bloc/src/l10n/l10n.dart'; -import 'package:todo_bloc/src/modules/connection_checker/bloc/connection_checker_bloc.dart'; -import 'package:todo_bloc/src/modules/landing_loading/view/landing_loading_view.dart'; -import 'package:todo_bloc/src/modules/settings/cubit/settings_cubit.dart'; -import 'package:todo_bloc/src/modules/todo_sync/cubit/todo_sync_cubit.dart'; +import 'package:repositories/repositories.dart'; -class App extends StatelessWidget { - const App({ +class BlocApp extends StatelessWidget { + const BlocApp({ required Realm realm, required InternetConnection internetConnection, super.key, @@ -53,9 +35,6 @@ class App extends StatelessWidget { create: (context) => ConnectionCheckerImpl(internetConnection: _internetConnection), ), - RepositoryProvider( - create: (context) => SettingsRepositoryImpl(), - ), RepositoryProvider( create: (context) => AuthRepositoryImpl( firebaseAuth: FirebaseAuth.instance, @@ -91,9 +70,6 @@ class App extends StatelessWidget { ], child: MultiBlocProvider( providers: [ - BlocProvider( - create: (context) => SettingsCubit(), - ), BlocProvider( create: (context) => ConnectionCheckerBloc( connectionChecker: context.read(), @@ -106,19 +82,11 @@ class App extends StatelessWidget { ), ), ], - child: BlocBuilder( - builder: (context, state) { - return MaterialApp( - debugShowCheckedModeBanner: false, - theme: TodoBlocAppTheme.lightTheme, - darkTheme: TodoBlocAppTheme.darkTheme, - // TODO(demolaf): change to use system - // themeMode: ThemeMode.system, - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - home: const LandingLoadingView(), - ); - }, + child: MaterialApp( + debugShowCheckedModeBanner: false, + theme: TodoBlocAppTheme.lightTheme, + darkTheme: TodoBlocAppTheme.darkTheme, + home: const LandingLoadingView(), ), ), ); diff --git a/frontend/lib/bootstrap.dart b/frontend/modules/bloc_implementation/lib/src/bootstrap.dart similarity index 69% rename from frontend/lib/bootstrap.dart rename to frontend/modules/bloc_implementation/lib/src/bootstrap.dart index 6ce0327..e0362f7 100644 --- a/frontend/lib/bootstrap.dart +++ b/frontend/modules/bloc_implementation/lib/src/bootstrap.dart @@ -1,9 +1,11 @@ import 'dart:async'; import 'dart:developer'; - import 'package:bloc/bloc.dart'; +import 'package:bloc_implementation/src/app/app.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; +import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; +import 'package:realm/realm.dart'; class AppBlocObserver extends BlocObserver { const AppBlocObserver(); @@ -34,3 +36,15 @@ Future bootstrap(FutureOr Function() builder) async { runApp(await builder()); } + +Future runBlocApp({ + required Realm realm, + required InternetConnection internetConnection, +}) async { + await bootstrap( + () => BlocApp( + realm: realm, + internetConnection: internetConnection, + ), + ); +} diff --git a/frontend/lib/src/modules/connection_checker/bloc/connection_checker_bloc.dart b/frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_bloc.dart similarity index 90% rename from frontend/lib/src/modules/connection_checker/bloc/connection_checker_bloc.dart rename to frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_bloc.dart index de8d2ca..ad8b156 100644 --- a/frontend/lib/src/modules/connection_checker/bloc/connection_checker_bloc.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_bloc.dart @@ -4,8 +4,7 @@ import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; -import 'package:todo_bloc/src/data/repositories/connection_checker/connection_checker.dart'; -import 'package:todo_bloc/src/data/repositories/todo/todo_repository.dart'; +import 'package:repositories/repositories.dart'; part 'connection_checker_bloc.freezed.dart'; diff --git a/frontend/lib/src/modules/connection_checker/bloc/connection_checker_bloc.freezed.dart b/frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_bloc.freezed.dart similarity index 79% rename from frontend/lib/src/modules/connection_checker/bloc/connection_checker_bloc.freezed.dart rename to frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_bloc.freezed.dart index d11a5fa..b90a227 100644 --- a/frontend/lib/src/modules/connection_checker/bloc/connection_checker_bloc.freezed.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_bloc.freezed.dart @@ -88,29 +88,29 @@ class _$ConnectionCheckerStateCopyWithImpl<$Res, } /// @nodoc -abstract class _$$_ConnectionCheckerStateInitialCopyWith<$Res> { - factory _$$_ConnectionCheckerStateInitialCopyWith( - _$_ConnectionCheckerStateInitial value, - $Res Function(_$_ConnectionCheckerStateInitial) then) = - __$$_ConnectionCheckerStateInitialCopyWithImpl<$Res>; +abstract class _$$ConnectionCheckerStateInitialImplCopyWith<$Res> { + factory _$$ConnectionCheckerStateInitialImplCopyWith( + _$ConnectionCheckerStateInitialImpl value, + $Res Function(_$ConnectionCheckerStateInitialImpl) then) = + __$$ConnectionCheckerStateInitialImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_ConnectionCheckerStateInitialCopyWithImpl<$Res> +class __$$ConnectionCheckerStateInitialImplCopyWithImpl<$Res> extends _$ConnectionCheckerStateCopyWithImpl<$Res, - _$_ConnectionCheckerStateInitial> - implements _$$_ConnectionCheckerStateInitialCopyWith<$Res> { - __$$_ConnectionCheckerStateInitialCopyWithImpl( - _$_ConnectionCheckerStateInitial _value, - $Res Function(_$_ConnectionCheckerStateInitial) _then) + _$ConnectionCheckerStateInitialImpl> + implements _$$ConnectionCheckerStateInitialImplCopyWith<$Res> { + __$$ConnectionCheckerStateInitialImplCopyWithImpl( + _$ConnectionCheckerStateInitialImpl _value, + $Res Function(_$ConnectionCheckerStateInitialImpl) _then) : super(_value, _then); } /// @nodoc -class _$_ConnectionCheckerStateInitial +class _$ConnectionCheckerStateInitialImpl implements _ConnectionCheckerStateInitial { - const _$_ConnectionCheckerStateInitial(); + const _$ConnectionCheckerStateInitialImpl(); @override String toString() { @@ -121,7 +121,7 @@ class _$_ConnectionCheckerStateInitial bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_ConnectionCheckerStateInitial); + other is _$ConnectionCheckerStateInitialImpl); } @override @@ -205,32 +205,33 @@ class _$_ConnectionCheckerStateInitial abstract class _ConnectionCheckerStateInitial implements ConnectionCheckerState { const factory _ConnectionCheckerStateInitial() = - _$_ConnectionCheckerStateInitial; + _$ConnectionCheckerStateInitialImpl; } /// @nodoc -abstract class _$$ConnectionCheckerStateLoadingCopyWith<$Res> { - factory _$$ConnectionCheckerStateLoadingCopyWith( - _$ConnectionCheckerStateLoading value, - $Res Function(_$ConnectionCheckerStateLoading) then) = - __$$ConnectionCheckerStateLoadingCopyWithImpl<$Res>; +abstract class _$$ConnectionCheckerStateLoadingImplCopyWith<$Res> { + factory _$$ConnectionCheckerStateLoadingImplCopyWith( + _$ConnectionCheckerStateLoadingImpl value, + $Res Function(_$ConnectionCheckerStateLoadingImpl) then) = + __$$ConnectionCheckerStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$ConnectionCheckerStateLoadingCopyWithImpl<$Res> +class __$$ConnectionCheckerStateLoadingImplCopyWithImpl<$Res> extends _$ConnectionCheckerStateCopyWithImpl<$Res, - _$ConnectionCheckerStateLoading> - implements _$$ConnectionCheckerStateLoadingCopyWith<$Res> { - __$$ConnectionCheckerStateLoadingCopyWithImpl( - _$ConnectionCheckerStateLoading _value, - $Res Function(_$ConnectionCheckerStateLoading) _then) + _$ConnectionCheckerStateLoadingImpl> + implements _$$ConnectionCheckerStateLoadingImplCopyWith<$Res> { + __$$ConnectionCheckerStateLoadingImplCopyWithImpl( + _$ConnectionCheckerStateLoadingImpl _value, + $Res Function(_$ConnectionCheckerStateLoadingImpl) _then) : super(_value, _then); } /// @nodoc -class _$ConnectionCheckerStateLoading implements ConnectionCheckerStateLoading { - const _$ConnectionCheckerStateLoading(); +class _$ConnectionCheckerStateLoadingImpl + implements ConnectionCheckerStateLoading { + const _$ConnectionCheckerStateLoadingImpl(); @override String toString() { @@ -241,7 +242,7 @@ class _$ConnectionCheckerStateLoading implements ConnectionCheckerStateLoading { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ConnectionCheckerStateLoading); + other is _$ConnectionCheckerStateLoadingImpl); } @override @@ -324,27 +325,27 @@ class _$ConnectionCheckerStateLoading implements ConnectionCheckerStateLoading { abstract class ConnectionCheckerStateLoading implements ConnectionCheckerState { const factory ConnectionCheckerStateLoading() = - _$ConnectionCheckerStateLoading; + _$ConnectionCheckerStateLoadingImpl; } /// @nodoc -abstract class _$$ConnectionCheckerStateReadyCopyWith<$Res> { - factory _$$ConnectionCheckerStateReadyCopyWith( - _$ConnectionCheckerStateReady value, - $Res Function(_$ConnectionCheckerStateReady) then) = - __$$ConnectionCheckerStateReadyCopyWithImpl<$Res>; +abstract class _$$ConnectionCheckerStateReadyImplCopyWith<$Res> { + factory _$$ConnectionCheckerStateReadyImplCopyWith( + _$ConnectionCheckerStateReadyImpl value, + $Res Function(_$ConnectionCheckerStateReadyImpl) then) = + __$$ConnectionCheckerStateReadyImplCopyWithImpl<$Res>; @useResult $Res call({bool connected}); } /// @nodoc -class __$$ConnectionCheckerStateReadyCopyWithImpl<$Res> +class __$$ConnectionCheckerStateReadyImplCopyWithImpl<$Res> extends _$ConnectionCheckerStateCopyWithImpl<$Res, - _$ConnectionCheckerStateReady> - implements _$$ConnectionCheckerStateReadyCopyWith<$Res> { - __$$ConnectionCheckerStateReadyCopyWithImpl( - _$ConnectionCheckerStateReady _value, - $Res Function(_$ConnectionCheckerStateReady) _then) + _$ConnectionCheckerStateReadyImpl> + implements _$$ConnectionCheckerStateReadyImplCopyWith<$Res> { + __$$ConnectionCheckerStateReadyImplCopyWithImpl( + _$ConnectionCheckerStateReadyImpl _value, + $Res Function(_$ConnectionCheckerStateReadyImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -352,7 +353,7 @@ class __$$ConnectionCheckerStateReadyCopyWithImpl<$Res> $Res call({ Object? connected = null, }) { - return _then(_$ConnectionCheckerStateReady( + return _then(_$ConnectionCheckerStateReadyImpl( connected: null == connected ? _value.connected : connected // ignore: cast_nullable_to_non_nullable @@ -363,8 +364,8 @@ class __$$ConnectionCheckerStateReadyCopyWithImpl<$Res> /// @nodoc -class _$ConnectionCheckerStateReady implements ConnectionCheckerStateReady { - const _$ConnectionCheckerStateReady({required this.connected}); +class _$ConnectionCheckerStateReadyImpl implements ConnectionCheckerStateReady { + const _$ConnectionCheckerStateReadyImpl({required this.connected}); @override final bool connected; @@ -378,7 +379,7 @@ class _$ConnectionCheckerStateReady implements ConnectionCheckerStateReady { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ConnectionCheckerStateReady && + other is _$ConnectionCheckerStateReadyImpl && (identical(other.connected, connected) || other.connected == connected)); } @@ -389,9 +390,9 @@ class _$ConnectionCheckerStateReady implements ConnectionCheckerStateReady { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ConnectionCheckerStateReadyCopyWith<_$ConnectionCheckerStateReady> - get copyWith => __$$ConnectionCheckerStateReadyCopyWithImpl< - _$ConnectionCheckerStateReady>(this, _$identity); + _$$ConnectionCheckerStateReadyImplCopyWith<_$ConnectionCheckerStateReadyImpl> + get copyWith => __$$ConnectionCheckerStateReadyImplCopyWithImpl< + _$ConnectionCheckerStateReadyImpl>(this, _$identity); @override @optionalTypeArgs @@ -470,32 +471,32 @@ class _$ConnectionCheckerStateReady implements ConnectionCheckerStateReady { abstract class ConnectionCheckerStateReady implements ConnectionCheckerState { const factory ConnectionCheckerStateReady({required final bool connected}) = - _$ConnectionCheckerStateReady; + _$ConnectionCheckerStateReadyImpl; bool get connected; @JsonKey(ignore: true) - _$$ConnectionCheckerStateReadyCopyWith<_$ConnectionCheckerStateReady> + _$$ConnectionCheckerStateReadyImplCopyWith<_$ConnectionCheckerStateReadyImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$ConnectionCheckerStateErrorCopyWith<$Res> { - factory _$$ConnectionCheckerStateErrorCopyWith( - _$ConnectionCheckerStateError value, - $Res Function(_$ConnectionCheckerStateError) then) = - __$$ConnectionCheckerStateErrorCopyWithImpl<$Res>; +abstract class _$$ConnectionCheckerStateErrorImplCopyWith<$Res> { + factory _$$ConnectionCheckerStateErrorImplCopyWith( + _$ConnectionCheckerStateErrorImpl value, + $Res Function(_$ConnectionCheckerStateErrorImpl) then) = + __$$ConnectionCheckerStateErrorImplCopyWithImpl<$Res>; @useResult $Res call({String message}); } /// @nodoc -class __$$ConnectionCheckerStateErrorCopyWithImpl<$Res> +class __$$ConnectionCheckerStateErrorImplCopyWithImpl<$Res> extends _$ConnectionCheckerStateCopyWithImpl<$Res, - _$ConnectionCheckerStateError> - implements _$$ConnectionCheckerStateErrorCopyWith<$Res> { - __$$ConnectionCheckerStateErrorCopyWithImpl( - _$ConnectionCheckerStateError _value, - $Res Function(_$ConnectionCheckerStateError) _then) + _$ConnectionCheckerStateErrorImpl> + implements _$$ConnectionCheckerStateErrorImplCopyWith<$Res> { + __$$ConnectionCheckerStateErrorImplCopyWithImpl( + _$ConnectionCheckerStateErrorImpl _value, + $Res Function(_$ConnectionCheckerStateErrorImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -503,7 +504,7 @@ class __$$ConnectionCheckerStateErrorCopyWithImpl<$Res> $Res call({ Object? message = null, }) { - return _then(_$ConnectionCheckerStateError( + return _then(_$ConnectionCheckerStateErrorImpl( message: null == message ? _value.message : message // ignore: cast_nullable_to_non_nullable @@ -514,8 +515,8 @@ class __$$ConnectionCheckerStateErrorCopyWithImpl<$Res> /// @nodoc -class _$ConnectionCheckerStateError implements ConnectionCheckerStateError { - const _$ConnectionCheckerStateError({required this.message}); +class _$ConnectionCheckerStateErrorImpl implements ConnectionCheckerStateError { + const _$ConnectionCheckerStateErrorImpl({required this.message}); @override final String message; @@ -529,7 +530,7 @@ class _$ConnectionCheckerStateError implements ConnectionCheckerStateError { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ConnectionCheckerStateError && + other is _$ConnectionCheckerStateErrorImpl && (identical(other.message, message) || other.message == message)); } @@ -539,9 +540,9 @@ class _$ConnectionCheckerStateError implements ConnectionCheckerStateError { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ConnectionCheckerStateErrorCopyWith<_$ConnectionCheckerStateError> - get copyWith => __$$ConnectionCheckerStateErrorCopyWithImpl< - _$ConnectionCheckerStateError>(this, _$identity); + _$$ConnectionCheckerStateErrorImplCopyWith<_$ConnectionCheckerStateErrorImpl> + get copyWith => __$$ConnectionCheckerStateErrorImplCopyWithImpl< + _$ConnectionCheckerStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -620,10 +621,10 @@ class _$ConnectionCheckerStateError implements ConnectionCheckerStateError { abstract class ConnectionCheckerStateError implements ConnectionCheckerState { const factory ConnectionCheckerStateError({required final String message}) = - _$ConnectionCheckerStateError; + _$ConnectionCheckerStateErrorImpl; String get message; @JsonKey(ignore: true) - _$$ConnectionCheckerStateErrorCopyWith<_$ConnectionCheckerStateError> + _$$ConnectionCheckerStateErrorImplCopyWith<_$ConnectionCheckerStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/frontend/lib/src/modules/connection_checker/bloc/connection_checker_event.dart b/frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_event.dart similarity index 100% rename from frontend/lib/src/modules/connection_checker/bloc/connection_checker_event.dart rename to frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_event.dart diff --git a/frontend/lib/src/modules/connection_checker/bloc/connection_checker_state.dart b/frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_state.dart similarity index 100% rename from frontend/lib/src/modules/connection_checker/bloc/connection_checker_state.dart rename to frontend/modules/bloc_implementation/lib/src/features/connection_checker/bloc/connection_checker_state.dart diff --git a/frontend/lib/src/modules/home/bloc/home_bloc.dart b/frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_bloc.dart similarity index 84% rename from frontend/lib/src/modules/home/bloc/home_bloc.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_bloc.dart index 0edd464..67573ef 100644 --- a/frontend/lib/src/modules/home/bloc/home_bloc.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_bloc.dart @@ -1,15 +1,12 @@ +import 'package:apis/apis.dart'; +import 'package:bloc/bloc.dart'; +import 'package:core/core.dart'; import 'package:equatable/equatable.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:todo_bloc/src/core/global_imports.dart'; -import 'package:todo_bloc/src/data/models/domains/queue.dart'; -import 'package:todo_bloc/src/data/models/domains/todo.dart'; -import 'package:todo_bloc/src/data/repositories/todo/todo_repository.dart'; -import 'package:todo_bloc/src/data/repositories/todo_sync/todo_sync_repository.dart'; +import 'package:repositories/repositories.dart'; part 'home_bloc.freezed.dart'; - part 'home_event.dart'; - part 'home_state.dart'; class HomeBloc extends Bloc { diff --git a/frontend/lib/src/modules/home/bloc/home_bloc.freezed.dart b/frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_bloc.freezed.dart similarity index 80% rename from frontend/lib/src/modules/home/bloc/home_bloc.freezed.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_bloc.freezed.dart index bd32bf8..b4e6d59 100644 --- a/frontend/lib/src/modules/home/bloc/home_bloc.freezed.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_bloc.freezed.dart @@ -92,40 +92,35 @@ class _$HomeStateCopyWithImpl<$Res, $Val extends HomeState> } /// @nodoc -abstract class _$$_InitialCopyWith<$Res> { - factory _$$_InitialCopyWith( - _$_Initial value, $Res Function(_$_Initial) then) = - __$$_InitialCopyWithImpl<$Res>; +abstract class _$$InitialImplCopyWith<$Res> { + factory _$$InitialImplCopyWith( + _$InitialImpl value, $Res Function(_$InitialImpl) then) = + __$$InitialImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_InitialCopyWithImpl<$Res> - extends _$HomeStateCopyWithImpl<$Res, _$_Initial> - implements _$$_InitialCopyWith<$Res> { - __$$_InitialCopyWithImpl(_$_Initial _value, $Res Function(_$_Initial) _then) +class __$$InitialImplCopyWithImpl<$Res> + extends _$HomeStateCopyWithImpl<$Res, _$InitialImpl> + implements _$$InitialImplCopyWith<$Res> { + __$$InitialImplCopyWithImpl( + _$InitialImpl _value, $Res Function(_$InitialImpl) _then) : super(_value, _then); } /// @nodoc -class _$_Initial with DiagnosticableTreeMixin implements _Initial { - const _$_Initial(); +class _$InitialImpl implements _Initial { + const _$InitialImpl(); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + String toString() { return 'HomeState.initial()'; } - @override - void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); - properties.add(DiagnosticsProperty('type', 'HomeState.initial')); - } - @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_Initial); + (other.runtimeType == runtimeType && other is _$InitialImpl); } @override @@ -213,47 +208,39 @@ class _$_Initial with DiagnosticableTreeMixin implements _Initial { } abstract class _Initial implements HomeState { - const factory _Initial() = _$_Initial; + const factory _Initial() = _$InitialImpl; } /// @nodoc -abstract class _$$HomeStateLoadingCopyWith<$Res> { - factory _$$HomeStateLoadingCopyWith( - _$HomeStateLoading value, $Res Function(_$HomeStateLoading) then) = - __$$HomeStateLoadingCopyWithImpl<$Res>; +abstract class _$$HomeStateLoadingImplCopyWith<$Res> { + factory _$$HomeStateLoadingImplCopyWith(_$HomeStateLoadingImpl value, + $Res Function(_$HomeStateLoadingImpl) then) = + __$$HomeStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$HomeStateLoadingCopyWithImpl<$Res> - extends _$HomeStateCopyWithImpl<$Res, _$HomeStateLoading> - implements _$$HomeStateLoadingCopyWith<$Res> { - __$$HomeStateLoadingCopyWithImpl( - _$HomeStateLoading _value, $Res Function(_$HomeStateLoading) _then) +class __$$HomeStateLoadingImplCopyWithImpl<$Res> + extends _$HomeStateCopyWithImpl<$Res, _$HomeStateLoadingImpl> + implements _$$HomeStateLoadingImplCopyWith<$Res> { + __$$HomeStateLoadingImplCopyWithImpl(_$HomeStateLoadingImpl _value, + $Res Function(_$HomeStateLoadingImpl) _then) : super(_value, _then); } /// @nodoc -class _$HomeStateLoading - with DiagnosticableTreeMixin - implements HomeStateLoading { - const _$HomeStateLoading(); +class _$HomeStateLoadingImpl implements HomeStateLoading { + const _$HomeStateLoadingImpl(); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + String toString() { return 'HomeState.loading()'; } - @override - void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); - properties.add(DiagnosticsProperty('type', 'HomeState.loading')); - } - @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$HomeStateLoading); + (other.runtimeType == runtimeType && other is _$HomeStateLoadingImpl); } @override @@ -341,24 +328,24 @@ class _$HomeStateLoading } abstract class HomeStateLoading implements HomeState { - const factory HomeStateLoading() = _$HomeStateLoading; + const factory HomeStateLoading() = _$HomeStateLoadingImpl; } /// @nodoc -abstract class _$$HomeStateReadyCopyWith<$Res> { - factory _$$HomeStateReadyCopyWith( - _$HomeStateReady value, $Res Function(_$HomeStateReady) then) = - __$$HomeStateReadyCopyWithImpl<$Res>; +abstract class _$$HomeStateReadyImplCopyWith<$Res> { + factory _$$HomeStateReadyImplCopyWith(_$HomeStateReadyImpl value, + $Res Function(_$HomeStateReadyImpl) then) = + __$$HomeStateReadyImplCopyWithImpl<$Res>; @useResult $Res call({List today, List upcoming, List completed}); } /// @nodoc -class __$$HomeStateReadyCopyWithImpl<$Res> - extends _$HomeStateCopyWithImpl<$Res, _$HomeStateReady> - implements _$$HomeStateReadyCopyWith<$Res> { - __$$HomeStateReadyCopyWithImpl( - _$HomeStateReady _value, $Res Function(_$HomeStateReady) _then) +class __$$HomeStateReadyImplCopyWithImpl<$Res> + extends _$HomeStateCopyWithImpl<$Res, _$HomeStateReadyImpl> + implements _$$HomeStateReadyImplCopyWith<$Res> { + __$$HomeStateReadyImplCopyWithImpl( + _$HomeStateReadyImpl _value, $Res Function(_$HomeStateReadyImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -368,7 +355,7 @@ class __$$HomeStateReadyCopyWithImpl<$Res> Object? upcoming = null, Object? completed = null, }) { - return _then(_$HomeStateReady( + return _then(_$HomeStateReadyImpl( today: null == today ? _value._today : today // ignore: cast_nullable_to_non_nullable @@ -387,8 +374,8 @@ class __$$HomeStateReadyCopyWithImpl<$Res> /// @nodoc -class _$HomeStateReady with DiagnosticableTreeMixin implements HomeStateReady { - const _$HomeStateReady( +class _$HomeStateReadyImpl implements HomeStateReady { + const _$HomeStateReadyImpl( {required final List today, required final List upcoming, required final List completed}) @@ -421,25 +408,15 @@ class _$HomeStateReady with DiagnosticableTreeMixin implements HomeStateReady { } @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + String toString() { return 'HomeState.ready(today: $today, upcoming: $upcoming, completed: $completed)'; } - @override - void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); - properties - ..add(DiagnosticsProperty('type', 'HomeState.ready')) - ..add(DiagnosticsProperty('today', today)) - ..add(DiagnosticsProperty('upcoming', upcoming)) - ..add(DiagnosticsProperty('completed', completed)); - } - @override bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$HomeStateReady && + other is _$HomeStateReadyImpl && const DeepCollectionEquality().equals(other._today, _today) && const DeepCollectionEquality().equals(other._upcoming, _upcoming) && const DeepCollectionEquality() @@ -456,8 +433,9 @@ class _$HomeStateReady with DiagnosticableTreeMixin implements HomeStateReady { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$HomeStateReadyCopyWith<_$HomeStateReady> get copyWith => - __$$HomeStateReadyCopyWithImpl<_$HomeStateReady>(this, _$identity); + _$$HomeStateReadyImplCopyWith<_$HomeStateReadyImpl> get copyWith => + __$$HomeStateReadyImplCopyWithImpl<_$HomeStateReadyImpl>( + this, _$identity); @override @optionalTypeArgs @@ -544,31 +522,31 @@ abstract class HomeStateReady implements HomeState { const factory HomeStateReady( {required final List today, required final List upcoming, - required final List completed}) = _$HomeStateReady; + required final List completed}) = _$HomeStateReadyImpl; List get today; List get upcoming; List get completed; @JsonKey(ignore: true) - _$$HomeStateReadyCopyWith<_$HomeStateReady> get copyWith => + _$$HomeStateReadyImplCopyWith<_$HomeStateReadyImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$ViewingQueuesCopyWith<$Res> { - factory _$$ViewingQueuesCopyWith( - _$ViewingQueues value, $Res Function(_$ViewingQueues) then) = - __$$ViewingQueuesCopyWithImpl<$Res>; +abstract class _$$ViewingQueuesImplCopyWith<$Res> { + factory _$$ViewingQueuesImplCopyWith( + _$ViewingQueuesImpl value, $Res Function(_$ViewingQueuesImpl) then) = + __$$ViewingQueuesImplCopyWithImpl<$Res>; @useResult $Res call({List queues}); } /// @nodoc -class __$$ViewingQueuesCopyWithImpl<$Res> - extends _$HomeStateCopyWithImpl<$Res, _$ViewingQueues> - implements _$$ViewingQueuesCopyWith<$Res> { - __$$ViewingQueuesCopyWithImpl( - _$ViewingQueues _value, $Res Function(_$ViewingQueues) _then) +class __$$ViewingQueuesImplCopyWithImpl<$Res> + extends _$HomeStateCopyWithImpl<$Res, _$ViewingQueuesImpl> + implements _$$ViewingQueuesImplCopyWith<$Res> { + __$$ViewingQueuesImplCopyWithImpl( + _$ViewingQueuesImpl _value, $Res Function(_$ViewingQueuesImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -576,7 +554,7 @@ class __$$ViewingQueuesCopyWithImpl<$Res> $Res call({ Object? queues = null, }) { - return _then(_$ViewingQueues( + return _then(_$ViewingQueuesImpl( queues: null == queues ? _value._queues : queues // ignore: cast_nullable_to_non_nullable @@ -587,8 +565,8 @@ class __$$ViewingQueuesCopyWithImpl<$Res> /// @nodoc -class _$ViewingQueues with DiagnosticableTreeMixin implements ViewingQueues { - const _$ViewingQueues({required final List queues}) +class _$ViewingQueuesImpl implements ViewingQueues { + const _$ViewingQueuesImpl({required final List queues}) : _queues = queues; final List _queues; @@ -600,23 +578,15 @@ class _$ViewingQueues with DiagnosticableTreeMixin implements ViewingQueues { } @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + String toString() { return 'HomeState.viewingQueues(queues: $queues)'; } - @override - void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); - properties - ..add(DiagnosticsProperty('type', 'HomeState.viewingQueues')) - ..add(DiagnosticsProperty('queues', queues)); - } - @override bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ViewingQueues && + other is _$ViewingQueuesImpl && const DeepCollectionEquality().equals(other._queues, _queues)); } @@ -627,8 +597,8 @@ class _$ViewingQueues with DiagnosticableTreeMixin implements ViewingQueues { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ViewingQueuesCopyWith<_$ViewingQueues> get copyWith => - __$$ViewingQueuesCopyWithImpl<_$ViewingQueues>(this, _$identity); + _$$ViewingQueuesImplCopyWith<_$ViewingQueuesImpl> get copyWith => + __$$ViewingQueuesImplCopyWithImpl<_$ViewingQueuesImpl>(this, _$identity); @override @optionalTypeArgs @@ -713,10 +683,10 @@ class _$ViewingQueues with DiagnosticableTreeMixin implements ViewingQueues { abstract class ViewingQueues implements HomeState { const factory ViewingQueues({required final List queues}) = - _$ViewingQueues; + _$ViewingQueuesImpl; List get queues; @JsonKey(ignore: true) - _$$ViewingQueuesCopyWith<_$ViewingQueues> get copyWith => + _$$ViewingQueuesImplCopyWith<_$ViewingQueuesImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/frontend/lib/src/modules/home/bloc/home_event.dart b/frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_event.dart similarity index 100% rename from frontend/lib/src/modules/home/bloc/home_event.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_event.dart diff --git a/frontend/lib/src/modules/home/bloc/home_state.dart b/frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_state.dart similarity index 100% rename from frontend/lib/src/modules/home/bloc/home_state.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/bloc/home_state.dart diff --git a/frontend/lib/src/modules/home/view/home_view.dart b/frontend/modules/bloc_implementation/lib/src/features/home/view/home_view.dart similarity index 87% rename from frontend/lib/src/modules/home/view/home_view.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/view/home_view.dart index 845149c..f29e667 100644 --- a/frontend/lib/src/modules/home/view/home_view.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/view/home_view.dart @@ -1,15 +1,15 @@ +import 'package:bloc_implementation/src/features/connection_checker/bloc/connection_checker_bloc.dart'; +import 'package:bloc_implementation/src/features/home/bloc/home_bloc.dart'; +import 'package:bloc_implementation/src/features/home/view/pages/queues_view.dart'; +import 'package:bloc_implementation/src/features/home/view/widgets/animated_sync_status.dart'; +import 'package:bloc_implementation/src/features/home/view/widgets/todo_list_view_builder.dart'; +import 'package:bloc_implementation/src/features/todo_sync/cubit/todo_sync_cubit.dart'; +import 'package:bloc_implementation/src/features/view_todo/view/view_todo_view.dart'; +import 'package:core/core.dart'; import 'package:flutter/cupertino.dart'; -import 'package:todo_bloc/src/core/enums/todo_operation_type.dart'; -import 'package:todo_bloc/src/core/global_imports.dart'; -import 'package:todo_bloc/src/data/repositories/todo/todo_repository.dart'; -import 'package:todo_bloc/src/data/repositories/todo_sync/todo_sync_repository.dart'; -import 'package:todo_bloc/src/modules/connection_checker/bloc/connection_checker_bloc.dart'; -import 'package:todo_bloc/src/modules/home/bloc/home_bloc.dart'; -import 'package:todo_bloc/src/modules/home/view/pages/queues_view.dart'; -import 'package:todo_bloc/src/modules/home/view/widgets/animated_sync_status.dart'; -import 'package:todo_bloc/src/modules/home/view/widgets/todo_list_view_builder.dart'; -import 'package:todo_bloc/src/modules/todo_sync/cubit/todo_sync_cubit.dart'; -import 'package:todo_bloc/src/modules/view_todo/view/view_todo_view.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:repositories/repositories.dart'; class HomeView extends StatefulWidget { const HomeView({super.key}); diff --git a/frontend/lib/src/modules/home/view/pages/queues_view.dart b/frontend/modules/bloc_implementation/lib/src/features/home/view/pages/queues_view.dart similarity index 95% rename from frontend/lib/src/modules/home/view/pages/queues_view.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/view/pages/queues_view.dart index 670bb16..7fa24a2 100644 --- a/frontend/lib/src/modules/home/view/pages/queues_view.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/view/pages/queues_view.dart @@ -1,8 +1,8 @@ import 'dart:io'; - +import 'package:bloc_implementation/src/features/home/bloc/home_bloc.dart'; import 'package:device_info_plus/device_info_plus.dart'; -import 'package:todo_bloc/src/core/global_imports.dart'; -import 'package:todo_bloc/src/modules/home/bloc/home_bloc.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; class QueuesView extends StatelessWidget { const QueuesView({super.key}); diff --git a/frontend/lib/src/modules/home/view/widgets/animated_sync_status.dart b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/animated_sync_status.dart similarity index 95% rename from frontend/lib/src/modules/home/view/widgets/animated_sync_status.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/animated_sync_status.dart index 0e0dfbf..f2e921e 100644 --- a/frontend/lib/src/modules/home/view/widgets/animated_sync_status.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/animated_sync_status.dart @@ -1,6 +1,5 @@ import 'dart:math'; - -import 'package:todo_bloc/src/core/global_imports.dart'; +import 'package:flutter/material.dart'; class AnimatedSyncStatus extends StatefulWidget { const AnimatedSyncStatus({ diff --git a/frontend/lib/src/modules/home/view/widgets/custom_tab.dart b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/custom_tab.dart similarity index 90% rename from frontend/lib/src/modules/home/view/widgets/custom_tab.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/custom_tab.dart index a685de9..910a939 100644 --- a/frontend/lib/src/modules/home/view/widgets/custom_tab.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/custom_tab.dart @@ -1,4 +1,4 @@ -import 'package:todo_bloc/src/core/global_imports.dart'; +import 'package:flutter/material.dart'; class CustomTab extends StatelessWidget { const CustomTab({ diff --git a/frontend/lib/src/modules/home/view/widgets/empty_list_state.dart b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/empty_list_state.dart similarity index 92% rename from frontend/lib/src/modules/home/view/widgets/empty_list_state.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/empty_list_state.dart index 34f0f17..5c3b7ea 100644 --- a/frontend/lib/src/modules/home/view/widgets/empty_list_state.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/empty_list_state.dart @@ -1,4 +1,4 @@ -import 'package:todo_bloc/src/core/global_imports.dart'; +import 'package:flutter/material.dart'; class EmptyListState extends StatelessWidget { const EmptyListState({ diff --git a/frontend/lib/src/modules/home/view/widgets/todays_todos_list_view.dart b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/todays_todos_list_view.dart similarity index 67% rename from frontend/lib/src/modules/home/view/widgets/todays_todos_list_view.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/todays_todos_list_view.dart index e958eda..c30cab9 100644 --- a/frontend/lib/src/modules/home/view/widgets/todays_todos_list_view.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/todays_todos_list_view.dart @@ -1,6 +1,6 @@ -import 'package:todo_bloc/src/core/global_imports.dart'; -import 'package:todo_bloc/src/data/models/domains/todo.dart'; -import 'package:todo_bloc/src/modules/home/view/widgets/todo_list_item.dart'; +import 'package:apis/apis.dart'; +import 'package:bloc_implementation/src/features/home/view/widgets/todo_list_item.dart'; +import 'package:flutter/material.dart'; class TodoSectionListView extends StatelessWidget { const TodoSectionListView({ diff --git a/frontend/lib/src/modules/home/view/widgets/todo_list_item.dart b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/todo_list_item.dart similarity index 93% rename from frontend/lib/src/modules/home/view/widgets/todo_list_item.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/todo_list_item.dart index af675c1..62c2055 100644 --- a/frontend/lib/src/modules/home/view/widgets/todo_list_item.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/todo_list_item.dart @@ -1,8 +1,7 @@ -import 'package:flex_color_scheme/flex_color_scheme.dart'; -import 'package:todo_bloc/src/core/enums/todo_operation_type.dart'; -import 'package:todo_bloc/src/core/global_imports.dart'; -import 'package:todo_bloc/src/data/models/domains/todo.dart'; -import 'package:todo_bloc/src/modules/view_todo/view/view_todo_view.dart'; +import 'package:apis/apis.dart'; +import 'package:bloc_implementation/src/features/view_todo/view/view_todo_view.dart'; +import 'package:core/core.dart'; +import 'package:flutter/material.dart'; class TodoSectionListItem extends StatelessWidget { const TodoSectionListItem({ diff --git a/frontend/lib/src/modules/home/view/widgets/todo_list_view_builder.dart b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/todo_list_view_builder.dart similarity index 90% rename from frontend/lib/src/modules/home/view/widgets/todo_list_view_builder.dart rename to frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/todo_list_view_builder.dart index cca0313..972744b 100644 --- a/frontend/lib/src/modules/home/view/widgets/todo_list_view_builder.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/home/view/widgets/todo_list_view_builder.dart @@ -1,8 +1,8 @@ +import 'package:apis/apis.dart'; +import 'package:bloc_implementation/src/features/home/view/widgets/empty_list_state.dart'; +import 'package:bloc_implementation/src/features/home/view/widgets/todays_todos_list_view.dart'; +import 'package:core/core.dart'; import 'package:flutter/material.dart'; -import 'package:todo_bloc/src/core/enums/enums.dart'; -import 'package:todo_bloc/src/data/models/domains/todo.dart'; -import 'package:todo_bloc/src/modules/home/view/widgets/empty_list_state.dart'; -import 'package:todo_bloc/src/modules/home/view/widgets/todays_todos_list_view.dart'; class TodoListViewBuilder extends StatefulWidget { const TodoListViewBuilder({ diff --git a/frontend/lib/src/modules/landing_loading/bloc/landing_loading_bloc.dart b/frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_bloc.dart similarity index 93% rename from frontend/lib/src/modules/landing_loading/bloc/landing_loading_bloc.dart rename to frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_bloc.dart index 85f5d7c..850f6b6 100644 --- a/frontend/lib/src/modules/landing_loading/bloc/landing_loading_bloc.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_bloc.dart @@ -1,7 +1,7 @@ import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:todo_bloc/src/data/repositories/auth/auth_repository.dart'; +import 'package:repositories/repositories.dart'; part 'landing_loading_bloc.freezed.dart'; diff --git a/frontend/lib/src/modules/landing_loading/bloc/landing_loading_bloc.freezed.dart b/frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_bloc.freezed.dart similarity index 84% rename from frontend/lib/src/modules/landing_loading/bloc/landing_loading_bloc.freezed.dart rename to frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_bloc.freezed.dart index f4c252a..0807aa2 100644 --- a/frontend/lib/src/modules/landing_loading/bloc/landing_loading_bloc.freezed.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_bloc.freezed.dart @@ -87,24 +87,25 @@ class _$LandingLoadingStateCopyWithImpl<$Res, $Val extends LandingLoadingState> } /// @nodoc -abstract class _$$_InitialCopyWith<$Res> { - factory _$$_InitialCopyWith( - _$_Initial value, $Res Function(_$_Initial) then) = - __$$_InitialCopyWithImpl<$Res>; +abstract class _$$InitialImplCopyWith<$Res> { + factory _$$InitialImplCopyWith( + _$InitialImpl value, $Res Function(_$InitialImpl) then) = + __$$InitialImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_InitialCopyWithImpl<$Res> - extends _$LandingLoadingStateCopyWithImpl<$Res, _$_Initial> - implements _$$_InitialCopyWith<$Res> { - __$$_InitialCopyWithImpl(_$_Initial _value, $Res Function(_$_Initial) _then) +class __$$InitialImplCopyWithImpl<$Res> + extends _$LandingLoadingStateCopyWithImpl<$Res, _$InitialImpl> + implements _$$InitialImplCopyWith<$Res> { + __$$InitialImplCopyWithImpl( + _$InitialImpl _value, $Res Function(_$InitialImpl) _then) : super(_value, _then); } /// @nodoc -class _$_Initial implements _Initial { - const _$_Initial(); +class _$InitialImpl implements _Initial { + const _$InitialImpl(); @override String toString() { @@ -114,7 +115,7 @@ class _$_Initial implements _Initial { @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_Initial); + (other.runtimeType == runtimeType && other is _$InitialImpl); } @override @@ -196,28 +197,29 @@ class _$_Initial implements _Initial { } abstract class _Initial implements LandingLoadingState { - const factory _Initial() = _$_Initial; + const factory _Initial() = _$InitialImpl; } /// @nodoc -abstract class _$$_LoadingCopyWith<$Res> { - factory _$$_LoadingCopyWith( - _$_Loading value, $Res Function(_$_Loading) then) = - __$$_LoadingCopyWithImpl<$Res>; +abstract class _$$LoadingImplCopyWith<$Res> { + factory _$$LoadingImplCopyWith( + _$LoadingImpl value, $Res Function(_$LoadingImpl) then) = + __$$LoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_LoadingCopyWithImpl<$Res> - extends _$LandingLoadingStateCopyWithImpl<$Res, _$_Loading> - implements _$$_LoadingCopyWith<$Res> { - __$$_LoadingCopyWithImpl(_$_Loading _value, $Res Function(_$_Loading) _then) +class __$$LoadingImplCopyWithImpl<$Res> + extends _$LandingLoadingStateCopyWithImpl<$Res, _$LoadingImpl> + implements _$$LoadingImplCopyWith<$Res> { + __$$LoadingImplCopyWithImpl( + _$LoadingImpl _value, $Res Function(_$LoadingImpl) _then) : super(_value, _then); } /// @nodoc -class _$_Loading implements _Loading { - const _$_Loading(); +class _$LoadingImpl implements _Loading { + const _$LoadingImpl(); @override String toString() { @@ -227,7 +229,7 @@ class _$_Loading implements _Loading { @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_Loading); + (other.runtimeType == runtimeType && other is _$LoadingImpl); } @override @@ -309,29 +311,29 @@ class _$_Loading implements _Loading { } abstract class _Loading implements LandingLoadingState { - const factory _Loading() = _$_Loading; + const factory _Loading() = _$LoadingImpl; } /// @nodoc -abstract class _$$NavigateToSignInCopyWith<$Res> { - factory _$$NavigateToSignInCopyWith( - _$NavigateToSignIn value, $Res Function(_$NavigateToSignIn) then) = - __$$NavigateToSignInCopyWithImpl<$Res>; +abstract class _$$NavigateToSignInImplCopyWith<$Res> { + factory _$$NavigateToSignInImplCopyWith(_$NavigateToSignInImpl value, + $Res Function(_$NavigateToSignInImpl) then) = + __$$NavigateToSignInImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NavigateToSignInCopyWithImpl<$Res> - extends _$LandingLoadingStateCopyWithImpl<$Res, _$NavigateToSignIn> - implements _$$NavigateToSignInCopyWith<$Res> { - __$$NavigateToSignInCopyWithImpl( - _$NavigateToSignIn _value, $Res Function(_$NavigateToSignIn) _then) +class __$$NavigateToSignInImplCopyWithImpl<$Res> + extends _$LandingLoadingStateCopyWithImpl<$Res, _$NavigateToSignInImpl> + implements _$$NavigateToSignInImplCopyWith<$Res> { + __$$NavigateToSignInImplCopyWithImpl(_$NavigateToSignInImpl _value, + $Res Function(_$NavigateToSignInImpl) _then) : super(_value, _then); } /// @nodoc -class _$NavigateToSignIn implements NavigateToSignIn { - const _$NavigateToSignIn(); +class _$NavigateToSignInImpl implements NavigateToSignIn { + const _$NavigateToSignInImpl(); @override String toString() { @@ -341,7 +343,7 @@ class _$NavigateToSignIn implements NavigateToSignIn { @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$NavigateToSignIn); + (other.runtimeType == runtimeType && other is _$NavigateToSignInImpl); } @override @@ -423,29 +425,29 @@ class _$NavigateToSignIn implements NavigateToSignIn { } abstract class NavigateToSignIn implements LandingLoadingState { - const factory NavigateToSignIn() = _$NavigateToSignIn; + const factory NavigateToSignIn() = _$NavigateToSignInImpl; } /// @nodoc -abstract class _$$NavigateToHomeCopyWith<$Res> { - factory _$$NavigateToHomeCopyWith( - _$NavigateToHome value, $Res Function(_$NavigateToHome) then) = - __$$NavigateToHomeCopyWithImpl<$Res>; +abstract class _$$NavigateToHomeImplCopyWith<$Res> { + factory _$$NavigateToHomeImplCopyWith(_$NavigateToHomeImpl value, + $Res Function(_$NavigateToHomeImpl) then) = + __$$NavigateToHomeImplCopyWithImpl<$Res>; } /// @nodoc -class __$$NavigateToHomeCopyWithImpl<$Res> - extends _$LandingLoadingStateCopyWithImpl<$Res, _$NavigateToHome> - implements _$$NavigateToHomeCopyWith<$Res> { - __$$NavigateToHomeCopyWithImpl( - _$NavigateToHome _value, $Res Function(_$NavigateToHome) _then) +class __$$NavigateToHomeImplCopyWithImpl<$Res> + extends _$LandingLoadingStateCopyWithImpl<$Res, _$NavigateToHomeImpl> + implements _$$NavigateToHomeImplCopyWith<$Res> { + __$$NavigateToHomeImplCopyWithImpl( + _$NavigateToHomeImpl _value, $Res Function(_$NavigateToHomeImpl) _then) : super(_value, _then); } /// @nodoc -class _$NavigateToHome implements NavigateToHome { - const _$NavigateToHome(); +class _$NavigateToHomeImpl implements NavigateToHome { + const _$NavigateToHomeImpl(); @override String toString() { @@ -455,7 +457,7 @@ class _$NavigateToHome implements NavigateToHome { @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$NavigateToHome); + (other.runtimeType == runtimeType && other is _$NavigateToHomeImpl); } @override @@ -537,5 +539,5 @@ class _$NavigateToHome implements NavigateToHome { } abstract class NavigateToHome implements LandingLoadingState { - const factory NavigateToHome() = _$NavigateToHome; + const factory NavigateToHome() = _$NavigateToHomeImpl; } diff --git a/frontend/lib/src/modules/landing_loading/bloc/landing_loading_event.dart b/frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_event.dart similarity index 100% rename from frontend/lib/src/modules/landing_loading/bloc/landing_loading_event.dart rename to frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_event.dart diff --git a/frontend/lib/src/modules/landing_loading/bloc/landing_loading_state.dart b/frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_state.dart similarity index 100% rename from frontend/lib/src/modules/landing_loading/bloc/landing_loading_state.dart rename to frontend/modules/bloc_implementation/lib/src/features/landing_loading/bloc/landing_loading_state.dart diff --git a/frontend/lib/src/modules/landing_loading/view/landing_loading_view.dart b/frontend/modules/bloc_implementation/lib/src/features/landing_loading/view/landing_loading_view.dart similarity index 77% rename from frontend/lib/src/modules/landing_loading/view/landing_loading_view.dart rename to frontend/modules/bloc_implementation/lib/src/features/landing_loading/view/landing_loading_view.dart index 32b8dd3..8730cc4 100644 --- a/frontend/lib/src/modules/landing_loading/view/landing_loading_view.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/landing_loading/view/landing_loading_view.dart @@ -1,9 +1,9 @@ +import 'package:bloc_implementation/src/features/home/view/home_view.dart'; +import 'package:bloc_implementation/src/features/landing_loading/bloc/landing_loading_bloc.dart'; +import 'package:bloc_implementation/src/features/sign_in/view/sign_in_view.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:todo_bloc/src/data/repositories/auth/auth_repository.dart'; -import 'package:todo_bloc/src/modules/home/view/home_view.dart'; -import 'package:todo_bloc/src/modules/landing_loading/bloc/landing_loading_bloc.dart'; -import 'package:todo_bloc/src/modules/sign_in/view/sign_in_view.dart'; +import 'package:repositories/repositories.dart'; class LandingLoadingView extends StatelessWidget { const LandingLoadingView({super.key}); diff --git a/frontend/lib/src/modules/sign_in/cubit/sign_in_cubit.dart b/frontend/modules/bloc_implementation/lib/src/features/sign_in/cubit/sign_in_cubit.dart similarity index 90% rename from frontend/lib/src/modules/sign_in/cubit/sign_in_cubit.dart rename to frontend/modules/bloc_implementation/lib/src/features/sign_in/cubit/sign_in_cubit.dart index b064b89..d2684e0 100644 --- a/frontend/lib/src/modules/sign_in/cubit/sign_in_cubit.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/sign_in/cubit/sign_in_cubit.dart @@ -1,8 +1,8 @@ import 'package:bloc/bloc.dart'; +import 'package:core/core.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:todo_bloc/src/core/enums/enums.dart'; -import 'package:todo_bloc/src/data/repositories/auth/auth_repository.dart'; +import 'package:repositories/repositories.dart'; part 'sign_in_cubit.freezed.dart'; part 'sign_in_state.dart'; diff --git a/frontend/lib/src/modules/sign_in/cubit/sign_in_cubit.freezed.dart b/frontend/modules/bloc_implementation/lib/src/features/sign_in/cubit/sign_in_cubit.freezed.dart similarity index 83% rename from frontend/lib/src/modules/sign_in/cubit/sign_in_cubit.freezed.dart rename to frontend/modules/bloc_implementation/lib/src/features/sign_in/cubit/sign_in_cubit.freezed.dart index 623042d..f97c3eb 100644 --- a/frontend/lib/src/modules/sign_in/cubit/sign_in_cubit.freezed.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/sign_in/cubit/sign_in_cubit.freezed.dart @@ -84,24 +84,25 @@ class _$SignInStateCopyWithImpl<$Res, $Val extends SignInState> } /// @nodoc -abstract class _$$_InitialCopyWith<$Res> { - factory _$$_InitialCopyWith( - _$_Initial value, $Res Function(_$_Initial) then) = - __$$_InitialCopyWithImpl<$Res>; +abstract class _$$InitialImplCopyWith<$Res> { + factory _$$InitialImplCopyWith( + _$InitialImpl value, $Res Function(_$InitialImpl) then) = + __$$InitialImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_InitialCopyWithImpl<$Res> - extends _$SignInStateCopyWithImpl<$Res, _$_Initial> - implements _$$_InitialCopyWith<$Res> { - __$$_InitialCopyWithImpl(_$_Initial _value, $Res Function(_$_Initial) _then) +class __$$InitialImplCopyWithImpl<$Res> + extends _$SignInStateCopyWithImpl<$Res, _$InitialImpl> + implements _$$InitialImplCopyWith<$Res> { + __$$InitialImplCopyWithImpl( + _$InitialImpl _value, $Res Function(_$InitialImpl) _then) : super(_value, _then); } /// @nodoc -class _$_Initial implements _Initial { - const _$_Initial(); +class _$InitialImpl implements _Initial { + const _$InitialImpl(); @override String toString() { @@ -111,7 +112,7 @@ class _$_Initial implements _Initial { @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_Initial); + (other.runtimeType == runtimeType && other is _$InitialImpl); } @override @@ -190,25 +191,26 @@ class _$_Initial implements _Initial { } abstract class _Initial implements SignInState { - const factory _Initial() = _$_Initial; + const factory _Initial() = _$InitialImpl; } /// @nodoc -abstract class _$$SignInStateAuthenticatingCopyWith<$Res> { - factory _$$SignInStateAuthenticatingCopyWith( - _$SignInStateAuthenticating value, - $Res Function(_$SignInStateAuthenticating) then) = - __$$SignInStateAuthenticatingCopyWithImpl<$Res>; +abstract class _$$SignInStateAuthenticatingImplCopyWith<$Res> { + factory _$$SignInStateAuthenticatingImplCopyWith( + _$SignInStateAuthenticatingImpl value, + $Res Function(_$SignInStateAuthenticatingImpl) then) = + __$$SignInStateAuthenticatingImplCopyWithImpl<$Res>; @useResult $Res call({ProcessingState processingState, String message}); } /// @nodoc -class __$$SignInStateAuthenticatingCopyWithImpl<$Res> - extends _$SignInStateCopyWithImpl<$Res, _$SignInStateAuthenticating> - implements _$$SignInStateAuthenticatingCopyWith<$Res> { - __$$SignInStateAuthenticatingCopyWithImpl(_$SignInStateAuthenticating _value, - $Res Function(_$SignInStateAuthenticating) _then) +class __$$SignInStateAuthenticatingImplCopyWithImpl<$Res> + extends _$SignInStateCopyWithImpl<$Res, _$SignInStateAuthenticatingImpl> + implements _$$SignInStateAuthenticatingImplCopyWith<$Res> { + __$$SignInStateAuthenticatingImplCopyWithImpl( + _$SignInStateAuthenticatingImpl _value, + $Res Function(_$SignInStateAuthenticatingImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -217,7 +219,7 @@ class __$$SignInStateAuthenticatingCopyWithImpl<$Res> Object? processingState = null, Object? message = null, }) { - return _then(_$SignInStateAuthenticating( + return _then(_$SignInStateAuthenticatingImpl( processingState: null == processingState ? _value.processingState : processingState // ignore: cast_nullable_to_non_nullable @@ -232,8 +234,8 @@ class __$$SignInStateAuthenticatingCopyWithImpl<$Res> /// @nodoc -class _$SignInStateAuthenticating implements SignInStateAuthenticating { - const _$SignInStateAuthenticating( +class _$SignInStateAuthenticatingImpl implements SignInStateAuthenticating { + const _$SignInStateAuthenticatingImpl( {required this.processingState, required this.message}); @override @@ -250,7 +252,7 @@ class _$SignInStateAuthenticating implements SignInStateAuthenticating { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SignInStateAuthenticating && + other is _$SignInStateAuthenticatingImpl && (identical(other.processingState, processingState) || other.processingState == processingState) && (identical(other.message, message) || other.message == message)); @@ -262,9 +264,9 @@ class _$SignInStateAuthenticating implements SignInStateAuthenticating { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SignInStateAuthenticatingCopyWith<_$SignInStateAuthenticating> - get copyWith => __$$SignInStateAuthenticatingCopyWithImpl< - _$SignInStateAuthenticating>(this, _$identity); + _$$SignInStateAuthenticatingImplCopyWith<_$SignInStateAuthenticatingImpl> + get copyWith => __$$SignInStateAuthenticatingImplCopyWithImpl< + _$SignInStateAuthenticatingImpl>(this, _$identity); @override @optionalTypeArgs @@ -341,35 +343,37 @@ class _$SignInStateAuthenticating implements SignInStateAuthenticating { abstract class SignInStateAuthenticating implements SignInState { const factory SignInStateAuthenticating( {required final ProcessingState processingState, - required final String message}) = _$SignInStateAuthenticating; + required final String message}) = _$SignInStateAuthenticatingImpl; ProcessingState get processingState; String get message; @JsonKey(ignore: true) - _$$SignInStateAuthenticatingCopyWith<_$SignInStateAuthenticating> + _$$SignInStateAuthenticatingImplCopyWith<_$SignInStateAuthenticatingImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$SignInStateAuthenticatedCopyWith<$Res> { - factory _$$SignInStateAuthenticatedCopyWith(_$SignInStateAuthenticated value, - $Res Function(_$SignInStateAuthenticated) then) = - __$$SignInStateAuthenticatedCopyWithImpl<$Res>; +abstract class _$$SignInStateAuthenticatedImplCopyWith<$Res> { + factory _$$SignInStateAuthenticatedImplCopyWith( + _$SignInStateAuthenticatedImpl value, + $Res Function(_$SignInStateAuthenticatedImpl) then) = + __$$SignInStateAuthenticatedImplCopyWithImpl<$Res>; } /// @nodoc -class __$$SignInStateAuthenticatedCopyWithImpl<$Res> - extends _$SignInStateCopyWithImpl<$Res, _$SignInStateAuthenticated> - implements _$$SignInStateAuthenticatedCopyWith<$Res> { - __$$SignInStateAuthenticatedCopyWithImpl(_$SignInStateAuthenticated _value, - $Res Function(_$SignInStateAuthenticated) _then) +class __$$SignInStateAuthenticatedImplCopyWithImpl<$Res> + extends _$SignInStateCopyWithImpl<$Res, _$SignInStateAuthenticatedImpl> + implements _$$SignInStateAuthenticatedImplCopyWith<$Res> { + __$$SignInStateAuthenticatedImplCopyWithImpl( + _$SignInStateAuthenticatedImpl _value, + $Res Function(_$SignInStateAuthenticatedImpl) _then) : super(_value, _then); } /// @nodoc -class _$SignInStateAuthenticated implements SignInStateAuthenticated { - const _$SignInStateAuthenticated(); +class _$SignInStateAuthenticatedImpl implements SignInStateAuthenticated { + const _$SignInStateAuthenticatedImpl(); @override String toString() { @@ -380,7 +384,7 @@ class _$SignInStateAuthenticated implements SignInStateAuthenticated { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SignInStateAuthenticated); + other is _$SignInStateAuthenticatedImpl); } @override @@ -459,5 +463,5 @@ class _$SignInStateAuthenticated implements SignInStateAuthenticated { } abstract class SignInStateAuthenticated implements SignInState { - const factory SignInStateAuthenticated() = _$SignInStateAuthenticated; + const factory SignInStateAuthenticated() = _$SignInStateAuthenticatedImpl; } diff --git a/frontend/lib/src/modules/sign_in/cubit/sign_in_state.dart b/frontend/modules/bloc_implementation/lib/src/features/sign_in/cubit/sign_in_state.dart similarity index 100% rename from frontend/lib/src/modules/sign_in/cubit/sign_in_state.dart rename to frontend/modules/bloc_implementation/lib/src/features/sign_in/cubit/sign_in_state.dart diff --git a/frontend/lib/src/modules/sign_in/view/sign_in_view.dart b/frontend/modules/bloc_implementation/lib/src/features/sign_in/view/sign_in_view.dart similarity index 90% rename from frontend/lib/src/modules/sign_in/view/sign_in_view.dart rename to frontend/modules/bloc_implementation/lib/src/features/sign_in/view/sign_in_view.dart index 9cd3e69..985d26e 100644 --- a/frontend/lib/src/modules/sign_in/view/sign_in_view.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/sign_in/view/sign_in_view.dart @@ -1,9 +1,9 @@ +import 'package:bloc_implementation/src/features/home/view/home_view.dart'; +import 'package:bloc_implementation/src/features/sign_in/cubit/sign_in_cubit.dart'; +import 'package:core/core.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:todo_bloc/src/core/enums/enums.dart'; -import 'package:todo_bloc/src/data/repositories/auth/auth_repository.dart'; -import 'package:todo_bloc/src/modules/home/view/home_view.dart'; -import 'package:todo_bloc/src/modules/sign_in/cubit/sign_in_cubit.dart'; +import 'package:repositories/repositories.dart'; class SignInView extends StatelessWidget { const SignInView({super.key}); diff --git a/frontend/lib/src/modules/todo_sync/cubit/todo_sync_cubit.dart b/frontend/modules/bloc_implementation/lib/src/features/todo_sync/cubit/todo_sync_cubit.dart similarity index 95% rename from frontend/lib/src/modules/todo_sync/cubit/todo_sync_cubit.dart rename to frontend/modules/bloc_implementation/lib/src/features/todo_sync/cubit/todo_sync_cubit.dart index 64854a0..f5aabd7 100644 --- a/frontend/lib/src/modules/todo_sync/cubit/todo_sync_cubit.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/todo_sync/cubit/todo_sync_cubit.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'dart:developer' as developer; import 'package:bloc/bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:todo_bloc/src/data/repositories/todo_sync/todo_sync_repository.dart'; +import 'package:repositories/repositories.dart'; part 'todo_sync_cubit.freezed.dart'; diff --git a/frontend/lib/src/modules/todo_sync/cubit/todo_sync_cubit.freezed.dart b/frontend/modules/bloc_implementation/lib/src/features/todo_sync/cubit/todo_sync_cubit.freezed.dart similarity index 79% rename from frontend/lib/src/modules/todo_sync/cubit/todo_sync_cubit.freezed.dart rename to frontend/modules/bloc_implementation/lib/src/features/todo_sync/cubit/todo_sync_cubit.freezed.dart index 6b77f9e..a7616ef 100644 --- a/frontend/lib/src/modules/todo_sync/cubit/todo_sync_cubit.freezed.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/todo_sync/cubit/todo_sync_cubit.freezed.dart @@ -81,25 +81,25 @@ class _$TodoSyncStateCopyWithImpl<$Res, $Val extends TodoSyncState> } /// @nodoc -abstract class _$$_TodoSyncStateInitialCopyWith<$Res> { - factory _$$_TodoSyncStateInitialCopyWith(_$_TodoSyncStateInitial value, - $Res Function(_$_TodoSyncStateInitial) then) = - __$$_TodoSyncStateInitialCopyWithImpl<$Res>; +abstract class _$$TodoSyncStateInitialImplCopyWith<$Res> { + factory _$$TodoSyncStateInitialImplCopyWith(_$TodoSyncStateInitialImpl value, + $Res Function(_$TodoSyncStateInitialImpl) then) = + __$$TodoSyncStateInitialImplCopyWithImpl<$Res>; } /// @nodoc -class __$$_TodoSyncStateInitialCopyWithImpl<$Res> - extends _$TodoSyncStateCopyWithImpl<$Res, _$_TodoSyncStateInitial> - implements _$$_TodoSyncStateInitialCopyWith<$Res> { - __$$_TodoSyncStateInitialCopyWithImpl(_$_TodoSyncStateInitial _value, - $Res Function(_$_TodoSyncStateInitial) _then) +class __$$TodoSyncStateInitialImplCopyWithImpl<$Res> + extends _$TodoSyncStateCopyWithImpl<$Res, _$TodoSyncStateInitialImpl> + implements _$$TodoSyncStateInitialImplCopyWith<$Res> { + __$$TodoSyncStateInitialImplCopyWithImpl(_$TodoSyncStateInitialImpl _value, + $Res Function(_$TodoSyncStateInitialImpl) _then) : super(_value, _then); } /// @nodoc -class _$_TodoSyncStateInitial implements _TodoSyncStateInitial { - const _$_TodoSyncStateInitial(); +class _$TodoSyncStateInitialImpl implements _TodoSyncStateInitial { + const _$TodoSyncStateInitialImpl(); @override String toString() { @@ -109,7 +109,8 @@ class _$_TodoSyncStateInitial implements _TodoSyncStateInitial { @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$_TodoSyncStateInitial); + (other.runtimeType == runtimeType && + other is _$TodoSyncStateInitialImpl); } @override @@ -185,29 +186,29 @@ class _$_TodoSyncStateInitial implements _TodoSyncStateInitial { } abstract class _TodoSyncStateInitial implements TodoSyncState { - const factory _TodoSyncStateInitial() = _$_TodoSyncStateInitial; + const factory _TodoSyncStateInitial() = _$TodoSyncStateInitialImpl; } /// @nodoc -abstract class _$$TodoSyncStateLoadingCopyWith<$Res> { - factory _$$TodoSyncStateLoadingCopyWith(_$TodoSyncStateLoading value, - $Res Function(_$TodoSyncStateLoading) then) = - __$$TodoSyncStateLoadingCopyWithImpl<$Res>; +abstract class _$$TodoSyncStateLoadingImplCopyWith<$Res> { + factory _$$TodoSyncStateLoadingImplCopyWith(_$TodoSyncStateLoadingImpl value, + $Res Function(_$TodoSyncStateLoadingImpl) then) = + __$$TodoSyncStateLoadingImplCopyWithImpl<$Res>; } /// @nodoc -class __$$TodoSyncStateLoadingCopyWithImpl<$Res> - extends _$TodoSyncStateCopyWithImpl<$Res, _$TodoSyncStateLoading> - implements _$$TodoSyncStateLoadingCopyWith<$Res> { - __$$TodoSyncStateLoadingCopyWithImpl(_$TodoSyncStateLoading _value, - $Res Function(_$TodoSyncStateLoading) _then) +class __$$TodoSyncStateLoadingImplCopyWithImpl<$Res> + extends _$TodoSyncStateCopyWithImpl<$Res, _$TodoSyncStateLoadingImpl> + implements _$$TodoSyncStateLoadingImplCopyWith<$Res> { + __$$TodoSyncStateLoadingImplCopyWithImpl(_$TodoSyncStateLoadingImpl _value, + $Res Function(_$TodoSyncStateLoadingImpl) _then) : super(_value, _then); } /// @nodoc -class _$TodoSyncStateLoading implements TodoSyncStateLoading { - const _$TodoSyncStateLoading(); +class _$TodoSyncStateLoadingImpl implements TodoSyncStateLoading { + const _$TodoSyncStateLoadingImpl(); @override String toString() { @@ -217,7 +218,8 @@ class _$TodoSyncStateLoading implements TodoSyncStateLoading { @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$TodoSyncStateLoading); + (other.runtimeType == runtimeType && + other is _$TodoSyncStateLoadingImpl); } @override @@ -293,24 +295,24 @@ class _$TodoSyncStateLoading implements TodoSyncStateLoading { } abstract class TodoSyncStateLoading implements TodoSyncState { - const factory TodoSyncStateLoading() = _$TodoSyncStateLoading; + const factory TodoSyncStateLoading() = _$TodoSyncStateLoadingImpl; } /// @nodoc -abstract class _$$TodoSyncStateSyncingCopyWith<$Res> { - factory _$$TodoSyncStateSyncingCopyWith(_$TodoSyncStateSyncing value, - $Res Function(_$TodoSyncStateSyncing) then) = - __$$TodoSyncStateSyncingCopyWithImpl<$Res>; +abstract class _$$TodoSyncStateSyncingImplCopyWith<$Res> { + factory _$$TodoSyncStateSyncingImplCopyWith(_$TodoSyncStateSyncingImpl value, + $Res Function(_$TodoSyncStateSyncingImpl) then) = + __$$TodoSyncStateSyncingImplCopyWithImpl<$Res>; @useResult $Res call({bool active}); } /// @nodoc -class __$$TodoSyncStateSyncingCopyWithImpl<$Res> - extends _$TodoSyncStateCopyWithImpl<$Res, _$TodoSyncStateSyncing> - implements _$$TodoSyncStateSyncingCopyWith<$Res> { - __$$TodoSyncStateSyncingCopyWithImpl(_$TodoSyncStateSyncing _value, - $Res Function(_$TodoSyncStateSyncing) _then) +class __$$TodoSyncStateSyncingImplCopyWithImpl<$Res> + extends _$TodoSyncStateCopyWithImpl<$Res, _$TodoSyncStateSyncingImpl> + implements _$$TodoSyncStateSyncingImplCopyWith<$Res> { + __$$TodoSyncStateSyncingImplCopyWithImpl(_$TodoSyncStateSyncingImpl _value, + $Res Function(_$TodoSyncStateSyncingImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -318,7 +320,7 @@ class __$$TodoSyncStateSyncingCopyWithImpl<$Res> $Res call({ Object? active = null, }) { - return _then(_$TodoSyncStateSyncing( + return _then(_$TodoSyncStateSyncingImpl( active: null == active ? _value.active : active // ignore: cast_nullable_to_non_nullable @@ -329,8 +331,8 @@ class __$$TodoSyncStateSyncingCopyWithImpl<$Res> /// @nodoc -class _$TodoSyncStateSyncing implements TodoSyncStateSyncing { - const _$TodoSyncStateSyncing({required this.active}); +class _$TodoSyncStateSyncingImpl implements TodoSyncStateSyncing { + const _$TodoSyncStateSyncingImpl({required this.active}); @override final bool active; @@ -344,7 +346,7 @@ class _$TodoSyncStateSyncing implements TodoSyncStateSyncing { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$TodoSyncStateSyncing && + other is _$TodoSyncStateSyncingImpl && (identical(other.active, active) || other.active == active)); } @@ -354,9 +356,10 @@ class _$TodoSyncStateSyncing implements TodoSyncStateSyncing { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$TodoSyncStateSyncingCopyWith<_$TodoSyncStateSyncing> get copyWith => - __$$TodoSyncStateSyncingCopyWithImpl<_$TodoSyncStateSyncing>( - this, _$identity); + _$$TodoSyncStateSyncingImplCopyWith<_$TodoSyncStateSyncingImpl> + get copyWith => + __$$TodoSyncStateSyncingImplCopyWithImpl<_$TodoSyncStateSyncingImpl>( + this, _$identity); @override @optionalTypeArgs @@ -429,10 +432,10 @@ class _$TodoSyncStateSyncing implements TodoSyncStateSyncing { abstract class TodoSyncStateSyncing implements TodoSyncState { const factory TodoSyncStateSyncing({required final bool active}) = - _$TodoSyncStateSyncing; + _$TodoSyncStateSyncingImpl; bool get active; @JsonKey(ignore: true) - _$$TodoSyncStateSyncingCopyWith<_$TodoSyncStateSyncing> get copyWith => - throw _privateConstructorUsedError; + _$$TodoSyncStateSyncingImplCopyWith<_$TodoSyncStateSyncingImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/frontend/lib/src/modules/todo_sync/cubit/todo_sync_state.dart b/frontend/modules/bloc_implementation/lib/src/features/todo_sync/cubit/todo_sync_state.dart similarity index 100% rename from frontend/lib/src/modules/todo_sync/cubit/todo_sync_state.dart rename to frontend/modules/bloc_implementation/lib/src/features/todo_sync/cubit/todo_sync_state.dart diff --git a/frontend/lib/src/modules/view_todo/bloc/view_todo_bloc.dart b/frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_bloc.dart similarity index 87% rename from frontend/lib/src/modules/view_todo/bloc/view_todo_bloc.dart rename to frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_bloc.dart index be771d3..3bfc532 100644 --- a/frontend/lib/src/modules/view_todo/bloc/view_todo_bloc.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_bloc.dart @@ -1,14 +1,11 @@ import 'dart:developer' as developer; +import 'package:apis/apis.dart'; import 'package:bloc/bloc.dart'; +import 'package:core/core.dart'; import 'package:equatable/equatable.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:todo_bloc/src/core/enums/enums.dart'; -import 'package:todo_bloc/src/core/enums/todo_operation_type.dart'; -import 'package:todo_bloc/src/data/models/domains/todo.dart'; -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; -import 'package:todo_bloc/src/data/repositories/todo/todo_repository.dart'; -import 'package:todo_bloc/src/data/repositories/todo_sync/todo_sync_repository.dart'; +import 'package:repositories/repositories.dart'; part 'view_todo_bloc.freezed.dart'; part 'view_todo_event.dart'; diff --git a/frontend/lib/src/modules/view_todo/bloc/view_todo_bloc.freezed.dart b/frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_bloc.freezed.dart similarity index 83% rename from frontend/lib/src/modules/view_todo/bloc/view_todo_bloc.freezed.dart rename to frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_bloc.freezed.dart index 39c4400..8212692 100644 --- a/frontend/lib/src/modules/view_todo/bloc/view_todo_bloc.freezed.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_bloc.freezed.dart @@ -116,11 +116,11 @@ class _$ViewTodoStateCopyWithImpl<$Res, $Val extends ViewTodoState> } /// @nodoc -abstract class _$$_ViewTodoStateCopyWith<$Res> +abstract class _$$ViewTodoStateImplCopyWith<$Res> implements $ViewTodoStateCopyWith<$Res> { - factory _$$_ViewTodoStateCopyWith( - _$_ViewTodoState value, $Res Function(_$_ViewTodoState) then) = - __$$_ViewTodoStateCopyWithImpl<$Res>; + factory _$$ViewTodoStateImplCopyWith( + _$ViewTodoStateImpl value, $Res Function(_$ViewTodoStateImpl) then) = + __$$ViewTodoStateImplCopyWithImpl<$Res>; @override @useResult $Res call({Todo? todo}); @@ -130,11 +130,11 @@ abstract class _$$_ViewTodoStateCopyWith<$Res> } /// @nodoc -class __$$_ViewTodoStateCopyWithImpl<$Res> - extends _$ViewTodoStateCopyWithImpl<$Res, _$_ViewTodoState> - implements _$$_ViewTodoStateCopyWith<$Res> { - __$$_ViewTodoStateCopyWithImpl( - _$_ViewTodoState _value, $Res Function(_$_ViewTodoState) _then) +class __$$ViewTodoStateImplCopyWithImpl<$Res> + extends _$ViewTodoStateCopyWithImpl<$Res, _$ViewTodoStateImpl> + implements _$$ViewTodoStateImplCopyWith<$Res> { + __$$ViewTodoStateImplCopyWithImpl( + _$ViewTodoStateImpl _value, $Res Function(_$ViewTodoStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -142,7 +142,7 @@ class __$$_ViewTodoStateCopyWithImpl<$Res> $Res call({ Object? todo = freezed, }) { - return _then(_$_ViewTodoState( + return _then(_$ViewTodoStateImpl( todo: freezed == todo ? _value.todo : todo // ignore: cast_nullable_to_non_nullable @@ -153,8 +153,8 @@ class __$$_ViewTodoStateCopyWithImpl<$Res> /// @nodoc -class _$_ViewTodoState implements _ViewTodoState { - const _$_ViewTodoState({this.todo}); +class _$ViewTodoStateImpl implements _ViewTodoState { + const _$ViewTodoStateImpl({this.todo}); @override final Todo? todo; @@ -168,7 +168,7 @@ class _$_ViewTodoState implements _ViewTodoState { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_ViewTodoState && + other is _$ViewTodoStateImpl && (identical(other.todo, todo) || other.todo == todo)); } @@ -178,8 +178,8 @@ class _$_ViewTodoState implements _ViewTodoState { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ViewTodoStateCopyWith<_$_ViewTodoState> get copyWith => - __$$_ViewTodoStateCopyWithImpl<_$_ViewTodoState>(this, _$identity); + _$$ViewTodoStateImplCopyWith<_$ViewTodoStateImpl> get copyWith => + __$$ViewTodoStateImplCopyWithImpl<_$ViewTodoStateImpl>(this, _$identity); @override @optionalTypeArgs @@ -252,21 +252,22 @@ class _$_ViewTodoState implements _ViewTodoState { } abstract class _ViewTodoState implements ViewTodoState { - const factory _ViewTodoState({final Todo? todo}) = _$_ViewTodoState; + const factory _ViewTodoState({final Todo? todo}) = _$ViewTodoStateImpl; @override Todo? get todo; @override @JsonKey(ignore: true) - _$$_ViewTodoStateCopyWith<_$_ViewTodoState> get copyWith => + _$$ViewTodoStateImplCopyWith<_$ViewTodoStateImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LoadingCopyWith<$Res> +abstract class _$$LoadingImplCopyWith<$Res> implements $ViewTodoStateCopyWith<$Res> { - factory _$$LoadingCopyWith(_$Loading value, $Res Function(_$Loading) then) = - __$$LoadingCopyWithImpl<$Res>; + factory _$$LoadingImplCopyWith( + _$LoadingImpl value, $Res Function(_$LoadingImpl) then) = + __$$LoadingImplCopyWithImpl<$Res>; @override @useResult $Res call({Todo? todo}); @@ -276,10 +277,11 @@ abstract class _$$LoadingCopyWith<$Res> } /// @nodoc -class __$$LoadingCopyWithImpl<$Res> - extends _$ViewTodoStateCopyWithImpl<$Res, _$Loading> - implements _$$LoadingCopyWith<$Res> { - __$$LoadingCopyWithImpl(_$Loading _value, $Res Function(_$Loading) _then) +class __$$LoadingImplCopyWithImpl<$Res> + extends _$ViewTodoStateCopyWithImpl<$Res, _$LoadingImpl> + implements _$$LoadingImplCopyWith<$Res> { + __$$LoadingImplCopyWithImpl( + _$LoadingImpl _value, $Res Function(_$LoadingImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -287,7 +289,7 @@ class __$$LoadingCopyWithImpl<$Res> $Res call({ Object? todo = freezed, }) { - return _then(_$Loading( + return _then(_$LoadingImpl( todo: freezed == todo ? _value.todo : todo // ignore: cast_nullable_to_non_nullable @@ -298,8 +300,8 @@ class __$$LoadingCopyWithImpl<$Res> /// @nodoc -class _$Loading implements Loading { - const _$Loading({this.todo}); +class _$LoadingImpl implements Loading { + const _$LoadingImpl({this.todo}); @override final Todo? todo; @@ -313,7 +315,7 @@ class _$Loading implements Loading { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$Loading && + other is _$LoadingImpl && (identical(other.todo, todo) || other.todo == todo)); } @@ -323,8 +325,8 @@ class _$Loading implements Loading { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LoadingCopyWith<_$Loading> get copyWith => - __$$LoadingCopyWithImpl<_$Loading>(this, _$identity); + _$$LoadingImplCopyWith<_$LoadingImpl> get copyWith => + __$$LoadingImplCopyWithImpl<_$LoadingImpl>(this, _$identity); @override @optionalTypeArgs @@ -397,22 +399,22 @@ class _$Loading implements Loading { } abstract class Loading implements ViewTodoState { - const factory Loading({final Todo? todo}) = _$Loading; + const factory Loading({final Todo? todo}) = _$LoadingImpl; @override Todo? get todo; @override @JsonKey(ignore: true) - _$$LoadingCopyWith<_$Loading> get copyWith => + _$$LoadingImplCopyWith<_$LoadingImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$SavingTodoCopyWith<$Res> +abstract class _$$SavingTodoImplCopyWith<$Res> implements $ViewTodoStateCopyWith<$Res> { - factory _$$SavingTodoCopyWith( - _$SavingTodo value, $Res Function(_$SavingTodo) then) = - __$$SavingTodoCopyWithImpl<$Res>; + factory _$$SavingTodoImplCopyWith( + _$SavingTodoImpl value, $Res Function(_$SavingTodoImpl) then) = + __$$SavingTodoImplCopyWithImpl<$Res>; @override @useResult $Res call({ProcessingState processingState, Todo? todo}); @@ -422,11 +424,11 @@ abstract class _$$SavingTodoCopyWith<$Res> } /// @nodoc -class __$$SavingTodoCopyWithImpl<$Res> - extends _$ViewTodoStateCopyWithImpl<$Res, _$SavingTodo> - implements _$$SavingTodoCopyWith<$Res> { - __$$SavingTodoCopyWithImpl( - _$SavingTodo _value, $Res Function(_$SavingTodo) _then) +class __$$SavingTodoImplCopyWithImpl<$Res> + extends _$ViewTodoStateCopyWithImpl<$Res, _$SavingTodoImpl> + implements _$$SavingTodoImplCopyWith<$Res> { + __$$SavingTodoImplCopyWithImpl( + _$SavingTodoImpl _value, $Res Function(_$SavingTodoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -435,7 +437,7 @@ class __$$SavingTodoCopyWithImpl<$Res> Object? processingState = null, Object? todo = freezed, }) { - return _then(_$SavingTodo( + return _then(_$SavingTodoImpl( processingState: null == processingState ? _value.processingState : processingState // ignore: cast_nullable_to_non_nullable @@ -450,8 +452,8 @@ class __$$SavingTodoCopyWithImpl<$Res> /// @nodoc -class _$SavingTodo implements SavingTodo { - const _$SavingTodo({required this.processingState, this.todo}); +class _$SavingTodoImpl implements SavingTodo { + const _$SavingTodoImpl({required this.processingState, this.todo}); @override final ProcessingState processingState; @@ -467,7 +469,7 @@ class _$SavingTodo implements SavingTodo { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SavingTodo && + other is _$SavingTodoImpl && (identical(other.processingState, processingState) || other.processingState == processingState) && (identical(other.todo, todo) || other.todo == todo)); @@ -479,8 +481,8 @@ class _$SavingTodo implements SavingTodo { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SavingTodoCopyWith<_$SavingTodo> get copyWith => - __$$SavingTodoCopyWithImpl<_$SavingTodo>(this, _$identity); + _$$SavingTodoImplCopyWith<_$SavingTodoImpl> get copyWith => + __$$SavingTodoImplCopyWithImpl<_$SavingTodoImpl>(this, _$identity); @override @optionalTypeArgs @@ -555,13 +557,13 @@ class _$SavingTodo implements SavingTodo { abstract class SavingTodo implements ViewTodoState { const factory SavingTodo( {required final ProcessingState processingState, - final Todo? todo}) = _$SavingTodo; + final Todo? todo}) = _$SavingTodoImpl; ProcessingState get processingState; @override Todo? get todo; @override @JsonKey(ignore: true) - _$$SavingTodoCopyWith<_$SavingTodo> get copyWith => + _$$SavingTodoImplCopyWith<_$SavingTodoImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/frontend/lib/src/modules/view_todo/bloc/view_todo_event.dart b/frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_event.dart similarity index 100% rename from frontend/lib/src/modules/view_todo/bloc/view_todo_event.dart rename to frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_event.dart diff --git a/frontend/lib/src/modules/view_todo/bloc/view_todo_state.dart b/frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_state.dart similarity index 100% rename from frontend/lib/src/modules/view_todo/bloc/view_todo_state.dart rename to frontend/modules/bloc_implementation/lib/src/features/view_todo/bloc/view_todo_state.dart diff --git a/frontend/lib/src/modules/view_todo/view/view_todo_view.dart b/frontend/modules/bloc_implementation/lib/src/features/view_todo/view/view_todo_view.dart similarity index 93% rename from frontend/lib/src/modules/view_todo/view/view_todo_view.dart rename to frontend/modules/bloc_implementation/lib/src/features/view_todo/view/view_todo_view.dart index e0e5a93..f9b4b54 100644 --- a/frontend/lib/src/modules/view_todo/view/view_todo_view.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/view_todo/view/view_todo_view.dart @@ -1,13 +1,10 @@ -import 'package:flex_color_scheme/flex_color_scheme.dart'; +import 'package:apis/apis.dart'; +import 'package:bloc_implementation/src/features/view_todo/bloc/view_todo_bloc.dart'; +import 'package:bloc_implementation/src/features/view_todo/view/widgets/extras_button.dart'; +import 'package:core/core.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:todo_bloc/src/core/enums/enums.dart'; -import 'package:todo_bloc/src/core/enums/todo_operation_type.dart'; -import 'package:todo_bloc/src/data/models/domains/todo.dart'; -import 'package:todo_bloc/src/data/repositories/todo/todo_repository.dart'; -import 'package:todo_bloc/src/data/repositories/todo_sync/todo_sync_repository.dart'; -import 'package:todo_bloc/src/modules/view_todo/bloc/view_todo_bloc.dart'; -import 'package:todo_bloc/src/modules/view_todo/view/widgets/extras_button.dart'; +import 'package:repositories/repositories.dart'; class ViewTodoView extends StatefulWidget { const ViewTodoView({ diff --git a/frontend/lib/src/modules/view_todo/view/widgets/extras_button.dart b/frontend/modules/bloc_implementation/lib/src/features/view_todo/view/widgets/extras_button.dart similarity index 94% rename from frontend/lib/src/modules/view_todo/view/widgets/extras_button.dart rename to frontend/modules/bloc_implementation/lib/src/features/view_todo/view/widgets/extras_button.dart index a154220..4dacb36 100644 --- a/frontend/lib/src/modules/view_todo/view/widgets/extras_button.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/view_todo/view/widgets/extras_button.dart @@ -1,7 +1,7 @@ +import 'package:bloc_implementation/src/features/view_todo/bloc/view_todo_bloc.dart'; +import 'package:bloc_implementation/src/features/view_todo/view/widgets/extras_menu.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:todo_bloc/src/modules/view_todo/bloc/view_todo_bloc.dart'; -import 'package:todo_bloc/src/modules/view_todo/view/widgets/extras_menu.dart'; class ExtrasButton extends StatefulWidget { const ExtrasButton({ diff --git a/frontend/lib/src/modules/view_todo/view/widgets/extras_menu.dart b/frontend/modules/bloc_implementation/lib/src/features/view_todo/view/widgets/extras_menu.dart similarity index 96% rename from frontend/lib/src/modules/view_todo/view/widgets/extras_menu.dart rename to frontend/modules/bloc_implementation/lib/src/features/view_todo/view/widgets/extras_menu.dart index 36f8b89..6bc185b 100644 --- a/frontend/lib/src/modules/view_todo/view/widgets/extras_menu.dart +++ b/frontend/modules/bloc_implementation/lib/src/features/view_todo/view/widgets/extras_menu.dart @@ -1,11 +1,11 @@ import 'dart:math'; +import 'package:apis/apis.dart'; +import 'package:bloc_implementation/src/features/view_todo/bloc/view_todo_bloc.dart'; +import 'package:core/core.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:todo_bloc/src/core/enums/enums.dart'; -import 'package:todo_bloc/src/data/models/domains/todo.dart'; -import 'package:todo_bloc/src/modules/view_todo/bloc/view_todo_bloc.dart'; class ExtrasMenu extends StatefulWidget { const ExtrasMenu({ diff --git a/frontend/modules/bloc_implementation/pubspec.yaml b/frontend/modules/bloc_implementation/pubspec.yaml new file mode 100644 index 0000000..c3919d7 --- /dev/null +++ b/frontend/modules/bloc_implementation/pubspec.yaml @@ -0,0 +1,49 @@ +name: bloc_implementation +description: The bloc implementation of the Toda App +version: 1.0.0+1 +publish_to: none + +environment: + sdk: ">=3.0.0 <4.0.0" + +dependencies: + apis: + path: ../common/apis + bloc: ^8.1.2 + cloud_firestore: ^4.8.4 + collection: ^1.17.1 + core: + path: ../common/core + device_info_plus: ^9.0.3 + equatable: ^2.0.5 + firebase_auth: ^4.7.2 + flutter: + sdk: flutter + flutter_bloc: ^8.1.3 + flutter_localizations: + sdk: flutter + freezed: ^2.4.1 + freezed_annotation: ^2.4.1 + google_sign_in: ^6.1.4 + hydrated_bloc: ^9.1.2 + internet_connection_checker_plus: ^2.0.0 + intl: ^0.18.0 + json_annotation: ^4.8.1 + moment_dart: ^1.0.1 + realm: ^1.3.0 + repositories: + path: ../common/repositories + +dev_dependencies: + bloc_test: ^9.1.2 + build_runner: ^2.3.3 + fake_cloud_firestore: ^2.4.1+1 + flutter_test: + sdk: flutter + json_serializable: ^6.7.1 + mocktail: ^1.0.0 + very_good_analysis: ^5.0.0 + +flutter: + uses-material-design: true + generate: true \ No newline at end of file diff --git a/frontend/modules/common/apis/analysis_options.yaml b/frontend/modules/common/apis/analysis_options.yaml new file mode 100644 index 0000000..fa798a8 --- /dev/null +++ b/frontend/modules/common/apis/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:very_good_analysis/analysis_options.5.1.0.yaml +linter: + rules: + public_member_api_docs: false diff --git a/frontend/modules/common/apis/lib/apis.dart b/frontend/modules/common/apis/lib/apis.dart new file mode 100644 index 0000000..66bdbff --- /dev/null +++ b/frontend/modules/common/apis/lib/apis.dart @@ -0,0 +1,3 @@ +//GENERATED BARREL FILE +export 'src/apis/apis.dart'; +export 'src/models/models.dart'; diff --git a/frontend/modules/common/apis/lib/src/apis/apis.dart b/frontend/modules/common/apis/lib/src/apis/apis.dart new file mode 100644 index 0000000..aa02ea3 --- /dev/null +++ b/frontend/modules/common/apis/lib/src/apis/apis.dart @@ -0,0 +1,10 @@ +//GENERATED BARREL FILE +export './local_storage/local_storage.dart'; +export './local_storage/local_storage_impl.dart'; +export './queue/local_queue_api.dart'; +export './queue/queue_api.dart'; +export './queue/remote_queue_api.dart'; +export './todo/local_todo_api.dart'; +export './todo/remote_todo_api.dart'; +export './todo/todo_api.dart'; +export './user/user_api.dart'; diff --git a/frontend/lib/src/data/local_storage/local_storage.dart b/frontend/modules/common/apis/lib/src/apis/local_storage/local_storage.dart similarity index 100% rename from frontend/lib/src/data/local_storage/local_storage.dart rename to frontend/modules/common/apis/lib/src/apis/local_storage/local_storage.dart diff --git a/frontend/lib/src/data/local_storage/local_storage_impl.dart b/frontend/modules/common/apis/lib/src/apis/local_storage/local_storage_impl.dart similarity index 97% rename from frontend/lib/src/data/local_storage/local_storage_impl.dart rename to frontend/modules/common/apis/lib/src/apis/local_storage/local_storage_impl.dart index 0dd068f..974ef34 100644 --- a/frontend/lib/src/data/local_storage/local_storage_impl.dart +++ b/frontend/modules/common/apis/lib/src/apis/local_storage/local_storage_impl.dart @@ -1,6 +1,7 @@ import 'dart:developer' as developer; + +import 'package:apis/src/apis/local_storage/local_storage.dart'; import 'package:realm/realm.dart'; -import 'package:todo_bloc/src/data/local_storage/local_storage.dart'; class LocalStorageImpl implements LocalStorage { LocalStorageImpl({ diff --git a/frontend/lib/src/data/api/queue/local_queue_api.dart b/frontend/modules/common/apis/lib/src/apis/queue/local_queue_api.dart similarity index 90% rename from frontend/lib/src/data/api/queue/local_queue_api.dart rename to frontend/modules/common/apis/lib/src/apis/queue/local_queue_api.dart index 5148c19..98b4994 100644 --- a/frontend/lib/src/data/api/queue/local_queue_api.dart +++ b/frontend/modules/common/apis/lib/src/apis/queue/local_queue_api.dart @@ -1,9 +1,10 @@ import 'dart:developer' as developer; + +import 'package:apis/src/apis/local_storage/local_storage.dart'; +import 'package:apis/src/apis/queue/queue_api.dart'; +import 'package:apis/src/models/queue/dto/queue_dto.dart'; import 'package:collection/collection.dart'; import 'package:realm/realm.dart'; -import 'package:todo_bloc/src/data/api/queue/queue_api.dart'; -import 'package:todo_bloc/src/data/local_storage/local_storage.dart'; -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; class LocalQueueApi extends QueueApi { LocalQueueApi({ diff --git a/frontend/lib/src/data/api/queue/queue_api.dart b/frontend/modules/common/apis/lib/src/apis/queue/queue_api.dart similarity index 81% rename from frontend/lib/src/data/api/queue/queue_api.dart rename to frontend/modules/common/apis/lib/src/apis/queue/queue_api.dart index b52ae86..05c94d8 100644 --- a/frontend/lib/src/data/api/queue/queue_api.dart +++ b/frontend/modules/common/apis/lib/src/apis/queue/queue_api.dart @@ -1,4 +1,4 @@ -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; +import 'package:apis/src/models/queue/dto/queue_dto.dart'; abstract class QueueApi { Future getQueue(String id); diff --git a/frontend/lib/src/data/api/queue/remote_queue_api.dart b/frontend/modules/common/apis/lib/src/apis/queue/remote_queue_api.dart similarity index 94% rename from frontend/lib/src/data/api/queue/remote_queue_api.dart rename to frontend/modules/common/apis/lib/src/apis/queue/remote_queue_api.dart index 918bd1d..7144275 100644 --- a/frontend/lib/src/data/api/queue/remote_queue_api.dart +++ b/frontend/modules/common/apis/lib/src/apis/queue/remote_queue_api.dart @@ -1,6 +1,6 @@ +import 'package:apis/src/apis/queue/queue_api.dart'; +import 'package:apis/src/models/queue/dto/queue_dto.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:todo_bloc/src/data/api/queue/queue_api.dart'; -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; class RemoteQueueApi extends QueueApi { RemoteQueueApi({ diff --git a/frontend/lib/src/data/api/todo/local_todo_api.dart b/frontend/modules/common/apis/lib/src/apis/todo/local_todo_api.dart similarity index 87% rename from frontend/lib/src/data/api/todo/local_todo_api.dart rename to frontend/modules/common/apis/lib/src/apis/todo/local_todo_api.dart index 7e18606..3b77dea 100644 --- a/frontend/lib/src/data/api/todo/local_todo_api.dart +++ b/frontend/modules/common/apis/lib/src/apis/todo/local_todo_api.dart @@ -1,9 +1,10 @@ import 'dart:async'; import 'dart:developer' as developer; + +import 'package:apis/src/apis/local_storage/local_storage.dart'; +import 'package:apis/src/apis/todo/todo_api.dart'; +import 'package:apis/src/models/todo/dto/todo_dto.dart'; import 'package:realm/realm.dart'; -import 'package:todo_bloc/src/data/api/todo/todo_api.dart'; -import 'package:todo_bloc/src/data/local_storage/local_storage.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; class LocalTodoApi extends TodoApi { LocalTodoApi({ diff --git a/frontend/lib/src/data/api/todo/remote_todo_api.dart b/frontend/modules/common/apis/lib/src/apis/todo/remote_todo_api.dart similarity index 95% rename from frontend/lib/src/data/api/todo/remote_todo_api.dart rename to frontend/modules/common/apis/lib/src/apis/todo/remote_todo_api.dart index 7347e0e..e8a8b92 100644 --- a/frontend/lib/src/data/api/todo/remote_todo_api.dart +++ b/frontend/modules/common/apis/lib/src/apis/todo/remote_todo_api.dart @@ -1,7 +1,7 @@ +import 'package:apis/src/apis/todo/todo_api.dart'; +import 'package:apis/src/models/todo/dto/todo_dto.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:collection/collection.dart'; -import 'package:todo_bloc/src/data/api/todo/todo_api.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; class RemoteTodoApi extends TodoApi { RemoteTodoApi({ diff --git a/frontend/lib/src/data/api/todo/todo_api.dart b/frontend/modules/common/apis/lib/src/apis/todo/todo_api.dart similarity index 76% rename from frontend/lib/src/data/api/todo/todo_api.dart rename to frontend/modules/common/apis/lib/src/apis/todo/todo_api.dart index 0cff223..59bfe21 100644 --- a/frontend/lib/src/data/api/todo/todo_api.dart +++ b/frontend/modules/common/apis/lib/src/apis/todo/todo_api.dart @@ -1,4 +1,5 @@ -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; + +import 'package:apis/src/models/todo/dto/todo_dto.dart'; abstract class TodoApi { Future getTodo(String id); diff --git a/frontend/lib/src/data/api/user_api.dart b/frontend/modules/common/apis/lib/src/apis/user/user_api.dart similarity index 90% rename from frontend/lib/src/data/api/user_api.dart rename to frontend/modules/common/apis/lib/src/apis/user/user_api.dart index 090efdc..e101548 100644 --- a/frontend/lib/src/data/api/user_api.dart +++ b/frontend/modules/common/apis/lib/src/apis/user/user_api.dart @@ -1,8 +1,8 @@ // ignore_for_file: unused_field +import 'package:apis/src/apis/local_storage/local_storage.dart'; +import 'package:apis/src/models/todo/dto/todo_dto.dart'; +import 'package:apis/src/models/user/dtos/user_dto.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:todo_bloc/src/data/local_storage/local_storage.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; -import 'package:todo_bloc/src/data/models/dtos/user/user_dto.dart'; class UserApi { UserApi({ diff --git a/frontend/modules/common/apis/lib/src/models/models.dart b/frontend/modules/common/apis/lib/src/models/models.dart new file mode 100644 index 0000000..9b2ed79 --- /dev/null +++ b/frontend/modules/common/apis/lib/src/models/models.dart @@ -0,0 +1,3 @@ +export 'queue/queue.dart'; +export 'todo/todo.dart'; +export 'user/user.dart'; diff --git a/frontend/lib/src/data/models/domains/queue.dart b/frontend/modules/common/apis/lib/src/models/queue/domain/queue.dart similarity index 100% rename from frontend/lib/src/data/models/domains/queue.dart rename to frontend/modules/common/apis/lib/src/models/queue/domain/queue.dart diff --git a/frontend/lib/src/data/models/dtos/queue/queue_dto.dart b/frontend/modules/common/apis/lib/src/models/queue/dto/queue_dto.dart similarity index 92% rename from frontend/lib/src/data/models/dtos/queue/queue_dto.dart rename to frontend/modules/common/apis/lib/src/models/queue/dto/queue_dto.dart index fa7fda7..fc386c0 100644 --- a/frontend/lib/src/data/models/dtos/queue/queue_dto.dart +++ b/frontend/modules/common/apis/lib/src/models/queue/dto/queue_dto.dart @@ -1,7 +1,7 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:apis/src/models/queue/domain/queue.dart'; +import 'package:apis/src/models/todo/dto/todo_dto.dart'; +import 'package:json_annotation/json_annotation.dart'; import 'package:realm/realm.dart'; -import 'package:todo_bloc/src/data/models/domains/queue.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; part 'queue_dto.g.dart'; diff --git a/frontend/lib/src/data/models/dtos/queue/queue_dto.g.dart b/frontend/modules/common/apis/lib/src/models/queue/dto/queue_dto.g.dart similarity index 96% rename from frontend/lib/src/data/models/dtos/queue/queue_dto.g.dart rename to frontend/modules/common/apis/lib/src/models/queue/dto/queue_dto.g.dart index d991342..3d8334d 100644 --- a/frontend/lib/src/data/models/dtos/queue/queue_dto.g.dart +++ b/frontend/modules/common/apis/lib/src/models/queue/dto/queue_dto.g.dart @@ -1,5 +1,3 @@ -// ignore_for_file: cast_nullable_to_non_nullable -// ignore_for_file: avoid_positional_boolean_parameters // GENERATED CODE - DO NOT MODIFY BY HAND part of 'queue_dto.dart'; @@ -27,6 +25,7 @@ Map _$QueueDTOToJson(_QueueDTO instance) => { // RealmObjectGenerator // ************************************************************************** +// ignore_for_file: type=lint class QueueDTO extends _QueueDTO with RealmEntity, RealmObjectBase, RealmObject { QueueDTO( diff --git a/frontend/modules/common/apis/lib/src/models/queue/queue.dart b/frontend/modules/common/apis/lib/src/models/queue/queue.dart new file mode 100644 index 0000000..2f044b3 --- /dev/null +++ b/frontend/modules/common/apis/lib/src/models/queue/queue.dart @@ -0,0 +1,3 @@ +//GENERATED BARREL FILE +export './domain/queue.dart'; +export './dto/queue_dto.dart'; diff --git a/frontend/lib/src/data/models/domains/todo.dart b/frontend/modules/common/apis/lib/src/models/todo/domain/todo.dart similarity index 100% rename from frontend/lib/src/data/models/domains/todo.dart rename to frontend/modules/common/apis/lib/src/models/todo/domain/todo.dart diff --git a/frontend/lib/src/data/models/domains/todo.freezed.dart b/frontend/modules/common/apis/lib/src/models/todo/domain/todo.freezed.dart similarity index 90% rename from frontend/lib/src/data/models/domains/todo.freezed.dart rename to frontend/modules/common/apis/lib/src/models/todo/domain/todo.freezed.dart index 3ad87ab..f657755 100644 --- a/frontend/lib/src/data/models/domains/todo.freezed.dart +++ b/frontend/modules/common/apis/lib/src/models/todo/domain/todo.freezed.dart @@ -117,9 +117,10 @@ class _$TodoCopyWithImpl<$Res, $Val extends Todo> } /// @nodoc -abstract class _$$_TodoCopyWith<$Res> implements $TodoCopyWith<$Res> { - factory _$$_TodoCopyWith(_$_Todo value, $Res Function(_$_Todo) then) = - __$$_TodoCopyWithImpl<$Res>; +abstract class _$$TodoImplCopyWith<$Res> implements $TodoCopyWith<$Res> { + factory _$$TodoImplCopyWith( + _$TodoImpl value, $Res Function(_$TodoImpl) then) = + __$$TodoImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -135,9 +136,10 @@ abstract class _$$_TodoCopyWith<$Res> implements $TodoCopyWith<$Res> { } /// @nodoc -class __$$_TodoCopyWithImpl<$Res> extends _$TodoCopyWithImpl<$Res, _$_Todo> - implements _$$_TodoCopyWith<$Res> { - __$$_TodoCopyWithImpl(_$_Todo _value, $Res Function(_$_Todo) _then) +class __$$TodoImplCopyWithImpl<$Res> + extends _$TodoCopyWithImpl<$Res, _$TodoImpl> + implements _$$TodoImplCopyWith<$Res> { + __$$TodoImplCopyWithImpl(_$TodoImpl _value, $Res Function(_$TodoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -153,7 +155,7 @@ class __$$_TodoCopyWithImpl<$Res> extends _$TodoCopyWithImpl<$Res, _$_Todo> Object? synced = freezed, Object? completed = freezed, }) { - return _then(_$_Todo( + return _then(_$TodoImpl( id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -196,8 +198,8 @@ class __$$_TodoCopyWithImpl<$Res> extends _$TodoCopyWithImpl<$Res, _$_Todo> /// @nodoc @JsonSerializable() -class _$_Todo implements _Todo { - const _$_Todo( +class _$TodoImpl implements _Todo { + const _$TodoImpl( {required this.id, required this.title, required this.description, @@ -208,7 +210,8 @@ class _$_Todo implements _Todo { this.synced, this.completed}); - factory _$_Todo.fromJson(Map json) => _$$_TodoFromJson(json); + factory _$TodoImpl.fromJson(Map json) => + _$$TodoImplFromJson(json); @override final String id; @@ -238,7 +241,7 @@ class _$_Todo implements _Todo { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Todo && + other is _$TodoImpl && (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && (identical(other.description, description) || @@ -262,12 +265,12 @@ class _$_Todo implements _Todo { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_TodoCopyWith<_$_Todo> get copyWith => - __$$_TodoCopyWithImpl<_$_Todo>(this, _$identity); + _$$TodoImplCopyWith<_$TodoImpl> get copyWith => + __$$TodoImplCopyWithImpl<_$TodoImpl>(this, _$identity); @override Map toJson() { - return _$$_TodoToJson( + return _$$TodoImplToJson( this, ); } @@ -283,9 +286,9 @@ abstract class _Todo implements Todo { final String? lastModifiedAt, final String? priority, final bool? synced, - final bool? completed}) = _$_Todo; + final bool? completed}) = _$TodoImpl; - factory _Todo.fromJson(Map json) = _$_Todo.fromJson; + factory _Todo.fromJson(Map json) = _$TodoImpl.fromJson; @override String get id; @@ -307,5 +310,6 @@ abstract class _Todo implements Todo { bool? get completed; @override @JsonKey(ignore: true) - _$$_TodoCopyWith<_$_Todo> get copyWith => throw _privateConstructorUsedError; + _$$TodoImplCopyWith<_$TodoImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/frontend/lib/src/data/models/domains/todo.g.dart b/frontend/modules/common/apis/lib/src/models/todo/domain/todo.g.dart similarity index 85% rename from frontend/lib/src/data/models/domains/todo.g.dart rename to frontend/modules/common/apis/lib/src/models/todo/domain/todo.g.dart index 3e4c58a..b754c02 100644 --- a/frontend/lib/src/data/models/domains/todo.g.dart +++ b/frontend/modules/common/apis/lib/src/models/todo/domain/todo.g.dart @@ -1,4 +1,3 @@ -// ignore_for_file: type=lint // GENERATED CODE - DO NOT MODIFY BY HAND part of 'todo.dart'; @@ -7,7 +6,7 @@ part of 'todo.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_Todo _$$_TodoFromJson(Map json) => _$_Todo( +_$TodoImpl _$$TodoImplFromJson(Map json) => _$TodoImpl( id: json['id'] as String, title: json['title'] as String, description: json['description'] as String, @@ -19,7 +18,8 @@ _$_Todo _$$_TodoFromJson(Map json) => _$_Todo( completed: json['completed'] as bool?, ); -Map _$$_TodoToJson(_$_Todo instance) => { +Map _$$TodoImplToJson(_$TodoImpl instance) => + { 'id': instance.id, 'title': instance.title, 'description': instance.description, diff --git a/frontend/lib/src/data/models/dtos/todo/todo_dto.dart b/frontend/modules/common/apis/lib/src/models/todo/dto/todo_dto.dart similarity index 97% rename from frontend/lib/src/data/models/dtos/todo/todo_dto.dart rename to frontend/modules/common/apis/lib/src/models/todo/dto/todo_dto.dart index 679f2a2..2d445e5 100644 --- a/frontend/lib/src/data/models/dtos/todo/todo_dto.dart +++ b/frontend/modules/common/apis/lib/src/models/todo/dto/todo_dto.dart @@ -1,6 +1,6 @@ +import 'package:apis/src/models/todo/domain/todo.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:realm/realm.dart'; -import 'package:todo_bloc/src/data/models/domains/todo.dart'; part 'todo_dto.g.dart'; diff --git a/frontend/lib/src/data/models/dtos/todo/todo_dto.g.dart b/frontend/modules/common/apis/lib/src/models/todo/dto/todo_dto.g.dart similarity index 97% rename from frontend/lib/src/data/models/dtos/todo/todo_dto.g.dart rename to frontend/modules/common/apis/lib/src/models/todo/dto/todo_dto.g.dart index adc9d2b..46aaf5a 100644 --- a/frontend/lib/src/data/models/dtos/todo/todo_dto.g.dart +++ b/frontend/modules/common/apis/lib/src/models/todo/dto/todo_dto.g.dart @@ -1,5 +1,3 @@ -// ignore_for_file: cast_nullable_to_non_nullable -// ignore_for_file: avoid_positional_boolean_parameters // GENERATED CODE - DO NOT MODIFY BY HAND part of 'todo_dto.dart'; @@ -35,6 +33,7 @@ Map _$TodoDTOToJson(_TodoDTO instance) => { // RealmObjectGenerator // ************************************************************************** +// ignore_for_file: type=lint class TodoDTO extends _TodoDTO with RealmEntity, RealmObjectBase, RealmObject { TodoDTO( ObjectId id, diff --git a/frontend/modules/common/apis/lib/src/models/todo/todo.dart b/frontend/modules/common/apis/lib/src/models/todo/todo.dart new file mode 100644 index 0000000..1f3bdb4 --- /dev/null +++ b/frontend/modules/common/apis/lib/src/models/todo/todo.dart @@ -0,0 +1,3 @@ +//GENERATED BARREL FILE +export './domain/todo.dart'; +export './dto/todo_dto.dart'; diff --git a/frontend/lib/src/data/models/dtos/user/user_dto.dart b/frontend/modules/common/apis/lib/src/models/user/dtos/user_dto.dart similarity index 86% rename from frontend/lib/src/data/models/dtos/user/user_dto.dart rename to frontend/modules/common/apis/lib/src/models/user/dtos/user_dto.dart index 74f94ae..1512a61 100644 --- a/frontend/lib/src/data/models/dtos/user/user_dto.dart +++ b/frontend/modules/common/apis/lib/src/models/user/dtos/user_dto.dart @@ -5,7 +5,12 @@ part 'user_dto.g.dart'; extension UserDTOJsonParser on UserDTO { static UserDTO _toRealmObject(_UserDTO user) { - return UserDTO(user.uid, user.emailAddress, user.firstName, user.lastName); + return UserDTO( + user.uid, + user.emailAddress, + user.firstName, + user.lastName, + ); } static UserDTO fromJson(Map json) => diff --git a/frontend/lib/src/data/models/dtos/user/user_dto.g.dart b/frontend/modules/common/apis/lib/src/models/user/dtos/user_dto.g.dart similarity index 96% rename from frontend/lib/src/data/models/dtos/user/user_dto.g.dart rename to frontend/modules/common/apis/lib/src/models/user/dtos/user_dto.g.dart index ceeb586..f3f8844 100644 --- a/frontend/lib/src/data/models/dtos/user/user_dto.g.dart +++ b/frontend/modules/common/apis/lib/src/models/user/dtos/user_dto.g.dart @@ -1,5 +1,3 @@ -// ignore_for_file: cast_nullable_to_non_nullable -// ignore_for_file: avoid_positional_boolean_parameters // GENERATED CODE - DO NOT MODIFY BY HAND part of 'user_dto.dart'; @@ -25,6 +23,7 @@ Map _$UserDTOToJson(_UserDTO instance) => { // RealmObjectGenerator // ************************************************************************** +// ignore_for_file: type=lint class UserDTO extends _UserDTO with RealmEntity, RealmObjectBase, RealmObject { UserDTO( String uid, diff --git a/frontend/modules/common/apis/lib/src/models/user/user.dart b/frontend/modules/common/apis/lib/src/models/user/user.dart new file mode 100644 index 0000000..f1bc838 --- /dev/null +++ b/frontend/modules/common/apis/lib/src/models/user/user.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export './dtos/user_dto.dart'; diff --git a/frontend/modules/common/apis/pubspec.yaml b/frontend/modules/common/apis/pubspec.yaml new file mode 100644 index 0000000..2824419 --- /dev/null +++ b/frontend/modules/common/apis/pubspec.yaml @@ -0,0 +1,24 @@ +name: apis +description: A Very Good Project created by Very Good CLI. +version: 1.0.0+1 +publish_to: none + +environment: + sdk: ">=3.0.0 <4.0.0" + +dependencies: + cloud_firestore: ^4.8.4 + collection: ^1.17.1 + freezed: ^2.4.1 + freezed_annotation: ^2.4.1 + json_annotation: ^4.8.1 + realm: ^1.3.0 + +dev_dependencies: + build_runner: ^2.3.3 + fake_cloud_firestore: ^2.4.1+1 + flutter_test: + sdk: flutter + json_serializable: ^6.7.1 + mocktail: ^1.0.0 + very_good_analysis: ^5.0.0 diff --git a/frontend/modules/common/core/analysis_options.yaml b/frontend/modules/common/core/analysis_options.yaml new file mode 100644 index 0000000..fa798a8 --- /dev/null +++ b/frontend/modules/common/core/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:very_good_analysis/analysis_options.5.1.0.yaml +linter: + rules: + public_member_api_docs: false diff --git a/frontend/modules/common/core/lib/core.dart b/frontend/modules/common/core/lib/core.dart new file mode 100644 index 0000000..d54238d --- /dev/null +++ b/frontend/modules/common/core/lib/core.dart @@ -0,0 +1,11 @@ +//GENERATED BARREL FILE +export 'src/constants/theme.dart'; +export 'src/enums/enums.dart'; +export 'src/enums/processing_state.dart'; +export 'src/enums/todo_operation_type.dart'; +export 'src/enums/todo_priority.dart'; +export 'src/enums/todo_status.dart'; +export 'src/extensions/date_time_helpers.dart'; +export 'src/extensions/extensions.dart'; +export 'src/shared/shared.dart'; +export 'src/shared/ui_kit/custom_snackbar_builder.dart'; diff --git a/frontend/lib/src/core/constants/theme.dart b/frontend/modules/common/core/lib/src/constants/theme.dart similarity index 100% rename from frontend/lib/src/core/constants/theme.dart rename to frontend/modules/common/core/lib/src/constants/theme.dart diff --git a/frontend/lib/src/core/enums/enums.dart b/frontend/modules/common/core/lib/src/enums/enums.dart similarity index 100% rename from frontend/lib/src/core/enums/enums.dart rename to frontend/modules/common/core/lib/src/enums/enums.dart diff --git a/frontend/lib/src/core/enums/processing_state.dart b/frontend/modules/common/core/lib/src/enums/processing_state.dart similarity index 100% rename from frontend/lib/src/core/enums/processing_state.dart rename to frontend/modules/common/core/lib/src/enums/processing_state.dart diff --git a/frontend/lib/src/core/enums/todo_operation_type.dart b/frontend/modules/common/core/lib/src/enums/todo_operation_type.dart similarity index 100% rename from frontend/lib/src/core/enums/todo_operation_type.dart rename to frontend/modules/common/core/lib/src/enums/todo_operation_type.dart diff --git a/frontend/lib/src/core/enums/todo_priority.dart b/frontend/modules/common/core/lib/src/enums/todo_priority.dart similarity index 100% rename from frontend/lib/src/core/enums/todo_priority.dart rename to frontend/modules/common/core/lib/src/enums/todo_priority.dart diff --git a/frontend/lib/src/core/enums/todo_status.dart b/frontend/modules/common/core/lib/src/enums/todo_status.dart similarity index 100% rename from frontend/lib/src/core/enums/todo_status.dart rename to frontend/modules/common/core/lib/src/enums/todo_status.dart diff --git a/frontend/lib/src/core/extensions/date_time_helpers.dart b/frontend/modules/common/core/lib/src/extensions/date_time_helpers.dart similarity index 100% rename from frontend/lib/src/core/extensions/date_time_helpers.dart rename to frontend/modules/common/core/lib/src/extensions/date_time_helpers.dart diff --git a/frontend/lib/src/core/extensions/extensions.dart b/frontend/modules/common/core/lib/src/extensions/extensions.dart similarity index 52% rename from frontend/lib/src/core/extensions/extensions.dart rename to frontend/modules/common/core/lib/src/extensions/extensions.dart index 548dfe9..d02f92c 100644 --- a/frontend/lib/src/core/extensions/extensions.dart +++ b/frontend/modules/common/core/lib/src/extensions/extensions.dart @@ -1 +1,2 @@ export 'date_time_helpers.dart'; +export 'string_helpers.dart'; diff --git a/frontend/modules/common/core/lib/src/extensions/string_helpers.dart b/frontend/modules/common/core/lib/src/extensions/string_helpers.dart new file mode 100644 index 0000000..1916281 --- /dev/null +++ b/frontend/modules/common/core/lib/src/extensions/string_helpers.dart @@ -0,0 +1,6 @@ +extension StringHelpersX on String { + /// Capitalize the first letter in a string. + String get capitalize { + return (length > 1) ? this[0].toUpperCase() + substring(1) : toUpperCase(); + } +} diff --git a/frontend/lib/src/core/shared/shared.dart b/frontend/modules/common/core/lib/src/shared/shared.dart similarity index 100% rename from frontend/lib/src/core/shared/shared.dart rename to frontend/modules/common/core/lib/src/shared/shared.dart diff --git a/frontend/lib/src/core/shared/ui_kit/custom_snackbar_builder.dart b/frontend/modules/common/core/lib/src/shared/ui_kit/custom_snackbar_builder.dart similarity index 100% rename from frontend/lib/src/core/shared/ui_kit/custom_snackbar_builder.dart rename to frontend/modules/common/core/lib/src/shared/ui_kit/custom_snackbar_builder.dart diff --git a/frontend/modules/common/core/pubspec.yaml b/frontend/modules/common/core/pubspec.yaml new file mode 100644 index 0000000..1095fab --- /dev/null +++ b/frontend/modules/common/core/pubspec.yaml @@ -0,0 +1,23 @@ +name: core +description: A Very Good Project created by Very Good CLI. +version: 1.0.0+1 +publish_to: none + +environment: + sdk: ">=3.0.0 <4.0.0" + +dependencies: + flex_color_scheme: ^7.2.0 + flutter: + sdk: flutter + intl: ^0.18.0 + moment_dart: ^1.0.1 + +dev_dependencies: + flutter_test: + sdk: flutter + mocktail: ^1.0.0 + very_good_analysis: ^5.0.0 + +flutter: + uses-material-design: true \ No newline at end of file diff --git a/frontend/modules/common/repositories/analysis_options.yaml b/frontend/modules/common/repositories/analysis_options.yaml new file mode 100644 index 0000000..fa798a8 --- /dev/null +++ b/frontend/modules/common/repositories/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:very_good_analysis/analysis_options.5.1.0.yaml +linter: + rules: + public_member_api_docs: false diff --git a/frontend/modules/common/repositories/lib/repositories.dart b/frontend/modules/common/repositories/lib/repositories.dart new file mode 100644 index 0000000..0710d3a --- /dev/null +++ b/frontend/modules/common/repositories/lib/repositories.dart @@ -0,0 +1,5 @@ +//GENERATED BARREL FILE +export 'src/auth/auth.dart'; +export 'src/connection_checker/connection_checker.dart'; +export 'src/todo/todo.dart'; +export 'src/todo_sync/todo_sync.dart'; diff --git a/frontend/modules/common/repositories/lib/src/auth/auth.dart b/frontend/modules/common/repositories/lib/src/auth/auth.dart new file mode 100644 index 0000000..f3fe3a4 --- /dev/null +++ b/frontend/modules/common/repositories/lib/src/auth/auth.dart @@ -0,0 +1,3 @@ +//GENERATED BARREL FILE +export 'auth_repository.dart'; +export 'auth_repository_impl.dart'; diff --git a/frontend/lib/src/data/repositories/auth/auth_repository.dart b/frontend/modules/common/repositories/lib/src/auth/auth_repository.dart similarity index 100% rename from frontend/lib/src/data/repositories/auth/auth_repository.dart rename to frontend/modules/common/repositories/lib/src/auth/auth_repository.dart diff --git a/frontend/lib/src/data/repositories/auth/auth_repository_impl.dart b/frontend/modules/common/repositories/lib/src/auth/auth_repository_impl.dart similarity index 92% rename from frontend/lib/src/data/repositories/auth/auth_repository_impl.dart rename to frontend/modules/common/repositories/lib/src/auth/auth_repository_impl.dart index 4e32b5d..7437400 100644 --- a/frontend/lib/src/data/repositories/auth/auth_repository_impl.dart +++ b/frontend/modules/common/repositories/lib/src/auth/auth_repository_impl.dart @@ -1,7 +1,7 @@ +import 'package:apis/apis.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:google_sign_in/google_sign_in.dart'; -import 'package:todo_bloc/src/data/api/user_api.dart'; -import 'package:todo_bloc/src/data/repositories/auth/auth_repository.dart'; +import 'package:repositories/src/auth/auth_repository.dart'; class AuthRepositoryImpl implements AuthRepository { AuthRepositoryImpl({ diff --git a/frontend/modules/common/repositories/lib/src/connection_checker/connection_checker.dart b/frontend/modules/common/repositories/lib/src/connection_checker/connection_checker.dart new file mode 100644 index 0000000..51888f0 --- /dev/null +++ b/frontend/modules/common/repositories/lib/src/connection_checker/connection_checker.dart @@ -0,0 +1,2 @@ +//GENERATED BARREL FILE +export 'connection_checker_impl.dart'; diff --git a/frontend/lib/src/data/repositories/connection_checker/connection_checker_impl.dart b/frontend/modules/common/repositories/lib/src/connection_checker/connection_checker_impl.dart similarity index 77% rename from frontend/lib/src/data/repositories/connection_checker/connection_checker_impl.dart rename to frontend/modules/common/repositories/lib/src/connection_checker/connection_checker_impl.dart index b099cbb..4b128d8 100644 --- a/frontend/lib/src/data/repositories/connection_checker/connection_checker_impl.dart +++ b/frontend/modules/common/repositories/lib/src/connection_checker/connection_checker_impl.dart @@ -1,5 +1,10 @@ +// ignore_for_file: one_member_abstracts + import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; -import 'package:todo_bloc/src/data/repositories/connection_checker/connection_checker.dart'; + +abstract class ConnectionChecker { + Stream getInternetStatus(); +} class ConnectionCheckerImpl implements ConnectionChecker { ConnectionCheckerImpl({required InternetConnection internetConnection}) diff --git a/frontend/modules/common/repositories/lib/src/todo/todo.dart b/frontend/modules/common/repositories/lib/src/todo/todo.dart new file mode 100644 index 0000000..30849bd --- /dev/null +++ b/frontend/modules/common/repositories/lib/src/todo/todo.dart @@ -0,0 +1,3 @@ +//GENERATED BARREL FILE +export 'todo_repository.dart'; +export 'todo_repository_impl.dart'; diff --git a/frontend/lib/src/data/repositories/todo/todo_repository.dart b/frontend/modules/common/repositories/lib/src/todo/todo_repository.dart similarity index 78% rename from frontend/lib/src/data/repositories/todo/todo_repository.dart rename to frontend/modules/common/repositories/lib/src/todo/todo_repository.dart index 5358263..674233b 100644 --- a/frontend/lib/src/data/repositories/todo/todo_repository.dart +++ b/frontend/modules/common/repositories/lib/src/todo/todo_repository.dart @@ -1,4 +1,4 @@ -import 'package:todo_bloc/src/data/models/domains/todo.dart'; +import 'package:apis/apis.dart'; abstract class TodoRepository { String getGeneratedTodoId(); diff --git a/frontend/lib/src/data/repositories/todo/todo_repository_impl.dart b/frontend/modules/common/repositories/lib/src/todo/todo_repository_impl.dart similarity index 74% rename from frontend/lib/src/data/repositories/todo/todo_repository_impl.dart rename to frontend/modules/common/repositories/lib/src/todo/todo_repository_impl.dart index f21cd9b..eabdd42 100644 --- a/frontend/lib/src/data/repositories/todo/todo_repository_impl.dart +++ b/frontend/modules/common/repositories/lib/src/todo/todo_repository_impl.dart @@ -1,11 +1,6 @@ -// import 'dart:developer' as developer; - -import 'package:clock/clock.dart'; +import 'package:apis/apis.dart'; import 'package:realm/realm.dart'; -import 'package:todo_bloc/src/data/api/todo/todo_api.dart'; -import 'package:todo_bloc/src/data/models/domains/todo.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; -import 'package:todo_bloc/src/data/repositories/todo/todo_repository.dart'; +import 'package:repositories/src/todo/todo_repository.dart'; class TodoRepositoryImpl implements TodoRepository { TodoRepositoryImpl({ @@ -31,7 +26,7 @@ class TodoRepositoryImpl implements TodoRepository { todo.priority!, todo.description, todo.title, - clock.now().toIso8601String(), + DateTime.now().toIso8601String(), false, todo.completed ?? false, ), diff --git a/frontend/modules/common/repositories/lib/src/todo_sync/todo_sync.dart b/frontend/modules/common/repositories/lib/src/todo_sync/todo_sync.dart new file mode 100644 index 0000000..aa9071d --- /dev/null +++ b/frontend/modules/common/repositories/lib/src/todo_sync/todo_sync.dart @@ -0,0 +1,3 @@ +//GENERATED BARREL FILE +export 'todo_sync_repository.dart'; +export 'todo_sync_repository_impl.dart'; diff --git a/frontend/lib/src/data/repositories/todo_sync/todo_sync_repository.dart b/frontend/modules/common/repositories/lib/src/todo_sync/todo_sync_repository.dart similarity index 65% rename from frontend/lib/src/data/repositories/todo_sync/todo_sync_repository.dart rename to frontend/modules/common/repositories/lib/src/todo_sync/todo_sync_repository.dart index c0ecc86..66c2824 100644 --- a/frontend/lib/src/data/repositories/todo_sync/todo_sync_repository.dart +++ b/frontend/modules/common/repositories/lib/src/todo_sync/todo_sync_repository.dart @@ -1,5 +1,4 @@ -import 'package:todo_bloc/src/data/models/domains/queue.dart'; -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; +import 'package:apis/apis.dart'; abstract class TodoSyncRepository { Future needToPush(); diff --git a/frontend/lib/src/data/repositories/todo_sync/todo_sync_repository_impl.dart b/frontend/modules/common/repositories/lib/src/todo_sync/todo_sync_repository_impl.dart similarity index 93% rename from frontend/lib/src/data/repositories/todo_sync/todo_sync_repository_impl.dart rename to frontend/modules/common/repositories/lib/src/todo_sync/todo_sync_repository_impl.dart index 7c0fe65..3ae5d01 100644 --- a/frontend/lib/src/data/repositories/todo_sync/todo_sync_repository_impl.dart +++ b/frontend/modules/common/repositories/lib/src/todo_sync/todo_sync_repository_impl.dart @@ -1,14 +1,7 @@ import 'dart:developer' as developer; - +import 'package:apis/apis.dart'; import 'package:realm/realm.dart'; -import 'package:todo_bloc/src/data/api/queue/local_queue_api.dart'; -import 'package:todo_bloc/src/data/api/queue/remote_queue_api.dart'; -import 'package:todo_bloc/src/data/api/todo/local_todo_api.dart'; -import 'package:todo_bloc/src/data/api/todo/remote_todo_api.dart'; -import 'package:todo_bloc/src/data/models/domains/queue.dart'; -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; -import 'package:todo_bloc/src/data/repositories/todo_sync/todo_sync_repository.dart'; +import 'package:repositories/src/todo_sync/todo_sync_repository.dart'; class TodoSyncRepositoryImpl implements TodoSyncRepository { TodoSyncRepositoryImpl({ diff --git a/frontend/modules/common/repositories/pubspec.yaml b/frontend/modules/common/repositories/pubspec.yaml new file mode 100644 index 0000000..ee38848 --- /dev/null +++ b/frontend/modules/common/repositories/pubspec.yaml @@ -0,0 +1,29 @@ +name: repositories +description: A Very Good Project created by Very Good CLI. +version: 1.0.0+1 +publish_to: none + +environment: + sdk: ">=3.0.0 <4.0.0" + +dependencies: + apis: + path: ../apis + collection: ^1.17.1 + firebase_auth: ^4.7.2 + flutter: + sdk: flutter + flutter_localizations: + sdk: flutter + google_sign_in: ^6.1.4 + internet_connection_checker_plus: ^2.0.0 + intl: ^0.18.0 + json_annotation: ^4.8.1 + # make this only used in apis package + realm: ^1.3.0 + +dev_dependencies: + flutter_test: + sdk: flutter + mocktail: ^1.0.0 + very_good_analysis: ^5.0.0 diff --git a/frontend/test/data/repositories/todo_sync_repository_test.dart b/frontend/modules/common/repositories/test/data/repositories/todo_sync_repository_test.dart similarity index 95% rename from frontend/test/data/repositories/todo_sync_repository_test.dart rename to frontend/modules/common/repositories/test/data/repositories/todo_sync_repository_test.dart index df2e19a..05e932c 100644 --- a/frontend/test/data/repositories/todo_sync_repository_test.dart +++ b/frontend/modules/common/repositories/test/data/repositories/todo_sync_repository_test.dart @@ -1,17 +1,10 @@ // ignore_for_file: type=lint // ignore_for_file: unused_local_variable - +import 'package:apis/apis.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:realm/realm.dart'; -import 'package:todo_bloc/src/data/api/queue/local_queue_api.dart'; -import 'package:todo_bloc/src/data/api/queue/remote_queue_api.dart'; -import 'package:todo_bloc/src/data/api/todo/local_todo_api.dart'; -import 'package:todo_bloc/src/data/api/todo/remote_todo_api.dart'; -import 'package:todo_bloc/src/data/local_storage/local_storage.dart'; -import 'package:todo_bloc/src/data/models/dtos/queue/queue_dto.dart'; -import 'package:todo_bloc/src/data/models/dtos/todo/todo_dto.dart'; -import 'package:todo_bloc/src/data/repositories/todo_sync/todo_sync_repository_impl.dart'; +import 'package:repositories/src/todo_sync/todo_sync_repository_impl.dart'; class MockTodoDTO extends Mock implements TodoDTO {} @@ -70,7 +63,9 @@ void main() { () async { when(() => queue.operationType) .thenReturn(QueueOperationType.create.name); - when(() => localQueueApi.createQueue(any())).thenAnswer((_) async {}); + when(() => localQueueApi.createQueue(any())).thenAnswer((_) async { + return null; + }); await sut.createQueueForTodo( operationType: QueueOperationType.create, @@ -86,7 +81,9 @@ void main() { () async { when(() => queue.operationType) .thenReturn(QueueOperationType.update.name); - when(() => localQueueApi.createQueue(any())).thenAnswer((_) async {}); + when(() => localQueueApi.createQueue(any())).thenAnswer((_) async { + return null; + }); await sut.createQueueForTodo( operationType: QueueOperationType.update, @@ -106,7 +103,9 @@ void main() { when(() => localQueueApi.checkAndRemoveExistingUnsyncedQueue( operationType: QueueOperationType.delete, todoId: any(named: 'todoId'))).thenAnswer((_) async => false); - when(() => localQueueApi.createQueue(any())).thenAnswer((_) async {}); + when(() => localQueueApi.createQueue(any())).thenAnswer((_) async { + return null; + }); await sut.createQueueForTodo( operationType: QueueOperationType.delete, diff --git a/frontend/modules/riverpod_implementation/analysis_options.yaml b/frontend/modules/riverpod_implementation/analysis_options.yaml new file mode 100644 index 0000000..e69de29 diff --git a/frontend/modules/riverpod_implementation/pubspec.yaml b/frontend/modules/riverpod_implementation/pubspec.yaml new file mode 100644 index 0000000..e69de29 diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml index 19804fa..6befd76 100644 --- a/frontend/pubspec.yaml +++ b/frontend/pubspec.yaml @@ -7,37 +7,20 @@ environment: sdk: ">=3.0.0 <4.0.0" dependencies: - bloc: ^8.1.2 - clock: ^1.1.1 + apis: + path: modules/common/apis + bloc_implementation: + path: modules/bloc_implementation cloud_firestore: ^4.8.4 - collection: ^1.17.1 - device_info_plus: ^9.0.3 - equatable: ^2.0.5 - firebase_auth: ^4.7.2 firebase_core: ^2.15.0 - flex_color_scheme: ^7.2.0 flutter: sdk: flutter - flutter_bloc: ^8.1.3 - flutter_localizations: - sdk: flutter - freezed: ^2.4.1 - freezed_annotation: ^2.4.1 - google_sign_in: ^6.1.4 - hydrated_bloc: ^9.1.2 internet_connection_checker_plus: ^2.0.0 - intl: ^0.18.0 - json_annotation: ^4.8.1 - moment_dart: ^1.0.1 realm: ^1.3.0 dev_dependencies: - bloc_test: ^9.1.2 - build_runner: ^2.3.3 - fake_cloud_firestore: ^2.4.1+1 flutter_test: sdk: flutter - json_serializable: ^6.7.1 mocktail: ^1.0.0 very_good_analysis: ^5.0.0