From d06adb0596b7afb175ceb1981b0c4b812a27f3bd Mon Sep 17 00:00:00 2001 From: Hz <58271093+Hzdotexe@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:59:16 -0400 Subject: [PATCH 1/4] lib folder feature-first structure (#996) * lib folder feature-first structure * [BOT] Applying version. * feature-first changes + build working * tests import fixed * [BOT] Applying pod update. --------- Co-authored-by: XavierPaquet-Rapold Co-authored-by: Hzdotexe --- .env.template | 2 - ios/Podfile.lock | 24 +++++----- lib/{core => }/constants/app_info.dart | 0 lib/{core => }/constants/markers.dart | 0 .../constants/preferences_flags.dart | 0 lib/{core => }/constants/update_code.dart | 0 lib/{core => }/constants/urls.dart | 0 lib/{core => }/constants/widget_helper.dart | 0 .../app/analytics}/analytics_service.dart | 0 .../app/analytics}/remote_config_service.dart | 4 +- .../app/error}/internal_info_service.dart | 4 +- .../app/error/not_found}/not_found_view.dart | 4 +- .../error/not_found}/not_found_viewmodel.dart | 10 ++--- .../app/error/outage}/outage_view.dart | 8 ++-- .../app/error/outage}/outage_viewmodel.dart | 10 ++--- .../app/integration}/firebase_options.dart | 0 .../app/integration}/github_api.dart | 8 ++-- .../app/integration}/launch_url_service.dart | 6 +-- .../app/integration}/networking_service.dart | 0 .../app/navigation}/navigation_service.dart | 8 ++-- .../app/navigation}/router.dart | 44 +++++++++---------- .../app/navigation}/router_paths.dart | 0 .../presentation}/rive_animation_service.dart | 2 +- .../webview_controller_extension.dart | 0 .../app/repository}/course_repository.dart | 12 ++--- .../repository}/quick_link_repository.dart | 10 ++--- .../app/repository}/user_repository.dart | 10 ++--- .../app/startup}/startup_view.dart | 6 +-- .../app/startup}/startup_viewmodel.dart | 24 +++++----- .../app/storage}/cache_manager.dart | 6 +-- .../app/storage}/preferences_service.dart | 2 +- .../app/storage}/siren_flutter_service.dart | 0 .../app/widgets}/app_widget_service.dart | 8 ++-- .../app}/widgets/base_scaffold.dart | 12 ++--- .../app}/widgets/bottom_bar.dart | 14 +++--- .../app}/widgets/dismissible_card.dart | 0 .../app}/widgets/link_web_view.dart | 4 +- .../app}/widgets/web_link_card.dart | 6 +-- .../dashboard}/dashboard_view.dart | 38 ++++++++-------- .../dashboard}/dashboard_viewmodel.dart | 38 ++++++++-------- .../dashboard}/progress_bar_text_options.dart | 0 .../widgets/course_activity_tile.dart | 0 .../dashboard}/widgets/haptics_container.dart | 0 .../ets/quick-link}/models/quick_link.dart | 0 .../quick-link}/models/quick_link_data.dart | 0 .../ets/quick-link/models}/quick_links.dart | 4 +- .../ets/quick-link}/quick_links_view.dart | 10 ++--- .../quick-link}/quick_links_viewmodel.dart | 8 ++-- .../ets/security-info}/emergency_view.dart | 6 +-- .../models/emergency_procedure.dart | 0 .../models}/emergency_procedures.dart | 2 +- .../ets/security-info}/security_view.dart | 8 ++-- .../security-info}/security_viewmodel.dart | 6 +-- .../ets}/web_link_card_viewmodel.dart | 12 ++--- .../more/about}/about_view.dart | 4 +- .../more/contributors}/contributors_view.dart | 8 ++-- .../contributors}/contributors_viewmodel.dart | 0 .../views => features/more/faq}/faq_view.dart | 6 +-- .../more/faq}/faq_viewmodel.dart | 10 ++--- .../more/faq/models}/faq.dart | 6 +-- .../more/faq}/models/faq_actions.dart | 0 .../more/faq}/models/faq_questions.dart | 0 .../more/feedback}/feedback_type.dart | 0 .../more/feedback}/feedback_view.dart | 10 ++--- .../more/feedback}/feedback_viewmodel.dart | 13 +++--- .../more/feedback}/in_app_review_service.dart | 2 +- .../models}/custom_feedback_localization.dart | 0 .../more/feedback}/models/feedback.dart | 0 .../more/feedback}/models/feedback_issue.dart | 0 .../feedback}/widgets/custom_feedback.dart | 4 +- .../views => features/more}/more_view.dart | 18 ++++---- .../more}/more_viewmodel.dart | 28 ++++++------ .../more/settings}/choose_language_view.dart | 6 +-- .../settings}/choose_language_viewmodel.dart | 8 ++-- .../more/settings}/settings_manager.dart | 10 ++--- .../more/settings}/settings_view.dart | 6 +-- .../more/settings}/settings_viewmodel.dart | 4 +- .../schedule_settings_viewmodel.dart | 8 ++-- .../schedule}/schedule_view.dart | 24 +++++----- .../schedule}/schedule_viewmodel.dart | 16 +++---- .../schedule}/widgets/calendar_selector.dart | 8 ++-- .../widgets/schedule_calendar_tile.dart | 0 .../schedule}/widgets/schedule_settings.dart | 6 +-- .../grade_details}/grade_details_view.dart | 14 +++--- .../grades_details_viewmodel.dart | 12 ++--- .../student/grades}/grades_view.dart | 16 +++---- .../student/grades}/grades_viewmodel.dart | 12 ++--- .../schedule_default}/schedule_default.dart | 4 +- .../schedule_default_view.dart | 6 +-- .../schedule_default_viewmodel.dart | 6 +-- .../student/grades}/widget_models.dart | 0 .../student/grades}/widgets/grade_button.dart | 16 +++---- .../widgets/grade_circular_progress.dart | 2 +- .../widgets/grade_evaluation_tile.dart | 10 ++--- .../grades}/widgets/grade_not_available.dart | 2 +- .../student/profile}/profile_view.dart | 12 ++--- .../student/profile}/profile_viewmodel.dart | 8 ++-- .../student/profile}/programs_credits.dart | 0 .../student}/student_view.dart | 12 ++--- .../student}/widgets/student_program.dart | 2 +- .../discovery}/discovery_components.dart | 16 +++---- .../welcome/discovery}/models/discovery.dart | 0 .../discovery/models}/discovery_ids.dart | 0 .../discovery}/models/group_discovery.dart | 2 +- .../welcome/login}/login_mask.dart | 0 .../welcome/login}/login_view.dart | 20 ++++----- .../welcome/login}/login_viewmodel.dart | 12 ++--- .../welcome}/widgets/password_text_field.dart | 0 lib/main.dart | 26 +++++------ lib/{core => }/utils/animation_exception.dart | 0 lib/{ui => }/utils/app_theme.dart | 0 lib/{core => }/utils/cache_exception.dart | 0 lib/{core => }/utils/calendar_utils.dart | 0 lib/{ui => }/utils/loading.dart | 0 lib/{ => utils}/locator.dart | 34 +++++++------- lib/{core => }/utils/utils.dart | 0 pubspec.yaml | 14 +++--- test/helpers.dart | 36 +++++++-------- test/managers/course_repository_test.dart | 8 ++-- test/managers/quick_link_repository_test.dart | 8 ++-- test/managers/settings_manager_test.dart | 6 +-- test/managers/user_repository_test.dart | 8 ++-- test/mock/managers/cache_manager_mock.dart | 4 +- .../mock/managers/course_repository_mock.dart | 2 +- .../managers/quick_links_repository_mock.dart | 6 +-- test/mock/managers/settings_manager_mock.dart | 4 +- test/mock/managers/user_repository_mock.dart | 2 +- .../mock/services/analytics_service_mock.dart | 2 +- .../services/app_widget_service_mock.dart | 2 +- test/mock/services/github_api_mock.dart | 4 +- test/mock/services/home_widget_mock.dart | 2 +- .../services/in_app_review_service_mock.dart | 2 +- .../services/internal_info_service_mock.dart | 2 +- .../services/launch_url_service_mock.dart | 2 +- .../services/navigation_service_mock.dart | 2 +- .../services/networking_service_mock.dart | 2 +- .../services/preferences_service_mock.dart | 4 +- .../services/remote_config_service_mock.dart | 2 +- .../services/rive_animation_service_mock.dart | 4 +- .../services/siren_flutter_service_mock.dart | 2 +- test/models/feedback_issue_test.dart | 2 +- test/services/app_widget_service_test.dart | 6 +-- test/services/preferences_service_test.dart | 4 +- test/ui/views/about_view_test.dart | 2 +- test/ui/views/choose_language_view_test.dart | 6 +-- test/ui/views/dashboard_view_test.dart | 12 ++--- test/ui/views/emergency_view_test.dart | 2 +- test/ui/views/faq_view_test.dart | 4 +- test/ui/views/feedback_view_test.dart | 2 +- test/ui/views/grades_details_view_test.dart | 8 ++-- test/ui/views/grades_view_test.dart | 12 ++--- test/ui/views/login_view_test.dart | 18 ++++---- test/ui/views/more_view_test.dart | 6 +-- test/ui/views/not_found_view_test.dart | 2 +- test/ui/views/profile_view_test.dart | 4 +- test/ui/views/quick_links_view_test.dart | 12 ++--- test/ui/views/schedule_default_view_test.dart | 10 ++--- test/ui/views/schedule_view_test.dart | 6 +-- test/ui/views/security_view_test.dart | 4 +- test/ui/views/settings_view_test.dart | 4 +- test/ui/views/student_view_test.dart | 10 ++--- test/ui/widgets/base_scaffold_test.dart | 8 ++-- test/ui/widgets/bottom_bar_test.dart | 8 ++-- .../ui/widgets/course_activity_tile_test.dart | 2 +- test/ui/widgets/dismissible_card_test.dart | 2 +- test/ui/widgets/grade_button_test.dart | 10 ++--- .../widgets/grade_circular_progress_test.dart | 2 +- .../widgets/grade_evaluation_tile_test.dart | 4 +- test/ui/widgets/grade_not_available_test.dart | 2 +- test/ui/widgets/link_web_view_test.dart | 4 +- test/ui/widgets/password_text_field_test.dart | 2 +- test/ui/widgets/schedule_default_test.dart | 2 +- test/ui/widgets/schedule_settings_test.dart | 4 +- test/ui/widgets/student_program_test.dart | 2 +- test/ui/widgets/web_link_card_test.dart | 10 ++--- .../choose_language_viewmodel_test.dart | 10 ++--- test/viewmodels/dashboard_viewmodel_test.dart | 8 ++-- test/viewmodels/faq_viewmodel_test.dart | 6 +-- test/viewmodels/feedback_viewmodel_test.dart | 12 ++--- .../grades_details_viewmodel_test.dart | 6 +-- test/viewmodels/grades_viewmodel_test.dart | 8 ++-- test/viewmodels/login_viewmodel_test.dart | 8 ++-- test/viewmodels/more_viewmodel_test.dart | 16 +++---- test/viewmodels/not_found_viewmodel_test.dart | 10 ++--- test/viewmodels/profile_viewmodel_test.dart | 6 +-- .../quick_links_viewmodel_test.dart | 10 ++--- .../schedule_default_viewmodel_test.dart | 4 +- .../schedule_settings_viewmodel_test.dart | 6 +-- test/viewmodels/schedule_viewmodel_test.dart | 8 ++-- test/viewmodels/settings_viewmodel_test.dart | 6 +-- test/viewmodels/startup_viewmodel_test.dart | 18 ++++---- .../web_link_card_viewmodel_test.dart | 14 +++--- 192 files changed, 656 insertions(+), 657 deletions(-) delete mode 100644 .env.template rename lib/{core => }/constants/app_info.dart (100%) rename lib/{core => }/constants/markers.dart (100%) rename lib/{core => }/constants/preferences_flags.dart (100%) rename lib/{core => }/constants/update_code.dart (100%) rename lib/{core => }/constants/urls.dart (100%) rename lib/{core => }/constants/widget_helper.dart (100%) rename lib/{core/services => features/app/analytics}/analytics_service.dart (100%) rename lib/{core/services => features/app/analytics}/remote_config_service.dart (96%) rename lib/{core/services => features/app/error}/internal_info_service.dart (92%) rename lib/{ui/views => features/app/error/not_found}/not_found_view.dart (96%) rename lib/{core/viewmodels => features/app/error/not_found}/not_found_viewmodel.dart (83%) rename lib/{ui/views => features/app/error/outage}/outage_view.dart (96%) rename lib/{core/viewmodels => features/app/error/outage}/outage_viewmodel.dart (81%) rename lib/{ => features/app/integration}/firebase_options.dart (100%) rename lib/{core/services => features/app/integration}/github_api.dart (94%) rename lib/{core/services => features/app/integration}/launch_url_service.dart (94%) rename lib/{core/services => features/app/integration}/networking_service.dart (100%) rename lib/{core/services => features/app/navigation}/navigation_service.dart (89%) rename lib/{ui => features/app/navigation}/router.dart (74%) rename lib/{core/constants => features/app/navigation}/router_paths.dart (100%) rename lib/{core/services => features/app/presentation}/rive_animation_service.dart (95%) rename lib/{core/extensions => features/app/presentation}/webview_controller_extension.dart (100%) rename lib/{core/managers => features/app/repository}/course_repository.dart (98%) rename lib/{core/managers => features/app/repository}/quick_link_repository.dart (75%) rename lib/{core/managers => features/app/repository}/user_repository.dart (97%) rename lib/{ui/views => features/app/startup}/startup_view.dart (92%) rename lib/{core/viewmodels => features/app/startup}/startup_viewmodel.dart (86%) rename lib/{core/managers => features/app/storage}/cache_manager.dart (92%) rename lib/{core/services => features/app/storage}/preferences_service.dart (98%) rename lib/{core/services => features/app/storage}/siren_flutter_service.dart (100%) rename lib/{core/services => features/app/widgets}/app_widget_service.dart (91%) rename lib/{ui => features/app}/widgets/base_scaffold.dart (91%) rename lib/{ui => features/app}/widgets/bottom_bar.dart (90%) rename lib/{ui => features/app}/widgets/dismissible_card.dart (100%) rename lib/{ui => features/app}/widgets/link_web_view.dart (88%) rename lib/{ui => features/app}/widgets/web_link_card.dart (89%) rename lib/{ui/views => features/dashboard}/dashboard_view.dart (93%) rename lib/{core/viewmodels => features/dashboard}/dashboard_viewmodel.dart (93%) rename lib/{core/constants => features/dashboard}/progress_bar_text_options.dart (100%) rename lib/{ui => features/dashboard}/widgets/course_activity_tile.dart (100%) rename lib/{ui => features/dashboard}/widgets/haptics_container.dart (100%) rename lib/{core => features/ets/quick-link}/models/quick_link.dart (100%) rename lib/{core => features/ets/quick-link}/models/quick_link_data.dart (100%) rename lib/{core/constants => features/ets/quick-link/models}/quick_links.dart (95%) rename lib/{ui/views => features/ets/quick-link}/quick_links_view.dart (94%) rename lib/{core/viewmodels => features/ets/quick-link}/quick_links_viewmodel.dart (90%) rename lib/{ui/views => features/ets/security-info}/emergency_view.dart (89%) rename lib/{core => features/ets/security-info}/models/emergency_procedure.dart (100%) rename lib/{core/constants => features/ets/security-info/models}/emergency_procedures.dart (95%) rename lib/{ui/views => features/ets/security-info}/security_view.dart (95%) rename lib/{core/viewmodels => features/ets/security-info}/security_viewmodel.dart (87%) rename lib/{core/viewmodels => features/ets}/web_link_card_viewmodel.dart (74%) rename lib/{ui/views => features/more/about}/about_view.dart (98%) rename lib/{ui/views => features/more/contributors}/contributors_view.dart (86%) rename lib/{core/viewmodels => features/more/contributors}/contributors_viewmodel.dart (100%) rename lib/{ui/views => features/more/faq}/faq_view.dart (97%) rename lib/{core/viewmodels => features/more/faq}/faq_viewmodel.dart (78%) rename lib/{core/constants => features/more/faq/models}/faq.dart (95%) rename lib/{core => features/more/faq}/models/faq_actions.dart (100%) rename lib/{core => features/more/faq}/models/faq_questions.dart (100%) rename lib/{core/constants => features/more/feedback}/feedback_type.dart (100%) rename lib/{ui/views => features/more/feedback}/feedback_view.dart (98%) rename lib/{core/viewmodels => features/more/feedback}/feedback_viewmodel.dart (88%) rename lib/{core/services => features/more/feedback}/in_app_review_service.dart (94%) rename lib/{core/constants => features/more/feedback/models}/custom_feedback_localization.dart (100%) rename lib/{core => features/more/feedback}/models/feedback.dart (100%) rename lib/{core => features/more/feedback}/models/feedback_issue.dart (100%) rename lib/{ui => features/more/feedback}/widgets/custom_feedback.dart (94%) rename lib/{ui/views => features/more}/more_view.dart (94%) rename lib/{core/viewmodels => features/more}/more_viewmodel.dart (82%) rename lib/{ui/views => features/more/settings}/choose_language_view.dart (95%) rename lib/{core/viewmodels => features/more/settings}/choose_language_viewmodel.dart (82%) rename lib/{core/managers => features/more/settings}/settings_manager.dart (96%) rename lib/{ui/views => features/more/settings}/settings_view.dart (96%) rename lib/{core/viewmodels => features/more/settings}/settings_viewmodel.dart (92%) rename lib/{core/viewmodels => features/schedule}/schedule_settings_viewmodel.dart (96%) rename lib/{ui/views => features/schedule}/schedule_view.dart (96%) rename lib/{core/viewmodels => features/schedule}/schedule_viewmodel.dart (96%) rename lib/{ui => features/schedule}/widgets/calendar_selector.dart (95%) rename lib/{ui => features/schedule}/widgets/schedule_calendar_tile.dart (100%) rename lib/{ui => features/schedule}/widgets/schedule_settings.dart (98%) rename lib/{ui/views => features/student/grades/grade_details}/grade_details_view.dart (96%) rename lib/{core/viewmodels => features/student/grades/grade_details}/grades_details_viewmodel.dart (85%) rename lib/{ui/views => features/student/grades}/grades_view.dart (90%) rename lib/{core/viewmodels => features/student/grades}/grades_viewmodel.dart (89%) rename lib/{ui/widgets => features/student/grades/schedule_default}/schedule_default.dart (96%) rename lib/{ui/views => features/student/grades/schedule_default}/schedule_default_view.dart (88%) rename lib/{core/viewmodels => features/student/grades/schedule_default}/schedule_default_viewmodel.dart (95%) rename lib/{core/models => features/student/grades}/widget_models.dart (100%) rename lib/{ui => features/student/grades}/widgets/grade_button.dart (89%) rename lib/{ui => features/student/grades}/widgets/grade_circular_progress.dart (98%) rename lib/{ui => features/student/grades}/widgets/grade_evaluation_tile.dart (97%) rename lib/{ui => features/student/grades}/widgets/grade_not_available.dart (96%) rename lib/{ui/views => features/student/profile}/profile_view.dart (96%) rename lib/{core/viewmodels => features/student/profile}/profile_viewmodel.dart (93%) rename lib/{core/constants => features/student/profile}/programs_credits.dart (100%) rename lib/{ui/views => features/student}/student_view.dart (87%) rename lib/{ui => features/student}/widgets/student_program.dart (98%) rename lib/{ui/utils => features/welcome/discovery}/discovery_components.dart (96%) rename lib/{core => features/welcome/discovery}/models/discovery.dart (100%) rename lib/{core/constants => features/welcome/discovery/models}/discovery_ids.dart (100%) rename lib/{core => features/welcome/discovery}/models/group_discovery.dart (70%) rename lib/{core/utils => features/welcome/login}/login_mask.dart (100%) rename lib/{ui/views => features/welcome/login}/login_view.dart (95%) rename lib/{core/viewmodels => features/welcome/login}/login_viewmodel.dart (87%) rename lib/{ui => features/welcome}/widgets/password_text_field.dart (100%) rename lib/{core => }/utils/animation_exception.dart (100%) rename lib/{ui => }/utils/app_theme.dart (100%) rename lib/{core => }/utils/cache_exception.dart (100%) rename lib/{core => }/utils/calendar_utils.dart (100%) rename lib/{ui => }/utils/loading.dart (100%) rename lib/{ => utils}/locator.dart (55%) rename lib/{core => }/utils/utils.dart (100%) diff --git a/.env.template b/.env.template deleted file mode 100644 index b2af0ed5e..000000000 --- a/.env.template +++ /dev/null @@ -1,2 +0,0 @@ -MAPS_API_KEY=XXXXXXXXXXXXXXXXXXX -GH_API_TOKEN=XXXXXXXXXXXXXXXXXXX diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 6e80c4aa0..f5d9d74ba 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -34,7 +34,7 @@ PODS: - Firebase/RemoteConfig (= 10.22.0) - firebase_core - Flutter - - FirebaseABTesting (10.25.0): + - FirebaseABTesting (10.28.0): - FirebaseCore (~> 10.0) - FirebaseAnalytics (10.22.0): - FirebaseAnalytics/AdIdSupport (= 10.22.0) @@ -58,9 +58,9 @@ PODS: - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) - - FirebaseCoreExtension (10.25.0): + - FirebaseCoreExtension (10.28.0): - FirebaseCore (~> 10.0) - - FirebaseCoreInternal (10.25.0): + - FirebaseCoreInternal (10.28.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - FirebaseCrashlytics (10.22.0): - FirebaseCore (~> 10.5) @@ -70,7 +70,7 @@ PODS: - GoogleUtilities/Environment (~> 7.8) - nanopb (< 2.30911.0, >= 2.30908.0) - PromisesObjC (~> 2.1) - - FirebaseInstallations (10.25.0): + - FirebaseInstallations (10.28.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) @@ -82,7 +82,7 @@ PODS: - FirebaseSharedSwift (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseSessions (10.25.0): + - FirebaseSessions (10.28.0): - FirebaseCore (~> 10.5) - FirebaseCoreExtension (~> 10.0) - FirebaseInstallations (~> 10.0) @@ -91,7 +91,7 @@ PODS: - GoogleUtilities/UserDefaults (~> 7.13) - nanopb (< 2.30911.0, >= 2.30908.0) - PromisesSwift (~> 2.1) - - FirebaseSharedSwift (10.25.0) + - FirebaseSharedSwift (10.28.0) - Flutter (1.0.0) - flutter_config (0.0.1): - Flutter @@ -308,16 +308,16 @@ SPEC CHECKSUMS: firebase_core: 100945864b4aedce3cfef0c62ab864858bf013cf firebase_crashlytics: 2b9ca6246501a03427eb43280be7615027e32142 firebase_remote_config: 5ebb1bf2503404f6b24e64f117dc6c22c0498d4c - FirebaseABTesting: e6e3c3e0e35813874f571d1b7bdae2aab319dd38 + FirebaseABTesting: 589bc28c0ab3e5554336895a34aa262e24276665 FirebaseAnalytics: 8d0ff929c63b7f72260f332b86ccf569776b75d3 FirebaseCore: 0326ec9b05fbed8f8716cddbf0e36894a13837f7 - FirebaseCoreExtension: 8a47811d0b155501559ef05d089518152a0a1677 - FirebaseCoreInternal: 910a81992c33715fec9263ca7381d59ab3a750b7 + FirebaseCoreExtension: f63147b723e2a700fe0f34ec6fb7f358d6fe83e0 + FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698 FirebaseCrashlytics: e568d68ce89117c80cddb04073ab9018725fbb8c - FirebaseInstallations: 91950fe859846fff0fbd296180909dd273103b09 + FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e FirebaseRemoteConfig: e1b992a94d3674dddbcaf5d0d31a0312156ceb1c - FirebaseSessions: c0939656253a1fa0e94ecc266ccf770cc8b33732 - FirebaseSharedSwift: 0274086954b1b2d5fd7e829eccc587044d72a4ba + FirebaseSessions: 20da8500ad66bb12622743e170459bf62a0768e8 + FirebaseSharedSwift: 48de4aec81a6b79bb30404e5e6db43ea74848fed Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_config: f48f0d47a284f1791aacce2687eabb3309ba7a41 flutter_custom_tabs_ios: 62439c843b2691aae516fd50119a01eb9755fff7 diff --git a/lib/core/constants/app_info.dart b/lib/constants/app_info.dart similarity index 100% rename from lib/core/constants/app_info.dart rename to lib/constants/app_info.dart diff --git a/lib/core/constants/markers.dart b/lib/constants/markers.dart similarity index 100% rename from lib/core/constants/markers.dart rename to lib/constants/markers.dart diff --git a/lib/core/constants/preferences_flags.dart b/lib/constants/preferences_flags.dart similarity index 100% rename from lib/core/constants/preferences_flags.dart rename to lib/constants/preferences_flags.dart diff --git a/lib/core/constants/update_code.dart b/lib/constants/update_code.dart similarity index 100% rename from lib/core/constants/update_code.dart rename to lib/constants/update_code.dart diff --git a/lib/core/constants/urls.dart b/lib/constants/urls.dart similarity index 100% rename from lib/core/constants/urls.dart rename to lib/constants/urls.dart diff --git a/lib/core/constants/widget_helper.dart b/lib/constants/widget_helper.dart similarity index 100% rename from lib/core/constants/widget_helper.dart rename to lib/constants/widget_helper.dart diff --git a/lib/core/services/analytics_service.dart b/lib/features/app/analytics/analytics_service.dart similarity index 100% rename from lib/core/services/analytics_service.dart rename to lib/features/app/analytics/analytics_service.dart diff --git a/lib/core/services/remote_config_service.dart b/lib/features/app/analytics/remote_config_service.dart similarity index 96% rename from lib/core/services/remote_config_service.dart rename to lib/features/app/analytics/remote_config_service.dart index b7bd0c698..82b3df0c1 100644 --- a/lib/core/services/remote_config_service.dart +++ b/lib/features/app/analytics/remote_config_service.dart @@ -4,8 +4,8 @@ import 'package:firebase_remote_config/firebase_remote_config.dart'; // Project imports: -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/utils/locator.dart'; //OTHERS diff --git a/lib/core/services/internal_info_service.dart b/lib/features/app/error/internal_info_service.dart similarity index 92% rename from lib/core/services/internal_info_service.dart rename to lib/features/app/error/internal_info_service.dart index d5ecbfe79..e870e564f 100644 --- a/lib/core/services/internal_info_service.dart +++ b/lib/features/app/error/internal_info_service.dart @@ -6,8 +6,8 @@ import 'package:device_info_plus/device_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart'; // Project imports: -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/utils/locator.dart'; // UTILS diff --git a/lib/ui/views/not_found_view.dart b/lib/features/app/error/not_found/not_found_view.dart similarity index 96% rename from lib/ui/views/not_found_view.dart rename to lib/features/app/error/not_found/not_found_view.dart index 6e2a6da09..a1af84d8a 100644 --- a/lib/ui/views/not_found_view.dart +++ b/lib/features/app/error/not_found/not_found_view.dart @@ -7,8 +7,8 @@ import 'package:rive/rive.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/viewmodels/not_found_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/features/app/error/not_found/not_found_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; class NotFoundView extends StatefulWidget { final String? pageName; diff --git a/lib/core/viewmodels/not_found_viewmodel.dart b/lib/features/app/error/not_found/not_found_viewmodel.dart similarity index 83% rename from lib/core/viewmodels/not_found_viewmodel.dart rename to lib/features/app/error/not_found/not_found_viewmodel.dart index 98dc1c958..31da02cef 100644 --- a/lib/core/viewmodels/not_found_viewmodel.dart +++ b/lib/features/app/error/not_found/not_found_viewmodel.dart @@ -3,11 +3,11 @@ import 'package:rive/rive.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/rive_animation_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/presentation/rive_animation_service.dart'; +import 'package:notredame/utils/locator.dart'; class NotFoundViewModel extends BaseViewModel { static const String tag = "NotFoundViewModel"; diff --git a/lib/ui/views/outage_view.dart b/lib/features/app/error/outage/outage_view.dart similarity index 96% rename from lib/ui/views/outage_view.dart rename to lib/features/app/error/outage/outage_view.dart index 6345b6e38..0f500e219 100644 --- a/lib/ui/views/outage_view.dart +++ b/lib/features/app/error/outage/outage_view.dart @@ -7,10 +7,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/urls.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/outage_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/constants/urls.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/app/error/outage/outage_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; class OutageView extends StatelessWidget { @override diff --git a/lib/core/viewmodels/outage_viewmodel.dart b/lib/features/app/error/outage/outage_viewmodel.dart similarity index 81% rename from lib/core/viewmodels/outage_viewmodel.dart rename to lib/features/app/error/outage/outage_viewmodel.dart index aadd05e1d..27b42310d 100644 --- a/lib/core/viewmodels/outage_viewmodel.dart +++ b/lib/features/app/error/outage/outage_viewmodel.dart @@ -5,11 +5,11 @@ import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/views/startup_view.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/features/app/startup/startup_view.dart'; class OutageViewModel extends BaseViewModel { int _lastTap = DateTime.now().millisecondsSinceEpoch; diff --git a/lib/firebase_options.dart b/lib/features/app/integration/firebase_options.dart similarity index 100% rename from lib/firebase_options.dart rename to lib/features/app/integration/firebase_options.dart diff --git a/lib/core/services/github_api.dart b/lib/features/app/integration/github_api.dart similarity index 94% rename from lib/core/services/github_api.dart rename to lib/features/app/integration/github_api.dart index 2e5ebf4e0..5adf6817c 100644 --- a/lib/core/services/github_api.dart +++ b/lib/features/app/integration/github_api.dart @@ -14,10 +14,10 @@ import 'package:package_info_plus/package_info_plus.dart'; import 'package:path_provider/path_provider.dart'; // Project imports: -import 'package:notredame/core/models/feedback_issue.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/internal_info_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/more/feedback/models/feedback_issue.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/error/internal_info_service.dart'; +import 'package:notredame/utils/locator.dart'; class GithubApi { static const String tag = "GithubApi"; diff --git a/lib/core/services/launch_url_service.dart b/lib/features/app/integration/launch_url_service.dart similarity index 94% rename from lib/core/services/launch_url_service.dart rename to lib/features/app/integration/launch_url_service.dart index 1cc9a717b..b5934ddd4 100644 --- a/lib/core/services/launch_url_service.dart +++ b/lib/features/app/integration/launch_url_service.dart @@ -6,9 +6,9 @@ import 'package:flutter_custom_tabs/flutter_custom_tabs.dart' as custom_tabs; import 'package:url_launcher/url_launcher.dart' as url_launch; // Project imports: -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; // Managers diff --git a/lib/core/services/networking_service.dart b/lib/features/app/integration/networking_service.dart similarity index 100% rename from lib/core/services/networking_service.dart rename to lib/features/app/integration/networking_service.dart diff --git a/lib/core/services/navigation_service.dart b/lib/features/app/navigation/navigation_service.dart similarity index 89% rename from lib/core/services/navigation_service.dart rename to lib/features/app/navigation/navigation_service.dart index 90954dbd5..7757080d6 100644 --- a/lib/core/services/navigation_service.dart +++ b/lib/features/app/navigation/navigation_service.dart @@ -2,10 +2,10 @@ import 'package:flutter/material.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/utils/locator.dart'; //SERVICE diff --git a/lib/ui/router.dart b/lib/features/app/navigation/router.dart similarity index 74% rename from lib/ui/router.dart rename to lib/features/app/navigation/router.dart index cb324c198..ce1853cfd 100644 --- a/lib/ui/router.dart +++ b/lib/features/app/navigation/router.dart @@ -5,28 +5,28 @@ import 'package:flutter/material.dart'; import 'package:ets_api_clients/models.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/constants/update_code.dart'; -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/ui/views/about_view.dart'; -import 'package:notredame/ui/views/choose_language_view.dart'; -import 'package:notredame/ui/views/contributors_view.dart'; -import 'package:notredame/ui/views/dashboard_view.dart'; -import 'package:notredame/ui/views/faq_view.dart'; -import 'package:notredame/ui/views/feedback_view.dart'; -import 'package:notredame/ui/views/grade_details_view.dart'; -import 'package:notredame/ui/views/login_view.dart'; -import 'package:notredame/ui/views/more_view.dart'; -import 'package:notredame/ui/views/not_found_view.dart'; -import 'package:notredame/ui/views/outage_view.dart'; -import 'package:notredame/ui/views/quick_links_view.dart'; -import 'package:notredame/ui/views/schedule_default_view.dart'; -import 'package:notredame/ui/views/schedule_view.dart'; -import 'package:notredame/ui/views/security_view.dart'; -import 'package:notredame/ui/views/settings_view.dart'; -import 'package:notredame/ui/views/startup_view.dart'; -import 'package:notredame/ui/views/student_view.dart'; -import 'package:notredame/ui/widgets/link_web_view.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/constants/update_code.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/more/about/about_view.dart'; +import 'package:notredame/features/more/settings/choose_language_view.dart'; +import 'package:notredame/features/more/contributors/contributors_view.dart'; +import 'package:notredame/features/dashboard/dashboard_view.dart'; +import 'package:notredame/features/more/faq/faq_view.dart'; +import 'package:notredame/features/more/feedback/feedback_view.dart'; +import 'package:notredame/features/student/grades/grade_details/grade_details_view.dart'; +import 'package:notredame/features/welcome/login/login_view.dart'; +import 'package:notredame/features/more/more_view.dart'; +import 'package:notredame/features/app/error/not_found/not_found_view.dart'; +import 'package:notredame/features/app/error/outage/outage_view.dart'; +import 'package:notredame/features/ets/quick-link/quick_links_view.dart'; +import 'package:notredame/features/student/grades/schedule_default/schedule_default_view.dart'; +import 'package:notredame/features/schedule/schedule_view.dart'; +import 'package:notredame/features/ets/security-info/security_view.dart'; +import 'package:notredame/features/more/settings/settings_view.dart'; +import 'package:notredame/features/app/startup/startup_view.dart'; +import 'package:notredame/features/student/student_view.dart'; +import 'package:notredame/features/app/widgets/link_web_view.dart'; Route generateRoute(RouteSettings routeSettings) { switch (routeSettings.name) { diff --git a/lib/core/constants/router_paths.dart b/lib/features/app/navigation/router_paths.dart similarity index 100% rename from lib/core/constants/router_paths.dart rename to lib/features/app/navigation/router_paths.dart diff --git a/lib/core/services/rive_animation_service.dart b/lib/features/app/presentation/rive_animation_service.dart similarity index 95% rename from lib/core/services/rive_animation_service.dart rename to lib/features/app/presentation/rive_animation_service.dart index 4a8079620..ff9df266b 100644 --- a/lib/core/services/rive_animation_service.dart +++ b/lib/features/app/presentation/rive_animation_service.dart @@ -5,7 +5,7 @@ import 'package:flutter/services.dart'; import 'package:rive/rive.dart'; // Project imports: -import 'package:notredame/core/utils/animation_exception.dart'; +import 'package:notredame/utils/animation_exception.dart'; /// Manage the rive animation for the application class RiveAnimationService { diff --git a/lib/core/extensions/webview_controller_extension.dart b/lib/features/app/presentation/webview_controller_extension.dart similarity index 100% rename from lib/core/extensions/webview_controller_extension.dart rename to lib/features/app/presentation/webview_controller_extension.dart diff --git a/lib/core/managers/course_repository.dart b/lib/features/app/repository/course_repository.dart similarity index 98% rename from lib/core/managers/course_repository.dart rename to lib/features/app/repository/course_repository.dart index 66455f813..6f00165fc 100644 --- a/lib/core/managers/course_repository.dart +++ b/lib/features/app/repository/course_repository.dart @@ -11,12 +11,12 @@ import 'package:ets_api_clients/models.dart'; import 'package:logger/logger.dart'; // Project imports: -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/core/utils/cache_exception.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/utils/cache_exception.dart'; +import 'package:notredame/utils/locator.dart'; /// Repository to access all the data related to courses taken by the student class CourseRepository { diff --git a/lib/core/managers/quick_link_repository.dart b/lib/features/app/repository/quick_link_repository.dart similarity index 75% rename from lib/core/managers/quick_link_repository.dart rename to lib/features/app/repository/quick_link_repository.dart index 3bc2392c5..ca6142571 100644 --- a/lib/core/managers/quick_link_repository.dart +++ b/lib/features/app/repository/quick_link_repository.dart @@ -5,11 +5,11 @@ import 'dart:convert'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/core/constants/quick_links.dart'; -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/models/quick_link_data.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_links.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link_data.dart'; +import 'package:notredame/utils/locator.dart'; class QuickLinkRepository { final CacheManager _cacheManager = locator(); diff --git a/lib/core/managers/user_repository.dart b/lib/features/app/repository/user_repository.dart similarity index 97% rename from lib/core/managers/user_repository.dart rename to lib/features/app/repository/user_repository.dart index 043313f1c..3e5506f3f 100644 --- a/lib/core/managers/user_repository.dart +++ b/lib/features/app/repository/user_repository.dart @@ -13,11 +13,11 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:logger/logger.dart'; // Project imports: -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/core/utils/cache_exception.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/utils/cache_exception.dart'; +import 'package:notredame/utils/locator.dart'; class UserRepository { static const String tag = "UserRepository"; diff --git a/lib/ui/views/startup_view.dart b/lib/features/app/startup/startup_view.dart similarity index 92% rename from lib/ui/views/startup_view.dart rename to lib/features/app/startup/startup_view.dart index ec243d0e2..cddd2de22 100644 --- a/lib/ui/views/startup_view.dart +++ b/lib/features/app/startup/startup_view.dart @@ -6,9 +6,9 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/startup_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/app/startup/startup_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; class StartUpView extends StatelessWidget { @override diff --git a/lib/core/viewmodels/startup_viewmodel.dart b/lib/features/app/startup/startup_viewmodel.dart similarity index 86% rename from lib/core/viewmodels/startup_viewmodel.dart rename to lib/features/app/startup/startup_viewmodel.dart index 38497eca8..33d50bccc 100644 --- a/lib/core/viewmodels/startup_viewmodel.dart +++ b/lib/features/app/startup/startup_viewmodel.dart @@ -2,18 +2,18 @@ import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/constants/update_code.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/internal_info_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/services/siren_flutter_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/constants/update_code.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/error/internal_info_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/features/app/storage/siren_flutter_service.dart'; +import 'package:notredame/utils/locator.dart'; class StartUpViewModel extends BaseViewModel { /// Manage the settings diff --git a/lib/core/managers/cache_manager.dart b/lib/features/app/storage/cache_manager.dart similarity index 92% rename from lib/core/managers/cache_manager.dart rename to lib/features/app/storage/cache_manager.dart index 438fd203c..0c533b316 100644 --- a/lib/core/managers/cache_manager.dart +++ b/lib/features/app/storage/cache_manager.dart @@ -5,9 +5,9 @@ import 'dart:convert'; import 'package:flutter_cache_manager/flutter_cache_manager.dart' as lib; // Project imports: -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/utils/cache_exception.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/utils/cache_exception.dart'; +import 'package:notredame/utils/locator.dart'; /// Abstraction of the cache management system. class CacheManager { diff --git a/lib/core/services/preferences_service.dart b/lib/features/app/storage/preferences_service.dart similarity index 98% rename from lib/core/services/preferences_service.dart rename to lib/features/app/storage/preferences_service.dart index a488b5eea..10f1c57f4 100644 --- a/lib/core/services/preferences_service.dart +++ b/lib/features/app/storage/preferences_service.dart @@ -4,7 +4,7 @@ import 'package:shared_preferences/shared_preferences.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; +import 'package:notredame/constants/preferences_flags.dart'; // CONSTANT diff --git a/lib/core/services/siren_flutter_service.dart b/lib/features/app/storage/siren_flutter_service.dart similarity index 100% rename from lib/core/services/siren_flutter_service.dart rename to lib/features/app/storage/siren_flutter_service.dart diff --git a/lib/core/services/app_widget_service.dart b/lib/features/app/widgets/app_widget_service.dart similarity index 91% rename from lib/core/services/app_widget_service.dart rename to lib/features/app/widgets/app_widget_service.dart index 9c5725f16..d5d586340 100644 --- a/lib/core/services/app_widget_service.dart +++ b/lib/features/app/widgets/app_widget_service.dart @@ -5,10 +5,10 @@ import 'package:flutter/services.dart'; import 'package:home_widget/home_widget.dart'; // Project imports: -import 'package:notredame/core/constants/widget_helper.dart'; -import 'package:notredame/core/models/widget_models.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/constants/widget_helper.dart'; +import 'package:notredame/features/student/grades/widget_models.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/utils/locator.dart'; // MODEL diff --git a/lib/ui/widgets/base_scaffold.dart b/lib/features/app/widgets/base_scaffold.dart similarity index 91% rename from lib/ui/widgets/base_scaffold.dart rename to lib/features/app/widgets/base_scaffold.dart index 7f4021c84..603c654b8 100644 --- a/lib/ui/widgets/base_scaffold.dart +++ b/lib/features/app/widgets/base_scaffold.dart @@ -9,12 +9,12 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/loading.dart'; -import 'package:notredame/ui/widgets/bottom_bar.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/utils/loading.dart'; +import 'package:notredame/features/app/widgets/bottom_bar.dart'; /// Basic Scaffold to avoid boilerplate code in the application. /// Contains a loader controlled by [_isLoading] diff --git a/lib/ui/widgets/bottom_bar.dart b/lib/features/app/widgets/bottom_bar.dart similarity index 90% rename from lib/ui/widgets/bottom_bar.dart rename to lib/features/app/widgets/bottom_bar.dart index 1bd5ff55f..6cba7da58 100644 --- a/lib/ui/widgets/bottom_bar.dart +++ b/lib/features/app/widgets/bottom_bar.dart @@ -6,13 +6,13 @@ import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; /// Bottom navigation bar for the application. class BottomBar extends StatefulWidget { diff --git a/lib/ui/widgets/dismissible_card.dart b/lib/features/app/widgets/dismissible_card.dart similarity index 100% rename from lib/ui/widgets/dismissible_card.dart rename to lib/features/app/widgets/dismissible_card.dart diff --git a/lib/ui/widgets/link_web_view.dart b/lib/features/app/widgets/link_web_view.dart similarity index 88% rename from lib/ui/widgets/link_web_view.dart rename to lib/features/app/widgets/link_web_view.dart index 5f40d0fb8..12d9c6668 100644 --- a/lib/ui/widgets/link_web_view.dart +++ b/lib/features/app/widgets/link_web_view.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; // Project imports: -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; class LinkWebView extends StatefulWidget { final QuickLink _links; diff --git a/lib/ui/widgets/web_link_card.dart b/lib/features/app/widgets/web_link_card.dart similarity index 89% rename from lib/ui/widgets/web_link_card.dart rename to lib/features/app/widgets/web_link_card.dart index 611856e3e..a12dcbefe 100644 --- a/lib/ui/widgets/web_link_card.dart +++ b/lib/features/app/widgets/web_link_card.dart @@ -5,9 +5,9 @@ import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/viewmodels/web_link_card_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/ets/web_link_card_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; class WebLinkCard extends StatelessWidget { final QuickLink _links; diff --git a/lib/ui/views/dashboard_view.dart b/lib/features/dashboard/dashboard_view.dart similarity index 93% rename from lib/ui/views/dashboard_view.dart rename to lib/features/dashboard/dashboard_view.dart index 3c89fa275..782c44e41 100644 --- a/lib/ui/views/dashboard_view.dart +++ b/lib/features/dashboard/dashboard_view.dart @@ -11,25 +11,25 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/progress_bar_text_options.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/constants/update_code.dart'; -import 'package:notredame/core/constants/urls.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/dashboard_viewmodel.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; -import 'package:notredame/ui/utils/loading.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; -import 'package:notredame/ui/widgets/course_activity_tile.dart'; -import 'package:notredame/ui/widgets/dismissible_card.dart'; -import 'package:notredame/ui/widgets/grade_button.dart'; -import 'package:notredame/ui/widgets/haptics_container.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/dashboard/progress_bar_text_options.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/constants/update_code.dart'; +import 'package:notredame/constants/urls.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/dashboard/dashboard_viewmodel.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; +import 'package:notredame/utils/loading.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; +import 'package:notredame/features/dashboard/widgets/course_activity_tile.dart'; +import 'package:notredame/features/app/widgets/dismissible_card.dart'; +import 'package:notredame/features/student/grades/widgets/grade_button.dart'; +import 'package:notredame/features/dashboard/widgets/haptics_container.dart'; class DashboardView extends StatefulWidget { final UpdateCode updateCode; diff --git a/lib/core/viewmodels/dashboard_viewmodel.dart b/lib/features/dashboard/dashboard_viewmodel.dart similarity index 93% rename from lib/core/viewmodels/dashboard_viewmodel.dart rename to lib/features/dashboard/dashboard_viewmodel.dart index 796c31a87..b378cfdb6 100644 --- a/lib/core/viewmodels/dashboard_viewmodel.dart +++ b/lib/features/dashboard/dashboard_viewmodel.dart @@ -12,25 +12,25 @@ import 'package:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/progress_bar_text_options.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/constants/update_code.dart'; -import 'package:notredame/core/constants/widget_helper.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/models/widget_models.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/app_widget_service.dart'; -import 'package:notredame/core/services/in_app_review_service.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/core/services/siren_flutter_service.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/dashboard/progress_bar_text_options.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/constants/update_code.dart'; +import 'package:notredame/constants/widget_helper.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/student/grades/widget_models.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/widgets/app_widget_service.dart'; +import 'package:notredame/features/more/feedback/in_app_review_service.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/features/app/storage/siren_flutter_service.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; class DashboardViewModel extends FutureViewModel> { static const String tag = "DashboardViewModel"; diff --git a/lib/core/constants/progress_bar_text_options.dart b/lib/features/dashboard/progress_bar_text_options.dart similarity index 100% rename from lib/core/constants/progress_bar_text_options.dart rename to lib/features/dashboard/progress_bar_text_options.dart diff --git a/lib/ui/widgets/course_activity_tile.dart b/lib/features/dashboard/widgets/course_activity_tile.dart similarity index 100% rename from lib/ui/widgets/course_activity_tile.dart rename to lib/features/dashboard/widgets/course_activity_tile.dart diff --git a/lib/ui/widgets/haptics_container.dart b/lib/features/dashboard/widgets/haptics_container.dart similarity index 100% rename from lib/ui/widgets/haptics_container.dart rename to lib/features/dashboard/widgets/haptics_container.dart diff --git a/lib/core/models/quick_link.dart b/lib/features/ets/quick-link/models/quick_link.dart similarity index 100% rename from lib/core/models/quick_link.dart rename to lib/features/ets/quick-link/models/quick_link.dart diff --git a/lib/core/models/quick_link_data.dart b/lib/features/ets/quick-link/models/quick_link_data.dart similarity index 100% rename from lib/core/models/quick_link_data.dart rename to lib/features/ets/quick-link/models/quick_link_data.dart diff --git a/lib/core/constants/quick_links.dart b/lib/features/ets/quick-link/models/quick_links.dart similarity index 95% rename from lib/core/constants/quick_links.dart rename to lib/features/ets/quick-link/models/quick_links.dart index b14e4e108..25baa8a40 100644 --- a/lib/core/constants/quick_links.dart +++ b/lib/features/ets/quick-link/models/quick_links.dart @@ -8,8 +8,8 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; // Project imports: -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/utils/app_theme.dart'; List quickLinks(AppIntl intl) => [ QuickLink( diff --git a/lib/ui/views/quick_links_view.dart b/lib/features/ets/quick-link/quick_links_view.dart similarity index 94% rename from lib/ui/views/quick_links_view.dart rename to lib/features/ets/quick-link/quick_links_view.dart index f75541930..7946a64d0 100644 --- a/lib/ui/views/quick_links_view.dart +++ b/lib/features/ets/quick-link/quick_links_view.dart @@ -7,11 +7,11 @@ import 'package:reorderable_grid_view/reorderable_grid_view.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/viewmodels/quick_links_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; -import 'package:notredame/ui/widgets/web_link_card.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/ets/quick-link/quick_links_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; +import 'package:notredame/features/app/widgets/web_link_card.dart'; class QuickLinksView extends StatefulWidget { @override diff --git a/lib/core/viewmodels/quick_links_viewmodel.dart b/lib/features/ets/quick-link/quick_links_viewmodel.dart similarity index 90% rename from lib/core/viewmodels/quick_links_viewmodel.dart rename to lib/features/ets/quick-link/quick_links_viewmodel.dart index dfb2f6524..607177c27 100644 --- a/lib/core/viewmodels/quick_links_viewmodel.dart +++ b/lib/features/ets/quick-link/quick_links_viewmodel.dart @@ -3,10 +3,10 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/managers/quick_link_repository.dart'; -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/models/quick_link_data.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/repository/quick_link_repository.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link_data.dart'; +import 'package:notredame/utils/locator.dart'; class QuickLinksViewModel extends FutureViewModel> { /// Localization class of the application. diff --git a/lib/ui/views/emergency_view.dart b/lib/features/ets/security-info/emergency_view.dart similarity index 89% rename from lib/ui/views/emergency_view.dart rename to lib/features/ets/security-info/emergency_view.dart index 13207b914..eb4143221 100644 --- a/lib/ui/views/emergency_view.dart +++ b/lib/features/ets/security-info/emergency_view.dart @@ -6,9 +6,9 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:webview_flutter/webview_flutter.dart'; // Project imports: -import 'package:notredame/core/extensions/webview_controller_extension.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/features/app/presentation/webview_controller_extension.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/utils/app_theme.dart'; class EmergencyView extends StatefulWidget { final String title; diff --git a/lib/core/models/emergency_procedure.dart b/lib/features/ets/security-info/models/emergency_procedure.dart similarity index 100% rename from lib/core/models/emergency_procedure.dart rename to lib/features/ets/security-info/models/emergency_procedure.dart diff --git a/lib/core/constants/emergency_procedures.dart b/lib/features/ets/security-info/models/emergency_procedures.dart similarity index 95% rename from lib/core/constants/emergency_procedures.dart rename to lib/features/ets/security-info/models/emergency_procedures.dart index 3508f29d9..1e84c6afe 100644 --- a/lib/core/constants/emergency_procedures.dart +++ b/lib/features/ets/security-info/models/emergency_procedures.dart @@ -2,7 +2,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/core/models/emergency_procedure.dart'; +import 'package:notredame/features/ets/security-info/models/emergency_procedure.dart'; List emergencyProcedures(AppIntl intl) => [ EmergencyProcedure( diff --git a/lib/ui/views/security_view.dart b/lib/features/ets/security-info/security_view.dart similarity index 95% rename from lib/ui/views/security_view.dart rename to lib/features/ets/security-info/security_view.dart index 8f4f4d4a5..96600b5be 100644 --- a/lib/ui/views/security_view.dart +++ b/lib/features/ets/security-info/security_view.dart @@ -9,10 +9,10 @@ import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/security_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/views/emergency_view.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/ets/security-info/security_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/ets/security-info/emergency_view.dart'; class SecurityView extends StatefulWidget { @override diff --git a/lib/core/viewmodels/security_viewmodel.dart b/lib/features/ets/security-info/security_viewmodel.dart similarity index 87% rename from lib/core/viewmodels/security_viewmodel.dart rename to lib/features/ets/security-info/security_viewmodel.dart index dcc01a45f..5eea92d7b 100644 --- a/lib/core/viewmodels/security_viewmodel.dart +++ b/lib/features/ets/security-info/security_viewmodel.dart @@ -8,9 +8,9 @@ import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/emergency_procedures.dart'; -import 'package:notredame/core/constants/markers.dart'; -import 'package:notredame/core/models/emergency_procedure.dart'; +import 'package:notredame/features/ets/security-info/models/emergency_procedures.dart'; +import 'package:notredame/constants/markers.dart'; +import 'package:notredame/features/ets/security-info/models/emergency_procedure.dart'; class SecurityViewModel extends BaseViewModel { GoogleMapController? controller; diff --git a/lib/core/viewmodels/web_link_card_viewmodel.dart b/lib/features/ets/web_link_card_viewmodel.dart similarity index 74% rename from lib/core/viewmodels/web_link_card_viewmodel.dart rename to lib/features/ets/web_link_card_viewmodel.dart index b61cef761..1b8bff47b 100644 --- a/lib/core/viewmodels/web_link_card_viewmodel.dart +++ b/lib/features/ets/web_link_card_viewmodel.dart @@ -6,12 +6,12 @@ import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/utils/locator.dart'; class WebLinkCardViewModel extends BaseViewModel { /// used to redirect on the security. diff --git a/lib/ui/views/about_view.dart b/lib/features/more/about/about_view.dart similarity index 98% rename from lib/ui/views/about_view.dart rename to lib/features/more/about/about_view.dart index 1699400a6..54183a454 100644 --- a/lib/ui/views/about_view.dart +++ b/lib/features/more/about/about_view.dart @@ -7,8 +7,8 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; // Project imports: -import 'package:notredame/core/constants/urls.dart'; -import 'package:notredame/core/utils/utils.dart'; +import 'package:notredame/constants/urls.dart'; +import 'package:notredame/utils/utils.dart'; class AboutView extends StatefulWidget { @override diff --git a/lib/ui/views/contributors_view.dart b/lib/features/more/contributors/contributors_view.dart similarity index 86% rename from lib/ui/views/contributors_view.dart rename to lib/features/more/contributors/contributors_view.dart index 1fcca95d5..674095632 100644 --- a/lib/ui/views/contributors_view.dart +++ b/lib/features/more/contributors/contributors_view.dart @@ -7,10 +7,10 @@ import 'package:github/github.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/contributors_viewmodel.dart'; -import 'package:notredame/ui/utils/loading.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/more/contributors/contributors_viewmodel.dart'; +import 'package:notredame/utils/loading.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; class ContributorsView extends StatelessWidget { @override diff --git a/lib/core/viewmodels/contributors_viewmodel.dart b/lib/features/more/contributors/contributors_viewmodel.dart similarity index 100% rename from lib/core/viewmodels/contributors_viewmodel.dart rename to lib/features/more/contributors/contributors_viewmodel.dart diff --git a/lib/ui/views/faq_view.dart b/lib/features/more/faq/faq_view.dart similarity index 97% rename from lib/ui/views/faq_view.dart rename to lib/features/more/faq/faq_view.dart index 8c6e3f6ba..cdbd740da 100644 --- a/lib/ui/views/faq_view.dart +++ b/lib/features/more/faq/faq_view.dart @@ -7,9 +7,9 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/faq.dart'; -import 'package:notredame/core/models/faq_actions.dart'; -import 'package:notredame/core/viewmodels/faq_viewmodel.dart'; +import 'package:notredame/features/more/faq/models/faq.dart'; +import 'package:notredame/features/more/faq/models/faq_actions.dart'; +import 'package:notredame/features/more/faq/faq_viewmodel.dart'; class FaqView extends StatefulWidget { final Color? backgroundColor; diff --git a/lib/core/viewmodels/faq_viewmodel.dart b/lib/features/more/faq/faq_viewmodel.dart similarity index 78% rename from lib/core/viewmodels/faq_viewmodel.dart rename to lib/features/more/faq/faq_viewmodel.dart index e82e8275c..71e2f7821 100644 --- a/lib/core/viewmodels/faq_viewmodel.dart +++ b/lib/features/more/faq/faq_viewmodel.dart @@ -6,11 +6,11 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/app_info.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/constants/app_info.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/utils/locator.dart'; class FaqViewModel extends BaseViewModel { final SettingsManager _settingsManager = locator(); diff --git a/lib/core/constants/faq.dart b/lib/features/more/faq/models/faq.dart similarity index 95% rename from lib/core/constants/faq.dart rename to lib/features/more/faq/models/faq.dart index 0b4272ead..5e98b3076 100644 --- a/lib/core/constants/faq.dart +++ b/lib/features/more/faq/models/faq.dart @@ -2,9 +2,9 @@ import 'package:flutter/material.dart'; // Project imports: -import 'package:notredame/core/constants/app_info.dart'; -import 'package:notredame/core/models/faq_actions.dart'; -import 'package:notredame/core/models/faq_questions.dart'; +import 'package:notredame/constants/app_info.dart'; +import 'package:notredame/features/more/faq/models/faq_actions.dart'; +import 'package:notredame/features/more/faq/models/faq_questions.dart'; class Faq { List questions = [ diff --git a/lib/core/models/faq_actions.dart b/lib/features/more/faq/models/faq_actions.dart similarity index 100% rename from lib/core/models/faq_actions.dart rename to lib/features/more/faq/models/faq_actions.dart diff --git a/lib/core/models/faq_questions.dart b/lib/features/more/faq/models/faq_questions.dart similarity index 100% rename from lib/core/models/faq_questions.dart rename to lib/features/more/faq/models/faq_questions.dart diff --git a/lib/core/constants/feedback_type.dart b/lib/features/more/feedback/feedback_type.dart similarity index 100% rename from lib/core/constants/feedback_type.dart rename to lib/features/more/feedback/feedback_type.dart diff --git a/lib/ui/views/feedback_view.dart b/lib/features/more/feedback/feedback_view.dart similarity index 98% rename from lib/ui/views/feedback_view.dart rename to lib/features/more/feedback/feedback_view.dart index a65af5c16..f4298028f 100644 --- a/lib/ui/views/feedback_view.dart +++ b/lib/features/more/feedback/feedback_view.dart @@ -7,11 +7,11 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/feedback_type.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/feedback_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/loading.dart'; +import 'package:notredame/features/more/feedback/feedback_type.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/more/feedback/feedback_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/utils/loading.dart'; class FeedbackView extends StatefulWidget { @override diff --git a/lib/core/viewmodels/feedback_viewmodel.dart b/lib/features/more/feedback/feedback_viewmodel.dart similarity index 88% rename from lib/core/viewmodels/feedback_viewmodel.dart rename to lib/features/more/feedback/feedback_viewmodel.dart index 02f650041..2f57cf068 100644 --- a/lib/core/viewmodels/feedback_viewmodel.dart +++ b/lib/features/more/feedback/feedback_viewmodel.dart @@ -1,4 +1,5 @@ // Dart imports: +// Dart imports: import 'dart:io'; import 'dart:typed_data'; @@ -11,12 +12,12 @@ import 'package:image/image.dart' as image; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/feedback_type.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/models/feedback_issue.dart'; -import 'package:notredame/core/services/github_api.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/more/feedback/feedback_type.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/more/feedback/models/feedback_issue.dart'; +import 'package:notredame/features/app/integration/github_api.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/utils/locator.dart'; class FeedbackViewModel extends FutureViewModel { /// Used to access Github functionalities diff --git a/lib/core/services/in_app_review_service.dart b/lib/features/more/feedback/in_app_review_service.dart similarity index 94% rename from lib/core/services/in_app_review_service.dart rename to lib/features/more/feedback/in_app_review_service.dart index f3da402d3..cd97e2e4c 100644 --- a/lib/core/services/in_app_review_service.dart +++ b/lib/features/more/feedback/in_app_review_service.dart @@ -2,7 +2,7 @@ import 'package:in_app_review/in_app_review.dart'; // Project imports: -import 'package:notredame/core/constants/app_info.dart'; +import 'package:notredame/constants/app_info.dart'; // CONSTANTS diff --git a/lib/core/constants/custom_feedback_localization.dart b/lib/features/more/feedback/models/custom_feedback_localization.dart similarity index 100% rename from lib/core/constants/custom_feedback_localization.dart rename to lib/features/more/feedback/models/custom_feedback_localization.dart diff --git a/lib/core/models/feedback.dart b/lib/features/more/feedback/models/feedback.dart similarity index 100% rename from lib/core/models/feedback.dart rename to lib/features/more/feedback/models/feedback.dart diff --git a/lib/core/models/feedback_issue.dart b/lib/features/more/feedback/models/feedback_issue.dart similarity index 100% rename from lib/core/models/feedback_issue.dart rename to lib/features/more/feedback/models/feedback_issue.dart diff --git a/lib/ui/widgets/custom_feedback.dart b/lib/features/more/feedback/widgets/custom_feedback.dart similarity index 94% rename from lib/ui/widgets/custom_feedback.dart rename to lib/features/more/feedback/widgets/custom_feedback.dart index a75d57c5b..163f95555 100644 --- a/lib/ui/widgets/custom_feedback.dart +++ b/lib/features/more/feedback/widgets/custom_feedback.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; import 'package:feedback/feedback.dart'; // Project imports: -import 'package:notredame/core/constants/custom_feedback_localization.dart'; -import 'package:notredame/core/models/feedback.dart'; +import 'package:notredame/features/more/feedback/models/custom_feedback_localization.dart'; +import 'package:notredame/features/more/feedback/models/feedback.dart'; /// A form that prompts the user for the type of feedback they want to give and a /// free form text feedback. diff --git a/lib/ui/views/more_view.dart b/lib/features/more/more_view.dart similarity index 94% rename from lib/ui/views/more_view.dart rename to lib/features/more/more_view.dart index 93218f47a..d3acc55d2 100644 --- a/lib/ui/views/more_view.dart +++ b/lib/features/more/more_view.dart @@ -9,15 +9,15 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/more_viewmodel.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/more/more_viewmodel.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; class MoreView extends StatefulWidget { @override diff --git a/lib/core/viewmodels/more_viewmodel.dart b/lib/features/more/more_viewmodel.dart similarity index 82% rename from lib/core/viewmodels/more_viewmodel.dart rename to lib/features/more/more_viewmodel.dart index 6c595dc50..f78f4d5ee 100644 --- a/lib/core/viewmodels/more_viewmodel.dart +++ b/lib/features/more/more_viewmodel.dart @@ -9,20 +9,20 @@ import 'package:package_info_plus/package_info_plus.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/in_app_review_service.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/more/feedback/in_app_review_service.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; class MoreViewModel extends FutureViewModel { /// Cache manager diff --git a/lib/ui/views/choose_language_view.dart b/lib/features/more/settings/choose_language_view.dart similarity index 95% rename from lib/ui/views/choose_language_view.dart rename to lib/features/more/settings/choose_language_view.dart index 40aa840fc..61c640c20 100644 --- a/lib/ui/views/choose_language_view.dart +++ b/lib/features/more/settings/choose_language_view.dart @@ -6,9 +6,9 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/choose_language_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/more/settings/choose_language_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; class ChooseLanguageView extends StatefulWidget { @override diff --git a/lib/core/viewmodels/choose_language_viewmodel.dart b/lib/features/more/settings/choose_language_viewmodel.dart similarity index 82% rename from lib/core/viewmodels/choose_language_viewmodel.dart rename to lib/features/more/settings/choose_language_viewmodel.dart index aac3f0bc7..c0ed74e97 100644 --- a/lib/core/viewmodels/choose_language_viewmodel.dart +++ b/lib/features/more/settings/choose_language_viewmodel.dart @@ -3,10 +3,10 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/utils/locator.dart'; class ChooseLanguageViewModel extends BaseViewModel { static const int english = 0; diff --git a/lib/core/managers/settings_manager.dart b/lib/features/more/settings/settings_manager.dart similarity index 96% rename from lib/core/managers/settings_manager.dart rename to lib/features/more/settings/settings_manager.dart index ca51f1e1c..e8dc53f60 100644 --- a/lib/core/managers/settings_manager.dart +++ b/lib/features/more/settings/settings_manager.dart @@ -10,11 +10,11 @@ import 'package:logger/logger.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/utils/locator.dart'; class SettingsManager with ChangeNotifier { static const String tag = "SettingsManager"; diff --git a/lib/ui/views/settings_view.dart b/lib/features/more/settings/settings_view.dart similarity index 96% rename from lib/ui/views/settings_view.dart rename to lib/features/more/settings/settings_view.dart index 7dd0f6122..470ae4045 100644 --- a/lib/ui/views/settings_view.dart +++ b/lib/features/more/settings/settings_view.dart @@ -6,9 +6,9 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/viewmodels/settings_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; +import 'package:notredame/features/more/settings/settings_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; class SettingsView extends StatefulWidget { @override diff --git a/lib/core/viewmodels/settings_viewmodel.dart b/lib/features/more/settings/settings_viewmodel.dart similarity index 92% rename from lib/core/viewmodels/settings_viewmodel.dart rename to lib/features/more/settings/settings_viewmodel.dart index 6d01fbff1..2d11999e7 100644 --- a/lib/core/viewmodels/settings_viewmodel.dart +++ b/lib/features/more/settings/settings_viewmodel.dart @@ -6,8 +6,8 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/utils/locator.dart'; class SettingsViewModel extends FutureViewModel { /// Manage the settings diff --git a/lib/core/viewmodels/schedule_settings_viewmodel.dart b/lib/features/schedule/schedule_settings_viewmodel.dart similarity index 96% rename from lib/core/viewmodels/schedule_settings_viewmodel.dart rename to lib/features/schedule/schedule_settings_viewmodel.dart index 9f55ac077..74658d188 100644 --- a/lib/core/viewmodels/schedule_settings_viewmodel.dart +++ b/lib/features/schedule/schedule_settings_viewmodel.dart @@ -7,10 +7,10 @@ import 'package:stacked/stacked.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/utils/locator.dart'; class ScheduleSettingsViewModel extends FutureViewModel> { diff --git a/lib/ui/views/schedule_view.dart b/lib/features/schedule/schedule_view.dart similarity index 96% rename from lib/ui/views/schedule_view.dart rename to lib/features/schedule/schedule_view.dart index e1512f502..d6ad9d74e 100644 --- a/lib/ui/views/schedule_view.dart +++ b/lib/features/schedule/schedule_view.dart @@ -9,22 +9,22 @@ import 'package:ets_api_clients/models.dart'; import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:intl/intl.dart'; -import 'package:notredame/ui/widgets/calendar_selector.dart'; +import 'package:notredame/features/schedule/widgets/calendar_selector.dart'; import 'package:stacked/stacked.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/viewmodels/schedule_viewmodel.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; -import 'package:notredame/ui/widgets/course_activity_tile.dart'; -import 'package:notredame/ui/widgets/schedule_calendar_tile.dart'; -import 'package:notredame/ui/widgets/schedule_settings.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/schedule/schedule_viewmodel.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; +import 'package:notredame/features/dashboard/widgets/course_activity_tile.dart'; +import 'package:notredame/features/schedule/widgets/schedule_calendar_tile.dart'; +import 'package:notredame/features/schedule/widgets/schedule_settings.dart'; class ScheduleView extends StatefulWidget { @visibleForTesting diff --git a/lib/core/viewmodels/schedule_viewmodel.dart b/lib/features/schedule/schedule_viewmodel.dart similarity index 96% rename from lib/core/viewmodels/schedule_viewmodel.dart rename to lib/features/schedule/schedule_viewmodel.dart index 5462483e2..0f3ffddf7 100644 --- a/lib/core/viewmodels/schedule_viewmodel.dart +++ b/lib/features/schedule/schedule_viewmodel.dart @@ -13,14 +13,14 @@ import 'package:stacked/stacked.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; class ScheduleViewModel extends FutureViewModel> { /// Load the events diff --git a/lib/ui/widgets/calendar_selector.dart b/lib/features/schedule/widgets/calendar_selector.dart similarity index 95% rename from lib/ui/widgets/calendar_selector.dart rename to lib/features/schedule/widgets/calendar_selector.dart index 0cd63bc58..96470af78 100644 --- a/lib/ui/widgets/calendar_selector.dart +++ b/lib/features/schedule/widgets/calendar_selector.dart @@ -5,10 +5,10 @@ import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/utils/calendar_utils.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/utils/calendar_utils.dart'; +import 'package:notredame/utils/locator.dart'; class CalendarSelectionWidget extends StatelessWidget { final AppIntl translations; diff --git a/lib/ui/widgets/schedule_calendar_tile.dart b/lib/features/schedule/widgets/schedule_calendar_tile.dart similarity index 100% rename from lib/ui/widgets/schedule_calendar_tile.dart rename to lib/features/schedule/widgets/schedule_calendar_tile.dart diff --git a/lib/ui/widgets/schedule_settings.dart b/lib/features/schedule/widgets/schedule_settings.dart similarity index 98% rename from lib/ui/widgets/schedule_settings.dart rename to lib/features/schedule/widgets/schedule_settings.dart index 2737e6605..d622def9b 100644 --- a/lib/ui/widgets/schedule_settings.dart +++ b/lib/features/schedule/widgets/schedule_settings.dart @@ -9,9 +9,9 @@ import 'package:stacked/stacked.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/schedule_settings_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/schedule/schedule_settings_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; class ScheduleSettings extends StatefulWidget { final bool showHandle; diff --git a/lib/ui/views/grade_details_view.dart b/lib/features/student/grades/grade_details/grade_details_view.dart similarity index 96% rename from lib/ui/views/grade_details_view.dart rename to lib/features/student/grades/grade_details/grade_details_view.dart index b48277c26..8337bd430 100644 --- a/lib/ui/views/grade_details_view.dart +++ b/lib/features/student/grades/grade_details/grade_details_view.dart @@ -8,13 +8,13 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/grades_details_viewmodel.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; -import 'package:notredame/ui/widgets/grade_circular_progress.dart'; -import 'package:notredame/ui/widgets/grade_evaluation_tile.dart'; -import 'package:notredame/ui/widgets/grade_not_available.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/student/grades/grade_details/grades_details_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; +import 'package:notredame/features/student/grades/widgets/grade_circular_progress.dart'; +import 'package:notredame/features/student/grades/widgets/grade_evaluation_tile.dart'; +import 'package:notredame/features/student/grades/widgets/grade_not_available.dart'; class GradesDetailsView extends StatefulWidget { final Course course; diff --git a/lib/core/viewmodels/grades_details_viewmodel.dart b/lib/features/student/grades/grade_details/grades_details_viewmodel.dart similarity index 85% rename from lib/core/viewmodels/grades_details_viewmodel.dart rename to lib/features/student/grades/grade_details/grades_details_viewmodel.dart index bc3428971..c7d12ec08 100644 --- a/lib/core/viewmodels/grades_details_viewmodel.dart +++ b/lib/features/student/grades/grade_details/grades_details_viewmodel.dart @@ -10,12 +10,12 @@ import 'package:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; class GradesDetailsViewModel extends FutureViewModel { /// Used to get the courses of the student diff --git a/lib/ui/views/grades_view.dart b/lib/features/student/grades/grades_view.dart similarity index 90% rename from lib/ui/views/grades_view.dart rename to lib/features/student/grades/grades_view.dart index d6555bc41..7d30ba83d 100644 --- a/lib/ui/views/grades_view.dart +++ b/lib/features/student/grades/grades_view.dart @@ -9,14 +9,14 @@ import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/viewmodels/grades_viewmodel.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/loading.dart'; -import 'package:notredame/ui/widgets/grade_button.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/student/grades/grades_viewmodel.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/utils/loading.dart'; +import 'package:notredame/features/student/grades/widgets/grade_button.dart'; class GradesView extends StatefulWidget { @override diff --git a/lib/core/viewmodels/grades_viewmodel.dart b/lib/features/student/grades/grades_viewmodel.dart similarity index 89% rename from lib/core/viewmodels/grades_viewmodel.dart rename to lib/features/student/grades/grades_viewmodel.dart index a1f731dda..acd269a2c 100644 --- a/lib/core/viewmodels/grades_viewmodel.dart +++ b/lib/features/student/grades/grades_viewmodel.dart @@ -9,12 +9,12 @@ import 'package:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; class GradesViewModel extends FutureViewModel>> { /// Used to get the courses of the student diff --git a/lib/ui/widgets/schedule_default.dart b/lib/features/student/grades/schedule_default/schedule_default.dart similarity index 96% rename from lib/ui/widgets/schedule_default.dart rename to lib/features/student/grades/schedule_default/schedule_default.dart index 9bd6bf006..ef7243dae 100644 --- a/lib/ui/widgets/schedule_default.dart +++ b/lib/features/student/grades/schedule_default/schedule_default.dart @@ -6,8 +6,8 @@ import 'package:calendar_view/calendar_view.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/widgets/schedule_calendar_tile.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/schedule/widgets/schedule_calendar_tile.dart'; class ScheduleDefault extends StatefulWidget { final List> calendarEvents; diff --git a/lib/ui/views/schedule_default_view.dart b/lib/features/student/grades/schedule_default/schedule_default_view.dart similarity index 88% rename from lib/ui/views/schedule_default_view.dart rename to lib/features/student/grades/schedule_default/schedule_default_view.dart index f4b08cce8..4a143d00e 100644 --- a/lib/ui/views/schedule_default_view.dart +++ b/lib/features/student/grades/schedule_default/schedule_default_view.dart @@ -6,9 +6,9 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/viewmodels/schedule_default_viewmodel.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; -import 'package:notredame/ui/widgets/schedule_default.dart'; +import 'package:notredame/features/student/grades/schedule_default/schedule_default_viewmodel.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; +import 'package:notredame/features/student/grades/schedule_default/schedule_default.dart'; class ScheduleDefaultView extends StatefulWidget { final String? sessionCode; diff --git a/lib/core/viewmodels/schedule_default_viewmodel.dart b/lib/features/student/grades/schedule_default/schedule_default_viewmodel.dart similarity index 95% rename from lib/core/viewmodels/schedule_default_viewmodel.dart rename to lib/features/student/grades/schedule_default/schedule_default_viewmodel.dart index 75a8da06e..294a9a83a 100644 --- a/lib/core/viewmodels/schedule_default_viewmodel.dart +++ b/lib/features/student/grades/schedule_default/schedule_default_viewmodel.dart @@ -7,9 +7,9 @@ import 'package:ets_api_clients/models.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; class ScheduleDefaultViewModel extends FutureViewModel>> { diff --git a/lib/core/models/widget_models.dart b/lib/features/student/grades/widget_models.dart similarity index 100% rename from lib/core/models/widget_models.dart rename to lib/features/student/grades/widget_models.dart diff --git a/lib/ui/widgets/grade_button.dart b/lib/features/student/grades/widgets/grade_button.dart similarity index 89% rename from lib/ui/widgets/grade_button.dart rename to lib/features/student/grades/widgets/grade_button.dart index 4952feca7..bd5a35600 100644 --- a/lib/ui/widgets/grade_button.dart +++ b/lib/features/student/grades/widgets/grade_button.dart @@ -7,14 +7,14 @@ import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; class GradeButton extends StatelessWidget { final Course course; diff --git a/lib/ui/widgets/grade_circular_progress.dart b/lib/features/student/grades/widgets/grade_circular_progress.dart similarity index 98% rename from lib/ui/widgets/grade_circular_progress.dart rename to lib/features/student/grades/widgets/grade_circular_progress.dart index 2dbae900b..9e635cc7c 100644 --- a/lib/ui/widgets/grade_circular_progress.dart +++ b/lib/features/student/grades/widgets/grade_circular_progress.dart @@ -6,7 +6,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:percent_indicator/percent_indicator.dart'; // Project imports: -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/utils/app_theme.dart'; class GradeCircularProgress extends StatefulWidget { final bool completed; diff --git a/lib/ui/widgets/grade_evaluation_tile.dart b/lib/features/student/grades/widgets/grade_evaluation_tile.dart similarity index 97% rename from lib/ui/widgets/grade_evaluation_tile.dart rename to lib/features/student/grades/widgets/grade_evaluation_tile.dart index b961d18ed..36912cef5 100644 --- a/lib/ui/widgets/grade_evaluation_tile.dart +++ b/lib/features/student/grades/widgets/grade_evaluation_tile.dart @@ -13,11 +13,11 @@ import 'package:intl/intl.dart'; import 'package:marquee/marquee.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; -import 'package:notredame/ui/widgets/grade_circular_progress.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; +import 'package:notredame/features/student/grades/widgets/grade_circular_progress.dart'; class GradeEvaluationTile extends StatefulWidget { final bool completed; diff --git a/lib/ui/widgets/grade_not_available.dart b/lib/features/student/grades/widgets/grade_not_available.dart similarity index 96% rename from lib/ui/widgets/grade_not_available.dart rename to lib/features/student/grades/widgets/grade_not_available.dart index 383e52d39..b3fd17d87 100644 --- a/lib/ui/widgets/grade_not_available.dart +++ b/lib/features/student/grades/widgets/grade_not_available.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/utils/app_theme.dart'; class GradeNotAvailable extends StatelessWidget { final VoidCallback? onPressed; diff --git a/lib/ui/views/profile_view.dart b/lib/features/student/profile/profile_view.dart similarity index 96% rename from lib/ui/views/profile_view.dart rename to lib/features/student/profile/profile_view.dart index f7383bed2..bb3f96206 100644 --- a/lib/ui/views/profile_view.dart +++ b/lib/features/student/profile/profile_view.dart @@ -9,12 +9,12 @@ import 'package:percent_indicator/percent_indicator.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/viewmodels/profile_viewmodel.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/loading.dart'; -import 'package:notredame/ui/widgets/student_program.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/student/profile/profile_viewmodel.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/utils/loading.dart'; +import 'package:notredame/features/student/widgets/student_program.dart'; class ProfileView extends StatefulWidget { @override diff --git a/lib/core/viewmodels/profile_viewmodel.dart b/lib/features/student/profile/profile_viewmodel.dart similarity index 93% rename from lib/core/viewmodels/profile_viewmodel.dart rename to lib/features/student/profile/profile_viewmodel.dart index ecb5cdaca..be5ded22b 100644 --- a/lib/core/viewmodels/profile_viewmodel.dart +++ b/lib/features/student/profile/profile_viewmodel.dart @@ -5,10 +5,10 @@ import 'package:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/programs_credits.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/student/profile/programs_credits.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/utils/locator.dart'; class ProfileViewModel extends FutureViewModel> { /// Load the user diff --git a/lib/core/constants/programs_credits.dart b/lib/features/student/profile/programs_credits.dart similarity index 100% rename from lib/core/constants/programs_credits.dart rename to lib/features/student/profile/programs_credits.dart diff --git a/lib/ui/views/student_view.dart b/lib/features/student/student_view.dart similarity index 87% rename from lib/ui/views/student_view.dart rename to lib/features/student/student_view.dart index 2f3e6e73e..1fd91c11c 100644 --- a/lib/ui/views/student_view.dart +++ b/lib/features/student/student_view.dart @@ -6,12 +6,12 @@ import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; -import 'package:notredame/ui/views/grades_view.dart'; -import 'package:notredame/ui/views/profile_view.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/welcome/discovery/discovery_components.dart'; +import 'package:notredame/features/student/grades/grades_view.dart'; +import 'package:notredame/features/student/profile/profile_view.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; class StudentView extends StatefulWidget { @override diff --git a/lib/ui/widgets/student_program.dart b/lib/features/student/widgets/student_program.dart similarity index 98% rename from lib/ui/widgets/student_program.dart rename to lib/features/student/widgets/student_program.dart index 3e701fd6a..f02d6a50e 100644 --- a/lib/ui/widgets/student_program.dart +++ b/lib/features/student/widgets/student_program.dart @@ -9,7 +9,7 @@ import 'package:ets_api_clients/models.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/utils/app_theme.dart'; class StudentProgram extends StatefulWidget { final Program _program; diff --git a/lib/ui/utils/discovery_components.dart b/lib/features/welcome/discovery/discovery_components.dart similarity index 96% rename from lib/ui/utils/discovery_components.dart rename to lib/features/welcome/discovery/discovery_components.dart index 2bd0006dd..7d10a096d 100644 --- a/lib/ui/utils/discovery_components.dart +++ b/lib/features/welcome/discovery/discovery_components.dart @@ -6,14 +6,14 @@ import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/core/constants/discovery_ids.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/models/discovery.dart'; -import 'package:notredame/core/models/group_discovery.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery_ids.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery.dart'; +import 'package:notredame/features/welcome/discovery/models/group_discovery.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; List discoveryComponents(BuildContext context) { return [ diff --git a/lib/core/models/discovery.dart b/lib/features/welcome/discovery/models/discovery.dart similarity index 100% rename from lib/core/models/discovery.dart rename to lib/features/welcome/discovery/models/discovery.dart diff --git a/lib/core/constants/discovery_ids.dart b/lib/features/welcome/discovery/models/discovery_ids.dart similarity index 100% rename from lib/core/constants/discovery_ids.dart rename to lib/features/welcome/discovery/models/discovery_ids.dart diff --git a/lib/core/models/group_discovery.dart b/lib/features/welcome/discovery/models/group_discovery.dart similarity index 70% rename from lib/core/models/group_discovery.dart rename to lib/features/welcome/discovery/models/group_discovery.dart index 8a09af894..ac4793746 100644 --- a/lib/core/models/group_discovery.dart +++ b/lib/features/welcome/discovery/models/group_discovery.dart @@ -1,5 +1,5 @@ // Project imports: -import 'package:notredame/core/models/discovery.dart'; +import 'package:notredame/features/welcome/discovery/models/discovery.dart'; class GroupDiscovery { final String name; diff --git a/lib/core/utils/login_mask.dart b/lib/features/welcome/login/login_mask.dart similarity index 100% rename from lib/core/utils/login_mask.dart rename to lib/features/welcome/login/login_mask.dart diff --git a/lib/ui/views/login_view.dart b/lib/features/welcome/login/login_view.dart similarity index 95% rename from lib/ui/views/login_view.dart rename to lib/features/welcome/login/login_view.dart index 0bb28e381..a71d7618b 100644 --- a/lib/ui/views/login_view.dart +++ b/lib/features/welcome/login/login_view.dart @@ -8,16 +8,16 @@ import 'package:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/core/utils/login_mask.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/core/viewmodels/login_viewmodel.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/widgets/password_text_field.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/features/welcome/login/login_mask.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/welcome/login/login_viewmodel.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/welcome/widgets/password_text_field.dart'; class LoginView extends StatefulWidget { @override diff --git a/lib/core/viewmodels/login_viewmodel.dart b/lib/features/welcome/login/login_viewmodel.dart similarity index 87% rename from lib/core/viewmodels/login_viewmodel.dart rename to lib/features/welcome/login/login_viewmodel.dart index 12972eb08..8c798ee9f 100644 --- a/lib/core/viewmodels/login_viewmodel.dart +++ b/lib/features/welcome/login/login_viewmodel.dart @@ -4,12 +4,12 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/utils/locator.dart'; class LoginViewModel extends BaseViewModel { /// Used to authenticate the user diff --git a/lib/ui/widgets/password_text_field.dart b/lib/features/welcome/widgets/password_text_field.dart similarity index 100% rename from lib/ui/widgets/password_text_field.dart rename to lib/features/welcome/widgets/password_text_field.dart diff --git a/lib/main.dart b/lib/main.dart index c04e222b6..6676ccb78 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -17,19 +17,19 @@ import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:provider/provider.dart'; // Project imports: -import 'package:notredame/core/constants/custom_feedback_localization.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/app_widget_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/firebase_options.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/ui/router.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/views/outage_view.dart'; -import 'package:notredame/ui/views/startup_view.dart'; -import 'package:notredame/ui/widgets/custom_feedback.dart'; +import 'package:notredame/features/more/feedback/models/custom_feedback_localization.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/widgets/app_widget_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/features/app/integration/firebase_options.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/features/app/navigation/router.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/app/error/outage/outage_view.dart'; +import 'package:notredame/features/app/startup/startup_view.dart'; +import 'package:notredame/features/more/feedback/widgets/custom_feedback.dart'; Future main() async { setupLocator(); diff --git a/lib/core/utils/animation_exception.dart b/lib/utils/animation_exception.dart similarity index 100% rename from lib/core/utils/animation_exception.dart rename to lib/utils/animation_exception.dart diff --git a/lib/ui/utils/app_theme.dart b/lib/utils/app_theme.dart similarity index 100% rename from lib/ui/utils/app_theme.dart rename to lib/utils/app_theme.dart diff --git a/lib/core/utils/cache_exception.dart b/lib/utils/cache_exception.dart similarity index 100% rename from lib/core/utils/cache_exception.dart rename to lib/utils/cache_exception.dart diff --git a/lib/core/utils/calendar_utils.dart b/lib/utils/calendar_utils.dart similarity index 100% rename from lib/core/utils/calendar_utils.dart rename to lib/utils/calendar_utils.dart diff --git a/lib/ui/utils/loading.dart b/lib/utils/loading.dart similarity index 100% rename from lib/ui/utils/loading.dart rename to lib/utils/loading.dart diff --git a/lib/locator.dart b/lib/utils/locator.dart similarity index 55% rename from lib/locator.dart rename to lib/utils/locator.dart index ea8ee8336..55ead6acf 100644 --- a/lib/locator.dart +++ b/lib/utils/locator.dart @@ -5,23 +5,23 @@ import 'package:get_it/get_it.dart'; import 'package:logger/logger.dart'; // Project imports: -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/quick_link_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/app_widget_service.dart'; -import 'package:notredame/core/services/github_api.dart'; -import 'package:notredame/core/services/in_app_review_service.dart'; -import 'package:notredame/core/services/internal_info_service.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/core/services/rive_animation_service.dart'; -import 'package:notredame/core/services/siren_flutter_service.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/app/repository/quick_link_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/widgets/app_widget_service.dart'; +import 'package:notredame/features/app/integration/github_api.dart'; +import 'package:notredame/features/more/feedback/in_app_review_service.dart'; +import 'package:notredame/features/app/error/internal_info_service.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/features/app/presentation/rive_animation_service.dart'; +import 'package:notredame/features/app/storage/siren_flutter_service.dart'; GetIt locator = GetIt.instance; diff --git a/lib/core/utils/utils.dart b/lib/utils/utils.dart similarity index 100% rename from lib/core/utils/utils.dart rename to lib/utils/utils.dart diff --git a/pubspec.yaml b/pubspec.yaml index a66ff5760..8ff12eddb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,10 +5,10 @@ description: The 4th generation of ÉTSMobile, the main gateway between the Éco # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 4.40.0+1 +version: 4.42.0+1 environment: - sdk: ">=3.3.0 <4.0.0" + sdk: '>=3.3.0 <4.0.0' dependencies: flutter: @@ -87,11 +87,11 @@ dev_dependencies: import_sorter: ^4.6.0 flutter_icons: - android: "launcher_icon" - ios: "LaunchImage" - image_path: "assets/icons/launcher_icon.png" - adaptive_icon_background: "#EF3F45" - adaptive_icon_foreground: "assets/icons/ic_launcher_foreground.png" + android: 'launcher_icon' + ios: 'LaunchImage' + image_path: 'assets/icons/launcher_icon.png' + adaptive_icon_background: '#EF3F45' + adaptive_icon_foreground: 'assets/icons/ic_launcher_foreground.png' flutter: uses-material-design: true diff --git a/test/helpers.dart b/test/helpers.dart index 9bf0a4bc6..6a52d7b5c 100644 --- a/test/helpers.dart +++ b/test/helpers.dart @@ -12,24 +12,24 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:logger/logger.dart'; // Project imports: -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/quick_link_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/app_widget_service.dart'; -import 'package:notredame/core/services/github_api.dart'; -import 'package:notredame/core/services/in_app_review_service.dart'; -import 'package:notredame/core/services/internal_info_service.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/core/services/rive_animation_service.dart'; -import 'package:notredame/core/services/siren_flutter_service.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/app/repository/quick_link_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/widgets/app_widget_service.dart'; +import 'package:notredame/features/app/integration/github_api.dart'; +import 'package:notredame/features/more/feedback/in_app_review_service.dart'; +import 'package:notredame/features/app/error/internal_info_service.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/features/app/presentation/rive_animation_service.dart'; +import 'package:notredame/features/app/storage/siren_flutter_service.dart'; +import 'package:notredame/utils/locator.dart'; import 'mock/managers/cache_manager_mock.dart'; import 'mock/managers/course_repository_mock.dart'; import 'mock/managers/quick_links_repository_mock.dart'; diff --git a/test/managers/course_repository_test.dart b/test/managers/course_repository_test.dart index b7cebb9e7..6dc4ba4fe 100644 --- a/test/managers/course_repository_test.dart +++ b/test/managers/course_repository_test.dart @@ -11,10 +11,10 @@ import 'package:intl/intl.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/analytics_service.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; import '../helpers.dart'; import '../mock/managers/cache_manager_mock.dart'; import '../mock/managers/user_repository_mock.dart'; diff --git a/test/managers/quick_link_repository_test.dart b/test/managers/quick_link_repository_test.dart index b1bc3acdf..e9b9a5b26 100644 --- a/test/managers/quick_link_repository_test.dart +++ b/test/managers/quick_link_repository_test.dart @@ -9,10 +9,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/managers/quick_link_repository.dart'; -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/models/quick_link_data.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/app/repository/quick_link_repository.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link_data.dart'; import '../helpers.dart'; import '../mock/managers/cache_manager_mock.dart'; diff --git a/test/managers/settings_manager_test.dart b/test/managers/settings_manager_test.dart index f0a806108..82a0d646e 100644 --- a/test/managers/settings_manager_test.dart +++ b/test/managers/settings_manager_test.dart @@ -10,9 +10,9 @@ import 'package:mockito/mockito.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/preferences_service.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; import '../helpers.dart'; import '../mock/services/analytics_service_mock.dart'; import '../mock/services/preferences_service_mock.dart'; diff --git a/test/managers/user_repository_test.dart b/test/managers/user_repository_test.dart index b38974299..fa3d074a6 100644 --- a/test/managers/user_repository_test.dart +++ b/test/managers/user_repository_test.dart @@ -14,10 +14,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; import '../helpers.dart'; import '../mock/managers/cache_manager_mock.dart'; import '../mock/services/analytics_service_mock.dart'; diff --git a/test/mock/managers/cache_manager_mock.dart b/test/mock/managers/cache_manager_mock.dart index 9eb3a3840..611698eb7 100644 --- a/test/mock/managers/cache_manager_mock.dart +++ b/test/mock/managers/cache_manager_mock.dart @@ -3,8 +3,8 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/utils/cache_exception.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/utils/cache_exception.dart'; import 'cache_manager_mock.mocks.dart'; /// Mock for the [CacheManager] diff --git a/test/mock/managers/course_repository_mock.dart b/test/mock/managers/course_repository_mock.dart index f9807ad80..cef12cc0e 100644 --- a/test/mock/managers/course_repository_mock.dart +++ b/test/mock/managers/course_repository_mock.dart @@ -5,7 +5,7 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/course_repository.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; import 'course_repository_mock.mocks.dart'; @GenerateNiceMocks([MockSpec()]) diff --git a/test/mock/managers/quick_links_repository_mock.dart b/test/mock/managers/quick_links_repository_mock.dart index 44affe215..ec459e8e4 100644 --- a/test/mock/managers/quick_links_repository_mock.dart +++ b/test/mock/managers/quick_links_repository_mock.dart @@ -4,9 +4,9 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/quick_link_repository.dart'; -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/models/quick_link_data.dart'; +import 'package:notredame/features/app/repository/quick_link_repository.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link_data.dart'; import 'quick_links_repository_mock.mocks.dart'; @GenerateNiceMocks([MockSpec()]) diff --git a/test/mock/managers/settings_manager_mock.dart b/test/mock/managers/settings_manager_mock.dart index d0b4aa490..9780b2191 100644 --- a/test/mock/managers/settings_manager_mock.dart +++ b/test/mock/managers/settings_manager_mock.dart @@ -6,8 +6,8 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; import 'settings_manager_mock.mocks.dart'; @GenerateNiceMocks([MockSpec()]) diff --git a/test/mock/managers/user_repository_mock.dart b/test/mock/managers/user_repository_mock.dart index 8ac31014c..5688a0469 100644 --- a/test/mock/managers/user_repository_mock.dart +++ b/test/mock/managers/user_repository_mock.dart @@ -5,7 +5,7 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/user_repository.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; import 'user_repository_mock.mocks.dart'; /// Mock for the [UserRepository] diff --git a/test/mock/services/analytics_service_mock.dart b/test/mock/services/analytics_service_mock.dart index 883c9f4a7..59e72add6 100644 --- a/test/mock/services/analytics_service_mock.dart +++ b/test/mock/services/analytics_service_mock.dart @@ -2,7 +2,7 @@ import 'package:mockito/annotations.dart'; // Project imports: -import 'package:notredame/core/services/analytics_service.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; import 'analytics_service_mock.mocks.dart'; /// Mock for the [AnalyticsService] diff --git a/test/mock/services/app_widget_service_mock.dart b/test/mock/services/app_widget_service_mock.dart index 3f7c461df..a0eee541b 100644 --- a/test/mock/services/app_widget_service_mock.dart +++ b/test/mock/services/app_widget_service_mock.dart @@ -2,7 +2,7 @@ import 'package:mockito/annotations.dart'; // Project imports: -import 'package:notredame/core/services/app_widget_service.dart'; +import 'package:notredame/features/app/widgets/app_widget_service.dart'; import 'app_widget_service_mock.mocks.dart'; /// Mock for the [AppWidgetService] diff --git a/test/mock/services/github_api_mock.dart b/test/mock/services/github_api_mock.dart index 0c2983309..7dcbda5b3 100644 --- a/test/mock/services/github_api_mock.dart +++ b/test/mock/services/github_api_mock.dart @@ -8,8 +8,8 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/models/feedback_issue.dart'; -import 'package:notredame/core/services/github_api.dart'; +import 'package:notredame/features/more/feedback/models/feedback_issue.dart'; +import 'package:notredame/features/app/integration/github_api.dart'; import 'github_api_mock.mocks.dart'; /// Mock for the [GithubApi] diff --git a/test/mock/services/home_widget_mock.dart b/test/mock/services/home_widget_mock.dart index 1538e36cb..98ec3e5be 100644 --- a/test/mock/services/home_widget_mock.dart +++ b/test/mock/services/home_widget_mock.dart @@ -7,7 +7,7 @@ import 'package:home_widget/home_widget.dart'; import 'package:mockito/annotations.dart'; // Project imports: -import 'package:notredame/core/services/app_widget_service.dart'; +import 'package:notredame/features/app/widgets/app_widget_service.dart'; import 'home_widget_mock.mocks.dart'; /// Pseudo-mock for the static [HomeWidget] class (mocks the channel instead) diff --git a/test/mock/services/in_app_review_service_mock.dart b/test/mock/services/in_app_review_service_mock.dart index 53db569e5..314962191 100644 --- a/test/mock/services/in_app_review_service_mock.dart +++ b/test/mock/services/in_app_review_service_mock.dart @@ -3,7 +3,7 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/services/in_app_review_service.dart'; +import 'package:notredame/features/more/feedback/in_app_review_service.dart'; import 'in_app_review_service_mock.mocks.dart'; /// Mock for the [AnalyticsService] diff --git a/test/mock/services/internal_info_service_mock.dart b/test/mock/services/internal_info_service_mock.dart index 9fa8da90b..8b46b63ba 100644 --- a/test/mock/services/internal_info_service_mock.dart +++ b/test/mock/services/internal_info_service_mock.dart @@ -4,7 +4,7 @@ import 'package:mockito/mockito.dart'; import 'package:package_info_plus/package_info_plus.dart'; // Project imports: -import 'package:notredame/core/services/internal_info_service.dart'; +import 'package:notredame/features/app/error/internal_info_service.dart'; import 'internal_info_service_mock.mocks.dart'; @GenerateNiceMocks([MockSpec()]) diff --git a/test/mock/services/launch_url_service_mock.dart b/test/mock/services/launch_url_service_mock.dart index 6a3f85168..f323a6d29 100644 --- a/test/mock/services/launch_url_service_mock.dart +++ b/test/mock/services/launch_url_service_mock.dart @@ -3,7 +3,7 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/services/launch_url_service.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; import 'launch_url_service_mock.mocks.dart'; /// Mock for the [LaunchUrlService] diff --git a/test/mock/services/navigation_service_mock.dart b/test/mock/services/navigation_service_mock.dart index 53f438d1d..fcd2095a5 100644 --- a/test/mock/services/navigation_service_mock.dart +++ b/test/mock/services/navigation_service_mock.dart @@ -2,7 +2,7 @@ import 'package:mockito/annotations.dart'; // Project imports: -import 'package:notredame/core/services/navigation_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; import 'navigation_service_mock.mocks.dart'; /// Mock for the [NavigationService] diff --git a/test/mock/services/networking_service_mock.dart b/test/mock/services/networking_service_mock.dart index 12388978a..e9183d272 100644 --- a/test/mock/services/networking_service_mock.dart +++ b/test/mock/services/networking_service_mock.dart @@ -4,7 +4,7 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/services/networking_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; import 'networking_service_mock.mocks.dart'; /// Mock for the [NetworkingService] diff --git a/test/mock/services/preferences_service_mock.dart b/test/mock/services/preferences_service_mock.dart index b94c950de..819f8c3c5 100644 --- a/test/mock/services/preferences_service_mock.dart +++ b/test/mock/services/preferences_service_mock.dart @@ -3,8 +3,8 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/services/preferences_service.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; import 'preferences_service_mock.mocks.dart'; @GenerateNiceMocks([MockSpec()]) diff --git a/test/mock/services/remote_config_service_mock.dart b/test/mock/services/remote_config_service_mock.dart index 1b518947e..4e92233d8 100644 --- a/test/mock/services/remote_config_service_mock.dart +++ b/test/mock/services/remote_config_service_mock.dart @@ -3,7 +3,7 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/services/remote_config_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; import 'remote_config_service_mock.mocks.dart'; /// Mock for the [RemoteConfigService] diff --git a/test/mock/services/rive_animation_service_mock.dart b/test/mock/services/rive_animation_service_mock.dart index 2b5c10753..dfda99d5e 100644 --- a/test/mock/services/rive_animation_service_mock.dart +++ b/test/mock/services/rive_animation_service_mock.dart @@ -4,8 +4,8 @@ import 'package:mockito/mockito.dart'; import 'package:rive/rive.dart'; // Project imports: -import 'package:notredame/core/services/rive_animation_service.dart'; -import 'package:notredame/core/utils/animation_exception.dart'; +import 'package:notredame/features/app/presentation/rive_animation_service.dart'; +import 'package:notredame/utils/animation_exception.dart'; import 'rive_animation_service_mock.mocks.dart'; /// Mock for the [RiveAnimationService] diff --git a/test/mock/services/siren_flutter_service_mock.dart b/test/mock/services/siren_flutter_service_mock.dart index fd90b7df6..9d03be2f3 100644 --- a/test/mock/services/siren_flutter_service_mock.dart +++ b/test/mock/services/siren_flutter_service_mock.dart @@ -4,7 +4,7 @@ import 'package:mockito/mockito.dart'; import 'package:pub_semver/pub_semver.dart'; // Project imports: -import 'package:notredame/core/services/siren_flutter_service.dart'; +import 'package:notredame/features/app/storage/siren_flutter_service.dart'; import 'siren_flutter_service_mock.mocks.dart'; /// Mock for the [SirenFlutterService] diff --git a/test/models/feedback_issue_test.dart b/test/models/feedback_issue_test.dart index 2aa0a2afd..501be5c13 100644 --- a/test/models/feedback_issue_test.dart +++ b/test/models/feedback_issue_test.dart @@ -3,7 +3,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:github/github.dart'; // Project imports: -import 'package:notredame/core/models/feedback_issue.dart'; +import 'package:notredame/features/more/feedback/models/feedback_issue.dart'; void main() { group('FeedBackIssue - ', () { diff --git a/test/services/app_widget_service_test.dart b/test/services/app_widget_service_test.dart index 049236d82..91d07d278 100644 --- a/test/services/app_widget_service_test.dart +++ b/test/services/app_widget_service_test.dart @@ -3,9 +3,9 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:home_widget/home_widget.dart'; // Project imports: -import 'package:notredame/core/constants/widget_helper.dart'; -import 'package:notredame/core/models/widget_models.dart'; -import 'package:notredame/core/services/app_widget_service.dart'; +import 'package:notredame/constants/widget_helper.dart'; +import 'package:notredame/features/student/grades/widget_models.dart'; +import 'package:notredame/features/app/widgets/app_widget_service.dart'; import '../helpers.dart'; import '../mock/services/home_widget_mock.dart'; diff --git a/test/services/preferences_service_test.dart b/test/services/preferences_service_test.dart index 547faeaba..3cc302b45 100644 --- a/test/services/preferences_service_test.dart +++ b/test/services/preferences_service_test.dart @@ -3,8 +3,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/services/preferences_service.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; void main() { late SharedPreferences sharedPreferences; diff --git a/test/ui/views/about_view_test.dart b/test/ui/views/about_view_test.dart index 309ebfee3..418be4909 100644 --- a/test/ui/views/about_view_test.dart +++ b/test/ui/views/about_view_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/ui/views/about_view.dart'; +import 'package:notredame/features/more/about/about_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/views/choose_language_view_test.dart b/test/ui/views/choose_language_view_test.dart index df01ebcb3..f20cbd9f9 100644 --- a/test/ui/views/choose_language_view_test.dart +++ b/test/ui/views/choose_language_view_test.dart @@ -9,9 +9,9 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/ui/views/choose_language_view.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/more/settings/choose_language_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/views/dashboard_view_test.dart b/test/ui/views/dashboard_view_test.dart index 4aad5ae4b..839e761c8 100644 --- a/test/ui/views/dashboard_view_test.dart +++ b/test/ui/views/dashboard_view_test.dart @@ -11,12 +11,12 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/update_code.dart'; -import 'package:notredame/ui/views/dashboard_view.dart'; -import 'package:notredame/ui/widgets/course_activity_tile.dart'; -import 'package:notredame/ui/widgets/dismissible_card.dart'; -import 'package:notredame/ui/widgets/grade_button.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/constants/update_code.dart'; +import 'package:notredame/features/dashboard/dashboard_view.dart'; +import 'package:notredame/features/dashboard/widgets/course_activity_tile.dart'; +import 'package:notredame/features/app/widgets/dismissible_card.dart'; +import 'package:notredame/features/student/grades/widgets/grade_button.dart'; import '../../helpers.dart'; import '../../mock/managers/course_repository_mock.dart'; import '../../mock/managers/settings_manager_mock.dart'; diff --git a/test/ui/views/emergency_view_test.dart b/test/ui/views/emergency_view_test.dart index 550018c51..4cf60e4b7 100644 --- a/test/ui/views/emergency_view_test.dart +++ b/test/ui/views/emergency_view_test.dart @@ -7,7 +7,7 @@ import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter_android/webview_flutter_android.dart'; // Project imports: -import 'package:notredame/ui/views/emergency_view.dart'; +import 'package:notredame/features/ets/security-info/emergency_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/views/faq_view_test.dart b/test/ui/views/faq_view_test.dart index 2a924cf01..7a6190daa 100644 --- a/test/ui/views/faq_view_test.dart +++ b/test/ui/views/faq_view_test.dart @@ -10,8 +10,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; // Project imports: -import 'package:notredame/core/constants/faq.dart'; -import 'package:notredame/ui/views/faq_view.dart'; +import 'package:notredame/features/more/faq/models/faq.dart'; +import 'package:notredame/features/more/faq/faq_view.dart'; import '../../helpers.dart'; import '../../mock/managers/settings_manager_mock.dart'; diff --git a/test/ui/views/feedback_view_test.dart b/test/ui/views/feedback_view_test.dart index 7243f760e..cc4911755 100644 --- a/test/ui/views/feedback_view_test.dart +++ b/test/ui/views/feedback_view_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/ui/views/feedback_view.dart'; +import 'package:notredame/features/more/feedback/feedback_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/views/grades_details_view_test.dart b/test/ui/views/grades_details_view_test.dart index ea3cc9076..ed77f7f32 100644 --- a/test/ui/views/grades_details_view_test.dart +++ b/test/ui/views/grades_details_view_test.dart @@ -11,10 +11,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; // Project imports: -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/ui/views/grade_details_view.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/student/grades/grade_details/grade_details_view.dart'; import '../../helpers.dart'; import '../../mock/managers/course_repository_mock.dart'; diff --git a/test/ui/views/grades_view_test.dart b/test/ui/views/grades_view_test.dart index f6b8d8e8b..970839250 100644 --- a/test/ui/views/grades_view_test.dart +++ b/test/ui/views/grades_view_test.dart @@ -12,12 +12,12 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; // Project imports: -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/ui/views/grades_view.dart'; -import 'package:notredame/ui/widgets/grade_button.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/student/grades/grades_view.dart'; +import 'package:notredame/features/student/grades/widgets/grade_button.dart'; import '../../helpers.dart'; import '../../mock/managers/course_repository_mock.dart'; diff --git a/test/ui/views/login_view_test.dart b/test/ui/views/login_view_test.dart index 9a01d1cb4..054303e20 100644 --- a/test/ui/views/login_view_test.dart +++ b/test/ui/views/login_view_test.dart @@ -6,15 +6,15 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; -import 'package:notredame/ui/views/login_view.dart'; -import 'package:notredame/ui/widgets/password_text_field.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/features/app/analytics/remote_config_service.dart'; +import 'package:notredame/features/welcome/login/login_view.dart'; +import 'package:notredame/features/welcome/widgets/password_text_field.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/views/more_view_test.dart b/test/ui/views/more_view_test.dart index 397d2b8dd..5c52621ce 100644 --- a/test/ui/views/more_view_test.dart +++ b/test/ui/views/more_view_test.dart @@ -12,9 +12,9 @@ import 'package:mockito/mockito.dart'; import 'package:shared_preferences/shared_preferences.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/ui/views/more_view.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/more/more_view.dart'; import '../../helpers.dart'; import '../../mock/managers/settings_manager_mock.dart'; import '../../mock/services/in_app_review_service_mock.dart'; diff --git a/test/ui/views/not_found_view_test.dart b/test/ui/views/not_found_view_test.dart index 7fe0bc0e0..c11713ebd 100644 --- a/test/ui/views/not_found_view_test.dart +++ b/test/ui/views/not_found_view_test.dart @@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:rive/rive.dart'; // Project imports: -import 'package:notredame/ui/views/not_found_view.dart'; +import 'package:notredame/features/app/error/not_found/not_found_view.dart'; import '../../helpers.dart'; import '../../mock/services/rive_animation_service_mock.dart'; diff --git a/test/ui/views/profile_view_test.dart b/test/ui/views/profile_view_test.dart index ecc9ce31e..b19b82172 100644 --- a/test/ui/views/profile_view_test.dart +++ b/test/ui/views/profile_view_test.dart @@ -10,8 +10,8 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/ui/views/profile_view.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/student/profile/profile_view.dart'; import '../../helpers.dart'; import '../../mock/managers/user_repository_mock.dart'; import '../../mock/services/analytics_service_mock.dart'; diff --git a/test/ui/views/quick_links_view_test.dart b/test/ui/views/quick_links_view_test.dart index 111b1c68e..f7a7d0152 100644 --- a/test/ui/views/quick_links_view_test.dart +++ b/test/ui/views/quick_links_view_test.dart @@ -10,12 +10,12 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/core/constants/quick_links.dart'; -import 'package:notredame/core/managers/quick_link_repository.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/ui/views/quick_links_view.dart'; -import 'package:notredame/ui/widgets/web_link_card.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_links.dart'; +import 'package:notredame/features/app/repository/quick_link_repository.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/ets/quick-link/quick_links_view.dart'; +import 'package:notredame/features/app/widgets/web_link_card.dart'; import '../../helpers.dart'; import '../../mock/managers/quick_links_repository_mock.dart'; import '../../mock/services/analytics_service_mock.dart'; diff --git a/test/ui/views/schedule_default_view_test.dart b/test/ui/views/schedule_default_view_test.dart index fc6bfc0ca..9362c3c49 100644 --- a/test/ui/views/schedule_default_view_test.dart +++ b/test/ui/views/schedule_default_view_test.dart @@ -10,11 +10,11 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/ui/views/schedule_default_view.dart'; -import 'package:notredame/ui/widgets/schedule_default.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/student/grades/schedule_default/schedule_default_view.dart'; +import 'package:notredame/features/student/grades/schedule_default/schedule_default.dart'; import '../../helpers.dart'; import '../../mock/managers/course_repository_mock.mocks.dart'; diff --git a/test/ui/views/schedule_view_test.dart b/test/ui/views/schedule_view_test.dart index b01485d0e..89f90fbdf 100644 --- a/test/ui/views/schedule_view_test.dart +++ b/test/ui/views/schedule_view_test.dart @@ -12,9 +12,9 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/ui/views/schedule_view.dart'; -import 'package:notredame/ui/widgets/schedule_settings.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/schedule/schedule_view.dart'; +import 'package:notredame/features/schedule/widgets/schedule_settings.dart'; import '../../helpers.dart'; import '../../mock/managers/course_repository_mock.dart'; import '../../mock/managers/settings_manager_mock.dart'; diff --git a/test/ui/views/security_view_test.dart b/test/ui/views/security_view_test.dart index 4a19a130c..2ce322642 100644 --- a/test/ui/views/security_view_test.dart +++ b/test/ui/views/security_view_test.dart @@ -7,8 +7,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; // Project imports: -import 'package:notredame/core/constants/emergency_procedures.dart'; -import 'package:notredame/ui/views/security_view.dart'; +import 'package:notredame/features/ets/security-info/models/emergency_procedures.dart'; +import 'package:notredame/features/ets/security-info/security_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/views/settings_view_test.dart b/test/ui/views/settings_view_test.dart index 78074b7da..b6ef8fdf9 100644 --- a/test/ui/views/settings_view_test.dart +++ b/test/ui/views/settings_view_test.dart @@ -10,8 +10,8 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/ui/views/settings_view.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/more/settings/settings_view.dart'; import '../../helpers.dart'; import '../../mock/services/analytics_service_mock.dart'; diff --git a/test/ui/views/student_view_test.dart b/test/ui/views/student_view_test.dart index 1e2923abc..63732fd32 100644 --- a/test/ui/views/student_view_test.dart +++ b/test/ui/views/student_view_test.dart @@ -9,11 +9,11 @@ import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/ui/views/student_view.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/student/student_view.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; import '../../helpers.dart'; import '../../mock/managers/course_repository_mock.dart'; import '../../mock/services/analytics_service_mock.dart'; diff --git a/test/ui/widgets/base_scaffold_test.dart b/test/ui/widgets/base_scaffold_test.dart index f2a02b669..756630009 100644 --- a/test/ui/widgets/base_scaffold_test.dart +++ b/test/ui/widgets/base_scaffold_test.dart @@ -6,10 +6,10 @@ import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; -import 'package:notredame/ui/widgets/bottom_bar.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/app/widgets/base_scaffold.dart'; +import 'package:notredame/features/app/widgets/bottom_bar.dart'; import '../../helpers.dart'; import '../../mock/services/analytics_service_mock.dart'; diff --git a/test/ui/widgets/bottom_bar_test.dart b/test/ui/widgets/bottom_bar_test.dart index dc069a22e..25c4d0967 100644 --- a/test/ui/widgets/bottom_bar_test.dart +++ b/test/ui/widgets/bottom_bar_test.dart @@ -7,10 +7,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/ui/widgets/bottom_bar.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/integration/networking_service.dart'; +import 'package:notredame/features/app/widgets/bottom_bar.dart'; import '../../helpers.dart'; import '../../mock/services/analytics_service_mock.dart'; import '../../mock/services/navigation_service_mock.dart'; diff --git a/test/ui/widgets/course_activity_tile_test.dart b/test/ui/widgets/course_activity_tile_test.dart index 23deab4cb..c5e1b1418 100644 --- a/test/ui/widgets/course_activity_tile_test.dart +++ b/test/ui/widgets/course_activity_tile_test.dart @@ -6,7 +6,7 @@ import 'package:ets_api_clients/models.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/ui/widgets/course_activity_tile.dart'; +import 'package:notredame/features/dashboard/widgets/course_activity_tile.dart'; import '../../helpers.dart'; final CourseActivity course = CourseActivity( diff --git a/test/ui/widgets/dismissible_card_test.dart b/test/ui/widgets/dismissible_card_test.dart index a4a8100de..fe57d60a8 100644 --- a/test/ui/widgets/dismissible_card_test.dart +++ b/test/ui/widgets/dismissible_card_test.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/ui/widgets/dismissible_card.dart'; +import 'package:notredame/features/app/widgets/dismissible_card.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/grade_button_test.dart b/test/ui/widgets/grade_button_test.dart index e6e1f3deb..17433f043 100644 --- a/test/ui/widgets/grade_button_test.dart +++ b/test/ui/widgets/grade_button_test.dart @@ -5,11 +5,11 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/ui/widgets/grade_button.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/student/grades/widgets/grade_button.dart'; import '../../helpers.dart'; import '../../mock/managers/settings_manager_mock.dart'; import '../../mock/services/navigation_service_mock.dart'; diff --git a/test/ui/widgets/grade_circular_progress_test.dart b/test/ui/widgets/grade_circular_progress_test.dart index 94e3322bc..9768b63cc 100644 --- a/test/ui/widgets/grade_circular_progress_test.dart +++ b/test/ui/widgets/grade_circular_progress_test.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:percent_indicator/percent_indicator.dart'; // Project imports: -import 'package:notredame/ui/widgets/grade_circular_progress.dart'; +import 'package:notredame/features/student/grades/widgets/grade_circular_progress.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/grade_evaluation_tile_test.dart b/test/ui/widgets/grade_evaluation_tile_test.dart index 97f86f274..abe129565 100644 --- a/test/ui/widgets/grade_evaluation_tile_test.dart +++ b/test/ui/widgets/grade_evaluation_tile_test.dart @@ -9,8 +9,8 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/ui/widgets/grade_circular_progress.dart'; -import 'package:notredame/ui/widgets/grade_evaluation_tile.dart'; +import 'package:notredame/features/student/grades/widgets/grade_circular_progress.dart'; +import 'package:notredame/features/student/grades/widgets/grade_evaluation_tile.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/grade_not_available_test.dart b/test/ui/widgets/grade_not_available_test.dart index 1abd31268..eba10fe6e 100644 --- a/test/ui/widgets/grade_not_available_test.dart +++ b/test/ui/widgets/grade_not_available_test.dart @@ -6,7 +6,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/ui/widgets/grade_not_available.dart'; +import 'package:notredame/features/student/grades/widgets/grade_not_available.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/link_web_view_test.dart b/test/ui/widgets/link_web_view_test.dart index 21eef2549..e1437781d 100644 --- a/test/ui/widgets/link_web_view_test.dart +++ b/test/ui/widgets/link_web_view_test.dart @@ -7,8 +7,8 @@ import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter_android/webview_flutter_android.dart'; // Project imports: -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/ui/widgets/link_web_view.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/app/widgets/link_web_view.dart'; import '../../helpers.dart'; final _quickLink = QuickLink( diff --git a/test/ui/widgets/password_text_field_test.dart b/test/ui/widgets/password_text_field_test.dart index b6b937e8b..5c98478b2 100644 --- a/test/ui/widgets/password_text_field_test.dart +++ b/test/ui/widgets/password_text_field_test.dart @@ -6,7 +6,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/ui/widgets/password_text_field.dart'; +import 'package:notredame/features/welcome/widgets/password_text_field.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/schedule_default_test.dart b/test/ui/widgets/schedule_default_test.dart index f6d2aee38..0f2648e77 100644 --- a/test/ui/widgets/schedule_default_test.dart +++ b/test/ui/widgets/schedule_default_test.dart @@ -3,7 +3,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/ui/widgets/schedule_default.dart'; +import 'package:notredame/features/student/grades/schedule_default/schedule_default.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/schedule_settings_test.dart b/test/ui/widgets/schedule_settings_test.dart index 140dab082..3f160e45e 100644 --- a/test/ui/widgets/schedule_settings_test.dart +++ b/test/ui/widgets/schedule_settings_test.dart @@ -13,8 +13,8 @@ import 'package:mockito/mockito.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/ui/widgets/schedule_settings.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/schedule/widgets/schedule_settings.dart'; import '../../helpers.dart'; import '../../mock/managers/course_repository_mock.dart'; import '../../mock/managers/settings_manager_mock.dart'; diff --git a/test/ui/widgets/student_program_test.dart b/test/ui/widgets/student_program_test.dart index 9143a7f2d..a784e0952 100644 --- a/test/ui/widgets/student_program_test.dart +++ b/test/ui/widgets/student_program_test.dart @@ -7,7 +7,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/ui/widgets/student_program.dart'; +import 'package:notredame/features/student/widgets/student_program.dart'; import '../../helpers.dart'; final _program = Program( diff --git a/test/ui/widgets/web_link_card_test.dart b/test/ui/widgets/web_link_card_test.dart index a2db92117..3ef4ab504 100644 --- a/test/ui/widgets/web_link_card_test.dart +++ b/test/ui/widgets/web_link_card_test.dart @@ -6,11 +6,11 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/internal_info_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/ui/widgets/web_link_card.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/error/internal_info_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/widgets/web_link_card.dart'; import '../../helpers.dart'; import '../../mock/services/analytics_service_mock.dart'; import '../../mock/services/launch_url_service_mock.dart'; diff --git a/test/viewmodels/choose_language_viewmodel_test.dart b/test/viewmodels/choose_language_viewmodel_test.dart index 1e93a2e52..db84b90a7 100644 --- a/test/viewmodels/choose_language_viewmodel_test.dart +++ b/test/viewmodels/choose_language_viewmodel_test.dart @@ -4,11 +4,11 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/viewmodels/choose_language_viewmodel.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/more/settings/choose_language_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/settings_manager_mock.dart'; import '../mock/services/navigation_service_mock.dart'; diff --git a/test/viewmodels/dashboard_viewmodel_test.dart b/test/viewmodels/dashboard_viewmodel_test.dart index ee03a25c5..c2da7c7ee 100644 --- a/test/viewmodels/dashboard_viewmodel_test.dart +++ b/test/viewmodels/dashboard_viewmodel_test.dart @@ -4,10 +4,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/progress_bar_text_options.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/viewmodels/dashboard_viewmodel.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/dashboard/progress_bar_text_options.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/dashboard/dashboard_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/course_repository_mock.dart'; import '../mock/managers/settings_manager_mock.dart'; diff --git a/test/viewmodels/faq_viewmodel_test.dart b/test/viewmodels/faq_viewmodel_test.dart index 7f39739dc..95c0575c9 100644 --- a/test/viewmodels/faq_viewmodel_test.dart +++ b/test/viewmodels/faq_viewmodel_test.dart @@ -6,9 +6,9 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; -import 'package:notredame/core/viewmodels/faq_viewmodel.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/more/faq/faq_viewmodel.dart'; import '../helpers.dart'; import '../mock/services/launch_url_service_mock.dart'; diff --git a/test/viewmodels/feedback_viewmodel_test.dart b/test/viewmodels/feedback_viewmodel_test.dart index b685b2b9b..44d2d36b8 100644 --- a/test/viewmodels/feedback_viewmodel_test.dart +++ b/test/viewmodels/feedback_viewmodel_test.dart @@ -13,12 +13,12 @@ import 'package:image/image.dart' as image; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/feedback_type.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/models/feedback_issue.dart'; -import 'package:notredame/core/services/github_api.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/viewmodels/feedback_viewmodel.dart'; +import 'package:notredame/features/more/feedback/feedback_type.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/more/feedback/models/feedback_issue.dart'; +import 'package:notredame/features/app/integration/github_api.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/more/feedback/feedback_viewmodel.dart'; import '../helpers.dart'; import '../mock/services/github_api_mock.dart'; import '../mock/services/preferences_service_mock.dart'; diff --git a/test/viewmodels/grades_details_viewmodel_test.dart b/test/viewmodels/grades_details_viewmodel_test.dart index a099f4c79..2d1a13dde 100644 --- a/test/viewmodels/grades_details_viewmodel_test.dart +++ b/test/viewmodels/grades_details_viewmodel_test.dart @@ -5,9 +5,9 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/viewmodels/grades_details_viewmodel.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/student/grades/grade_details/grades_details_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/course_repository_mock.dart'; diff --git a/test/viewmodels/grades_viewmodel_test.dart b/test/viewmodels/grades_viewmodel_test.dart index b3be684fb..6f1a94040 100644 --- a/test/viewmodels/grades_viewmodel_test.dart +++ b/test/viewmodels/grades_viewmodel_test.dart @@ -5,10 +5,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/viewmodels/grades_viewmodel.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/student/grades/grades_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/course_repository_mock.dart'; diff --git a/test/viewmodels/login_viewmodel_test.dart b/test/viewmodels/login_viewmodel_test.dart index a96be3d0a..4e9f6ceee 100644 --- a/test/viewmodels/login_viewmodel_test.dart +++ b/test/viewmodels/login_viewmodel_test.dart @@ -4,10 +4,10 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/viewmodels/login_viewmodel.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/welcome/login/login_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/user_repository_mock.dart'; import '../mock/services/navigation_service_mock.dart'; diff --git a/test/viewmodels/more_viewmodel_test.dart b/test/viewmodels/more_viewmodel_test.dart index a6a78203a..37f35847b 100644 --- a/test/viewmodels/more_viewmodel_test.dart +++ b/test/viewmodels/more_viewmodel_test.dart @@ -5,14 +5,14 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/viewmodels/more_viewmodel.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/storage/cache_manager.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/features/more/more_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/cache_manager_mock.dart'; import '../mock/managers/course_repository_mock.dart'; diff --git a/test/viewmodels/not_found_viewmodel_test.dart b/test/viewmodels/not_found_viewmodel_test.dart index 52e228fe7..e415ebc70 100644 --- a/test/viewmodels/not_found_viewmodel_test.dart +++ b/test/viewmodels/not_found_viewmodel_test.dart @@ -4,11 +4,11 @@ import 'package:mockito/mockito.dart'; import 'package:rive/rive.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/rive_animation_service.dart'; -import 'package:notredame/core/viewmodels/not_found_viewmodel.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/presentation/rive_animation_service.dart'; +import 'package:notredame/features/app/error/not_found/not_found_viewmodel.dart'; import '../helpers.dart'; import '../mock/services/analytics_service_mock.dart'; import '../mock/services/navigation_service_mock.dart'; diff --git a/test/viewmodels/profile_viewmodel_test.dart b/test/viewmodels/profile_viewmodel_test.dart index 023e6e3a7..904c1dec5 100644 --- a/test/viewmodels/profile_viewmodel_test.dart +++ b/test/viewmodels/profile_viewmodel_test.dart @@ -4,9 +4,9 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/programs_credits.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/viewmodels/profile_viewmodel.dart'; +import 'package:notredame/features/student/profile/programs_credits.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/student/profile/profile_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/user_repository_mock.dart'; diff --git a/test/viewmodels/quick_links_viewmodel_test.dart b/test/viewmodels/quick_links_viewmodel_test.dart index 71abbb2b1..891952500 100644 --- a/test/viewmodels/quick_links_viewmodel_test.dart +++ b/test/viewmodels/quick_links_viewmodel_test.dart @@ -3,11 +3,11 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/core/constants/quick_links.dart'; -import 'package:notredame/core/managers/quick_link_repository.dart'; -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/models/quick_link_data.dart'; -import 'package:notredame/core/viewmodels/quick_links_viewmodel.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_links.dart'; +import 'package:notredame/features/app/repository/quick_link_repository.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link_data.dart'; +import 'package:notredame/features/ets/quick-link/quick_links_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/quick_links_repository_mock.dart'; diff --git a/test/viewmodels/schedule_default_viewmodel_test.dart b/test/viewmodels/schedule_default_viewmodel_test.dart index 134afbe28..751a2f131 100644 --- a/test/viewmodels/schedule_default_viewmodel_test.dart +++ b/test/viewmodels/schedule_default_viewmodel_test.dart @@ -7,8 +7,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/viewmodels/schedule_default_viewmodel.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/student/grades/schedule_default/schedule_default_viewmodel.dart'; import '../helpers.dart'; void main() { diff --git a/test/viewmodels/schedule_settings_viewmodel_test.dart b/test/viewmodels/schedule_settings_viewmodel_test.dart index 0d9b1f70b..15344538f 100644 --- a/test/viewmodels/schedule_settings_viewmodel_test.dart +++ b/test/viewmodels/schedule_settings_viewmodel_test.dart @@ -6,9 +6,9 @@ import 'package:mockito/mockito.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/viewmodels/schedule_settings_viewmodel.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/schedule/schedule_settings_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/course_repository_mock.dart'; import '../mock/managers/settings_manager_mock.dart'; diff --git a/test/viewmodels/schedule_viewmodel_test.dart b/test/viewmodels/schedule_viewmodel_test.dart index 91f16e108..daf430640 100644 --- a/test/viewmodels/schedule_viewmodel_test.dart +++ b/test/viewmodels/schedule_viewmodel_test.dart @@ -6,10 +6,10 @@ import 'package:mockito/mockito.dart'; import 'package:table_calendar/table_calendar.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/viewmodels/schedule_viewmodel.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/repository/course_repository.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/schedule/schedule_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/course_repository_mock.dart'; import '../mock/managers/settings_manager_mock.dart'; diff --git a/test/viewmodels/settings_viewmodel_test.dart b/test/viewmodels/settings_viewmodel_test.dart index a3d01d24e..8d0138a25 100644 --- a/test/viewmodels/settings_viewmodel_test.dart +++ b/test/viewmodels/settings_viewmodel_test.dart @@ -7,9 +7,9 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/viewmodels/settings_viewmodel.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/more/settings/settings_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/settings_manager_mock.dart'; diff --git a/test/viewmodels/startup_viewmodel_test.dart b/test/viewmodels/startup_viewmodel_test.dart index 211173905..2beb4ec01 100644 --- a/test/viewmodels/startup_viewmodel_test.dart +++ b/test/viewmodels/startup_viewmodel_test.dart @@ -4,15 +4,15 @@ import 'package:mockito/mockito.dart'; import 'package:pub_semver/pub_semver.dart'; // Project imports: -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/constants/update_code.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/services/siren_flutter_service.dart'; -import 'package:notredame/core/viewmodels/startup_viewmodel.dart'; +import 'package:notredame/constants/preferences_flags.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/constants/update_code.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/app/repository/user_repository.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/app/storage/preferences_service.dart'; +import 'package:notredame/features/app/storage/siren_flutter_service.dart'; +import 'package:notredame/features/app/startup/startup_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/settings_manager_mock.dart'; import '../mock/managers/user_repository_mock.dart'; diff --git a/test/viewmodels/web_link_card_viewmodel_test.dart b/test/viewmodels/web_link_card_viewmodel_test.dart index 290c835dd..a2b9b7236 100644 --- a/test/viewmodels/web_link_card_viewmodel_test.dart +++ b/test/viewmodels/web_link_card_viewmodel_test.dart @@ -6,13 +6,13 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; // Project imports: -import 'package:notredame/core/constants/router_paths.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/models/quick_link.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/internal_info_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/viewmodels/web_link_card_viewmodel.dart'; +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/more/settings/settings_manager.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/error/internal_info_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/features/ets/web_link_card_viewmodel.dart'; import '../helpers.dart'; import '../mock/services/analytics_service_mock.dart'; import '../mock/services/internal_info_service_mock.dart'; From c15baae2839a7251f7887e54eab396bdc5ea1813 Mon Sep 17 00:00:00 2001 From: Hzdotexe <58271093+Hzdotexe@users.noreply.github.com> Date: Wed, 19 Jun 2024 12:12:12 -0400 Subject: [PATCH 2/4] refactoring ets + delete unused imports --- lib/features/app/navigation/router.dart | 8 ++++---- lib/features/ets/ets_view.dart | 2 +- .../{ => events}/author/author_info_skeleton.dart | 0 .../ets/{ => events}/author/author_view.dart | 12 ++++++------ .../ets/{ => events}/author/author_viewmodel.dart | 0 .../news/news-details/news_details_view.dart | 4 ++-- .../news/news-details/news_details_viewmodel.dart | 0 lib/features/ets/{ => events}/news/news_card.dart | 0 .../ets/{ => events}/news/news_card_skeleton.dart | 0 lib/features/ets/{ => events}/news/news_view.dart | 6 +++--- .../ets/{ => events}/news/news_viewmodel.dart | 0 .../{ => events}/report-news/models/report_news.dart | 0 .../ets/{ => events}/report-news/report_news.dart | 2 +- .../report-news/report_news_viewmodel.dart | 0 lib/features/ets/{ => events}/report_news.dart | 4 ++-- .../ets/{ => events}/social/models/social_link.dart | 0 .../ets/{ => events}/social/social_links_card.dart | 4 ++-- lib/features/ets/quick-link/quick_links_view.dart | 4 +--- .../{ => web-link}/security-info/emergency_view.dart | 0 .../security-info/models/emergency_procedure.dart | 0 .../security-info/models/emergency_procedures.dart | 2 +- .../{ => web-link}/security-info/security_view.dart | 4 ++-- .../security-info/security_viewmodel.dart | 4 ++-- lib/features/ets/{ => web-link}/web_link_card.dart | 2 +- .../ets/{ => web-link}/web_link_card_viewmodel.dart | 0 test/models/report_news_test.dart | 2 +- test/ui/views/author_view_test.dart | 6 +++--- test/ui/views/emergency_view_test.dart | 2 +- test/ui/views/news_details_view_test.dart | 2 +- test/ui/views/news_view_test.dart | 4 ++-- test/ui/views/quick_links_view_test.dart | 2 +- test/ui/views/security_view_test.dart | 4 ++-- test/ui/widgets/author_info_skeleton_test.dart | 2 +- test/ui/widgets/base_scaffold_test.dart | 1 - test/ui/widgets/news_card_test.dart | 2 +- test/ui/widgets/news_skeleton_test.dart | 2 +- test/ui/widgets/web_link_card_test.dart | 2 +- test/viewmodels/author_viewmodel_test.dart | 2 +- test/viewmodels/news_details_viewmodel_test.dart | 2 +- test/viewmodels/news_viewmodel_test.dart | 2 +- test/viewmodels/web_link_card_viewmodel_test.dart | 2 +- 41 files changed, 47 insertions(+), 50 deletions(-) rename lib/features/ets/{ => events}/author/author_info_skeleton.dart (100%) rename lib/features/ets/{ => events}/author/author_view.dart (97%) rename lib/features/ets/{ => events}/author/author_viewmodel.dart (100%) rename lib/features/ets/{ => events}/news/news-details/news_details_view.dart (99%) rename lib/features/ets/{ => events}/news/news-details/news_details_viewmodel.dart (100%) rename lib/features/ets/{ => events}/news/news_card.dart (100%) rename lib/features/ets/{ => events}/news/news_card_skeleton.dart (100%) rename lib/features/ets/{ => events}/news/news_view.dart (97%) rename lib/features/ets/{ => events}/news/news_viewmodel.dart (100%) rename lib/features/ets/{ => events}/report-news/models/report_news.dart (100%) rename lib/features/ets/{ => events}/report-news/report_news.dart (92%) rename lib/features/ets/{ => events}/report-news/report_news_viewmodel.dart (100%) rename lib/features/ets/{ => events}/report_news.dart (97%) rename lib/features/ets/{ => events}/social/models/social_link.dart (100%) rename lib/features/ets/{ => events}/social/social_links_card.dart (96%) rename lib/features/ets/{ => web-link}/security-info/emergency_view.dart (100%) rename lib/features/ets/{ => web-link}/security-info/models/emergency_procedure.dart (100%) rename lib/features/ets/{ => web-link}/security-info/models/emergency_procedures.dart (94%) rename lib/features/ets/{ => web-link}/security-info/security_view.dart (97%) rename lib/features/ets/{ => web-link}/security-info/security_viewmodel.dart (89%) rename lib/features/ets/{ => web-link}/web_link_card.dart (95%) rename lib/features/ets/{ => web-link}/web_link_card_viewmodel.dart (100%) diff --git a/lib/features/app/navigation/router.dart b/lib/features/app/navigation/router.dart index 18083d6c6..a77d5cd78 100644 --- a/lib/features/app/navigation/router.dart +++ b/lib/features/app/navigation/router.dart @@ -7,10 +7,10 @@ import 'package:ets_api_clients/models.dart'; // Project imports: import 'package:notredame/features/app/navigation/router_paths.dart'; import 'package:notredame/constants/update_code.dart'; -import 'package:notredame/features/ets/author/author_view.dart'; +import 'package:notredame/features/ets/events/author/author_view.dart'; import 'package:notredame/features/ets/ets_view.dart'; -import 'package:notredame/features/ets/news/news-details/news_details_view.dart'; -import 'package:notredame/features/ets/news/news_view.dart'; +import 'package:notredame/features/ets/events/news/news-details/news_details_view.dart'; +import 'package:notredame/features/ets/events/news/news_view.dart'; import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; import 'package:notredame/features/more/about/about_view.dart'; import 'package:notredame/features/more/settings/choose_language_view.dart'; @@ -26,7 +26,7 @@ import 'package:notredame/features/app/error/outage/outage_view.dart'; import 'package:notredame/features/ets/quick-link/quick_links_view.dart'; import 'package:notredame/features/schedule/schedule_default/schedule_default_view.dart'; import 'package:notredame/features/schedule/schedule_view.dart'; -import 'package:notredame/features/ets/security-info/security_view.dart'; +import 'package:notredame/features/ets/web-link/security-info/security_view.dart'; import 'package:notredame/features/more/settings/settings_view.dart'; import 'package:notredame/features/app/startup/startup_view.dart'; import 'package:notredame/features/student/student_view.dart'; diff --git a/lib/features/ets/ets_view.dart b/lib/features/ets/ets_view.dart index 994b57f7e..88cc8e888 100644 --- a/lib/features/ets/ets_view.dart +++ b/lib/features/ets/ets_view.dart @@ -7,7 +7,7 @@ import 'package:notredame/features/app/analytics/remote_config_service.dart'; import 'package:notredame/utils/locator.dart'; // Project imports: -import 'package:notredame/features/ets/news/news_view.dart'; +import 'package:notredame/features/ets/events/news/news_view.dart'; import 'package:notredame/features/ets/quick-link//quick_links_view.dart'; import 'package:notredame/features/app/widgets/base_scaffold.dart'; diff --git a/lib/features/ets/author/author_info_skeleton.dart b/lib/features/ets/events/author/author_info_skeleton.dart similarity index 100% rename from lib/features/ets/author/author_info_skeleton.dart rename to lib/features/ets/events/author/author_info_skeleton.dart diff --git a/lib/features/ets/author/author_view.dart b/lib/features/ets/events/author/author_view.dart similarity index 97% rename from lib/features/ets/author/author_view.dart rename to lib/features/ets/events/author/author_view.dart index 75fb69595..124fc51a9 100644 --- a/lib/features/ets/author/author_view.dart +++ b/lib/features/ets/events/author/author_view.dart @@ -6,18 +6,18 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart'; -import 'package:notredame/features/ets/social/models/social_link.dart'; +import 'package:notredame/features/ets/events/social/models/social_link.dart'; import 'package:stacked/stacked.dart'; // Project imports: import 'package:notredame/utils/utils.dart'; -import 'package:notredame/features/ets/author/author_viewmodel.dart'; +import 'package:notredame/features/ets/events/author/author_viewmodel.dart'; import 'package:notredame/utils/app_theme.dart'; -import 'package:notredame/features/ets/author/author_info_skeleton.dart'; +import 'package:notredame/features/ets/events/author/author_info_skeleton.dart'; import 'package:notredame/features/app/widgets/base_scaffold.dart'; -import 'package:notredame/features/ets/news/news_card.dart'; -import 'package:notredame/features/ets/news/news_card_skeleton.dart'; -import 'package:notredame/features/ets/social/social_links_card.dart'; +import 'package:notredame/features/ets/events/news/news_card.dart'; +import 'package:notredame/features/ets/events/news/news_card_skeleton.dart'; +import 'package:notredame/features/ets/events/social/social_links_card.dart'; class AuthorView extends StatefulWidget { final String authorId; diff --git a/lib/features/ets/author/author_viewmodel.dart b/lib/features/ets/events/author/author_viewmodel.dart similarity index 100% rename from lib/features/ets/author/author_viewmodel.dart rename to lib/features/ets/events/author/author_viewmodel.dart diff --git a/lib/features/ets/news/news-details/news_details_view.dart b/lib/features/ets/events/news/news-details/news_details_view.dart similarity index 99% rename from lib/features/ets/news/news-details/news_details_view.dart rename to lib/features/ets/events/news/news-details/news_details_view.dart index 0ceaf2abe..113962171 100644 --- a/lib/features/ets/news/news-details/news_details_view.dart +++ b/lib/features/ets/events/news/news-details/news_details_view.dart @@ -8,7 +8,7 @@ import 'package:flutter_markdown/flutter_markdown.dart'; import 'package:flutter_svg/svg.dart'; import 'package:intl/intl.dart'; import 'package:notredame/features/app/analytics/remote_config_service.dart'; -import 'package:notredame/features/ets/report_news.dart'; +import 'package:notredame/features/ets/events/report_news.dart'; import 'package:notredame/utils/utils.dart'; import 'package:notredame/features/schedule/calendar_selection_viewmodel.dart'; import 'package:notredame/features/schedule/widgets/calendar_selector.dart'; @@ -19,7 +19,7 @@ import 'package:stacked/stacked.dart'; import 'package:notredame/features/app/navigation/router_paths.dart'; import 'package:notredame/features/app/analytics/analytics_service.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; -import 'package:notredame/features/ets/news/news-details/news_details_viewmodel.dart'; +import 'package:notredame/features/ets/events/news/news-details/news_details_viewmodel.dart'; import 'package:notredame/utils/locator.dart'; import 'package:notredame/utils/app_theme.dart'; import 'package:notredame/features/app/widgets/base_scaffold.dart'; diff --git a/lib/features/ets/news/news-details/news_details_viewmodel.dart b/lib/features/ets/events/news/news-details/news_details_viewmodel.dart similarity index 100% rename from lib/features/ets/news/news-details/news_details_viewmodel.dart rename to lib/features/ets/events/news/news-details/news_details_viewmodel.dart diff --git a/lib/features/ets/news/news_card.dart b/lib/features/ets/events/news/news_card.dart similarity index 100% rename from lib/features/ets/news/news_card.dart rename to lib/features/ets/events/news/news_card.dart diff --git a/lib/features/ets/news/news_card_skeleton.dart b/lib/features/ets/events/news/news_card_skeleton.dart similarity index 100% rename from lib/features/ets/news/news_card_skeleton.dart rename to lib/features/ets/events/news/news_card_skeleton.dart diff --git a/lib/features/ets/news/news_view.dart b/lib/features/ets/events/news/news_view.dart similarity index 97% rename from lib/features/ets/news/news_view.dart rename to lib/features/ets/events/news/news_view.dart index 733e3d9e9..d540b8765 100644 --- a/lib/features/ets/news/news_view.dart +++ b/lib/features/ets/events/news/news_view.dart @@ -10,9 +10,9 @@ import 'package:stacked/stacked.dart'; import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart'; // Project imports: -import 'package:notredame/features/ets/news/news_viewmodel.dart'; -import 'package:notredame/features/ets/news/news_card.dart'; -import 'package:notredame/features/ets/news/news_card_skeleton.dart'; +import 'package:notredame/features/ets/events/news/news_viewmodel.dart'; +import 'package:notredame/features/ets/events/news/news_card.dart'; +import 'package:notredame/features/ets/events/news/news_card_skeleton.dart'; class NewsView extends StatefulWidget { @override diff --git a/lib/features/ets/news/news_viewmodel.dart b/lib/features/ets/events/news/news_viewmodel.dart similarity index 100% rename from lib/features/ets/news/news_viewmodel.dart rename to lib/features/ets/events/news/news_viewmodel.dart diff --git a/lib/features/ets/report-news/models/report_news.dart b/lib/features/ets/events/report-news/models/report_news.dart similarity index 100% rename from lib/features/ets/report-news/models/report_news.dart rename to lib/features/ets/events/report-news/models/report_news.dart diff --git a/lib/features/ets/report-news/report_news.dart b/lib/features/ets/events/report-news/report_news.dart similarity index 92% rename from lib/features/ets/report-news/report_news.dart rename to lib/features/ets/events/report-news/report_news.dart index 741693fbc..bffb91273 100644 --- a/lib/features/ets/report-news/report_news.dart +++ b/lib/features/ets/events/report-news/report_news.dart @@ -1,6 +1,6 @@ // Project imports: import 'package:flutter/material.dart'; -import 'package:notredame/features/ets/report-news/models/report_news.dart'; +import 'package:notredame/features/ets/events/report-news/models/report_news.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; List getLocalizedReportNewsItems(BuildContext context) { diff --git a/lib/features/ets/report-news/report_news_viewmodel.dart b/lib/features/ets/events/report-news/report_news_viewmodel.dart similarity index 100% rename from lib/features/ets/report-news/report_news_viewmodel.dart rename to lib/features/ets/events/report-news/report_news_viewmodel.dart diff --git a/lib/features/ets/report_news.dart b/lib/features/ets/events/report_news.dart similarity index 97% rename from lib/features/ets/report_news.dart rename to lib/features/ets/events/report_news.dart index 9abfba4b5..9a63c7f02 100644 --- a/lib/features/ets/report_news.dart +++ b/lib/features/ets/events/report_news.dart @@ -8,9 +8,9 @@ import 'package:notredame/utils/app_theme.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/features/ets/report-news/report_news.dart'; +import 'package:notredame/features/ets/events/report-news/report_news.dart'; import 'package:notredame/utils/utils.dart'; -import 'package:notredame/features/ets/report-news/report_news_viewmodel.dart'; +import 'package:notredame/features/ets/events/report-news/report_news_viewmodel.dart'; class ReportNews extends StatefulWidget { final bool showHandle; diff --git a/lib/features/ets/social/models/social_link.dart b/lib/features/ets/events/social/models/social_link.dart similarity index 100% rename from lib/features/ets/social/models/social_link.dart rename to lib/features/ets/events/social/models/social_link.dart diff --git a/lib/features/ets/social/social_links_card.dart b/lib/features/ets/events/social/social_links_card.dart similarity index 96% rename from lib/features/ets/social/social_links_card.dart rename to lib/features/ets/events/social/social_links_card.dart index 803451018..e67ddf699 100644 --- a/lib/features/ets/social/social_links_card.dart +++ b/lib/features/ets/events/social/social_links_card.dart @@ -6,9 +6,9 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/features/ets/social/models/social_link.dart'; +import 'package:notredame/features/ets/events/social/models/social_link.dart'; import 'package:notredame/utils/utils.dart'; -import 'package:notredame/features/ets/web_link_card_viewmodel.dart'; +import 'package:notredame/features/ets/web-link/web_link_card_viewmodel.dart'; import 'package:notredame/utils/app_theme.dart'; class SocialLinks extends StatefulWidget { diff --git a/lib/features/ets/quick-link/quick_links_view.dart b/lib/features/ets/quick-link/quick_links_view.dart index e11f574bb..db65219c5 100644 --- a/lib/features/ets/quick-link/quick_links_view.dart +++ b/lib/features/ets/quick-link/quick_links_view.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; // Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:notredame/features/ets/web_link_card.dart'; +import 'package:notredame/features/ets/web-link/web_link_card.dart'; import 'package:reorderable_grid_view/reorderable_grid_view.dart'; import 'package:stacked/stacked.dart'; @@ -11,8 +11,6 @@ import 'package:stacked/stacked.dart'; import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; import 'package:notredame/features/ets/quick-link/quick_links_viewmodel.dart'; import 'package:notredame/utils/app_theme.dart'; -import 'package:notredame/features/app/widgets/base_scaffold.dart'; -import 'package:notredame/features/ets/web_link_card.dart'; class QuickLinksView extends StatefulWidget { @override diff --git a/lib/features/ets/security-info/emergency_view.dart b/lib/features/ets/web-link/security-info/emergency_view.dart similarity index 100% rename from lib/features/ets/security-info/emergency_view.dart rename to lib/features/ets/web-link/security-info/emergency_view.dart diff --git a/lib/features/ets/security-info/models/emergency_procedure.dart b/lib/features/ets/web-link/security-info/models/emergency_procedure.dart similarity index 100% rename from lib/features/ets/security-info/models/emergency_procedure.dart rename to lib/features/ets/web-link/security-info/models/emergency_procedure.dart diff --git a/lib/features/ets/security-info/models/emergency_procedures.dart b/lib/features/ets/web-link/security-info/models/emergency_procedures.dart similarity index 94% rename from lib/features/ets/security-info/models/emergency_procedures.dart rename to lib/features/ets/web-link/security-info/models/emergency_procedures.dart index 1e84c6afe..5c67c8650 100644 --- a/lib/features/ets/security-info/models/emergency_procedures.dart +++ b/lib/features/ets/web-link/security-info/models/emergency_procedures.dart @@ -2,7 +2,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Project imports: -import 'package:notredame/features/ets/security-info/models/emergency_procedure.dart'; +import 'package:notredame/features/ets/web-link/security-info/models/emergency_procedure.dart'; List emergencyProcedures(AppIntl intl) => [ EmergencyProcedure( diff --git a/lib/features/ets/security-info/security_view.dart b/lib/features/ets/web-link/security-info/security_view.dart similarity index 97% rename from lib/features/ets/security-info/security_view.dart rename to lib/features/ets/web-link/security-info/security_view.dart index 96600b5be..9e0728082 100644 --- a/lib/features/ets/security-info/security_view.dart +++ b/lib/features/ets/web-link/security-info/security_view.dart @@ -10,9 +10,9 @@ import 'package:stacked/stacked.dart'; // Project imports: import 'package:notredame/utils/utils.dart'; -import 'package:notredame/features/ets/security-info/security_viewmodel.dart'; +import 'package:notredame/features/ets/web-link/security-info/security_viewmodel.dart'; import 'package:notredame/utils/app_theme.dart'; -import 'package:notredame/features/ets/security-info/emergency_view.dart'; +import 'package:notredame/features/ets/web-link/security-info/emergency_view.dart'; class SecurityView extends StatefulWidget { @override diff --git a/lib/features/ets/security-info/security_viewmodel.dart b/lib/features/ets/web-link/security-info/security_viewmodel.dart similarity index 89% rename from lib/features/ets/security-info/security_viewmodel.dart rename to lib/features/ets/web-link/security-info/security_viewmodel.dart index 5eea92d7b..09239d340 100644 --- a/lib/features/ets/security-info/security_viewmodel.dart +++ b/lib/features/ets/web-link/security-info/security_viewmodel.dart @@ -8,9 +8,9 @@ import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:stacked/stacked.dart'; // Project imports: -import 'package:notredame/features/ets/security-info/models/emergency_procedures.dart'; +import 'package:notredame/features/ets/web-link/security-info/models/emergency_procedures.dart'; import 'package:notredame/constants/markers.dart'; -import 'package:notredame/features/ets/security-info/models/emergency_procedure.dart'; +import 'package:notredame/features/ets/web-link/security-info/models/emergency_procedure.dart'; class SecurityViewModel extends BaseViewModel { GoogleMapController? controller; diff --git a/lib/features/ets/web_link_card.dart b/lib/features/ets/web-link/web_link_card.dart similarity index 95% rename from lib/features/ets/web_link_card.dart rename to lib/features/ets/web-link/web_link_card.dart index 783488603..246a7c24a 100644 --- a/lib/features/ets/web_link_card.dart +++ b/lib/features/ets/web-link/web_link_card.dart @@ -6,7 +6,7 @@ import 'package:stacked/stacked.dart'; // Project imports: import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; -import 'package:notredame/features/ets/web_link_card_viewmodel.dart'; +import 'package:notredame/features/ets/web-link/web_link_card_viewmodel.dart'; import 'package:notredame/utils/app_theme.dart'; class WebLinkCard extends StatelessWidget { diff --git a/lib/features/ets/web_link_card_viewmodel.dart b/lib/features/ets/web-link/web_link_card_viewmodel.dart similarity index 100% rename from lib/features/ets/web_link_card_viewmodel.dart rename to lib/features/ets/web-link/web_link_card_viewmodel.dart diff --git a/test/models/report_news_test.dart b/test/models/report_news_test.dart index 05606e0ea..d4e956d12 100644 --- a/test/models/report_news_test.dart +++ b/test/models/report_news_test.dart @@ -2,7 +2,7 @@ import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/features/ets/report-news/models/report_news.dart'; +import 'package:notredame/features/ets/events/report-news/models/report_news.dart'; void main() { group('ReportNews class tests', () { diff --git a/test/ui/views/author_view_test.dart b/test/ui/views/author_view_test.dart index 4da7c4ebd..71933911c 100644 --- a/test/ui/views/author_view_test.dart +++ b/test/ui/views/author_view_test.dart @@ -17,9 +17,9 @@ import 'package:notredame/features/app/analytics/analytics_service.dart'; import 'package:notredame/features/app/integration/launch_url_service.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; import 'package:notredame/features/app/integration/networking_service.dart'; -import 'package:notredame/features/ets/author/author_view.dart'; -import 'package:notredame/features/ets/news/news_card.dart'; -import 'package:notredame/features/ets/social/social_links_card.dart'; +import 'package:notredame/features/ets/events/author/author_view.dart'; +import 'package:notredame/features/ets/events/news/news_card.dart'; +import 'package:notredame/features/ets/events/social/social_links_card.dart'; import '../../helpers.dart'; import '../../mock/managers/author_repository_mock.dart'; import '../../mock/managers/news_repository_mock.dart'; diff --git a/test/ui/views/emergency_view_test.dart b/test/ui/views/emergency_view_test.dart index 4cf60e4b7..07764dcf2 100644 --- a/test/ui/views/emergency_view_test.dart +++ b/test/ui/views/emergency_view_test.dart @@ -7,7 +7,7 @@ import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter_android/webview_flutter_android.dart'; // Project imports: -import 'package:notredame/features/ets/security-info/emergency_view.dart'; +import 'package:notredame/features/ets/web-link/security-info/emergency_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/views/news_details_view_test.dart b/test/ui/views/news_details_view_test.dart index 3b9d65a92..c4cd57f52 100644 --- a/test/ui/views/news_details_view_test.dart +++ b/test/ui/views/news_details_view_test.dart @@ -13,7 +13,7 @@ import 'package:notredame/features/app/analytics/analytics_service.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; import 'package:notredame/features/app/integration/networking_service.dart'; import 'package:notredame/features/app/analytics/remote_config_service.dart'; -import 'package:notredame/features/ets/news/news-details/news_details_view.dart'; +import 'package:notredame/features/ets/events/news/news-details/news_details_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/views/news_view_test.dart b/test/ui/views/news_view_test.dart index a0277a2af..961fb7d1b 100644 --- a/test/ui/views/news_view_test.dart +++ b/test/ui/views/news_view_test.dart @@ -13,8 +13,8 @@ import 'package:notredame/features/app/repository/news_repository.dart'; import 'package:notredame/features/more/settings/settings_manager.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; import 'package:notredame/features/app/integration/networking_service.dart'; -import 'package:notredame/features/ets/news/news_view.dart'; -import 'package:notredame/features/ets/news/news_card.dart'; +import 'package:notredame/features/ets/events/news/news_view.dart'; +import 'package:notredame/features/ets/events/news/news_card.dart'; import '../../helpers.dart'; import '../../mock/managers/news_repository_mock.dart'; diff --git a/test/ui/views/quick_links_view_test.dart b/test/ui/views/quick_links_view_test.dart index 0538fb767..1b6868116 100644 --- a/test/ui/views/quick_links_view_test.dart +++ b/test/ui/views/quick_links_view_test.dart @@ -15,7 +15,7 @@ import 'package:notredame/features/app/repository/quick_link_repository.dart'; import 'package:notredame/features/app/integration/launch_url_service.dart'; import 'package:notredame/features/app/integration/networking_service.dart'; import 'package:notredame/features/ets/quick-link/quick_links_view.dart'; -import 'package:notredame/features/ets/web_link_card.dart'; +import 'package:notredame/features/ets/web-link/web_link_card.dart'; import '../../helpers.dart'; import '../../mock/managers/quick_links_repository_mock.dart'; import '../../mock/services/analytics_service_mock.dart'; diff --git a/test/ui/views/security_view_test.dart b/test/ui/views/security_view_test.dart index 2ce322642..6cc5634ca 100644 --- a/test/ui/views/security_view_test.dart +++ b/test/ui/views/security_view_test.dart @@ -7,8 +7,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; // Project imports: -import 'package:notredame/features/ets/security-info/models/emergency_procedures.dart'; -import 'package:notredame/features/ets/security-info/security_view.dart'; +import 'package:notredame/features/ets/web-link/security-info/models/emergency_procedures.dart'; +import 'package:notredame/features/ets/web-link/security-info/security_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/author_info_skeleton_test.dart b/test/ui/widgets/author_info_skeleton_test.dart index d2c4f88de..f60b1f116 100644 --- a/test/ui/widgets/author_info_skeleton_test.dart +++ b/test/ui/widgets/author_info_skeleton_test.dart @@ -3,7 +3,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shimmer/shimmer.dart'; // Project imports: -import 'package:notredame/features/ets/author/author_info_skeleton.dart'; +import 'package:notredame/features/ets/events/author/author_info_skeleton.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/base_scaffold_test.dart b/test/ui/widgets/base_scaffold_test.dart index 6abb3f445..c3a626db1 100644 --- a/test/ui/widgets/base_scaffold_test.dart +++ b/test/ui/widgets/base_scaffold_test.dart @@ -9,7 +9,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; import 'package:notredame/features/app/integration/networking_service.dart'; import 'package:notredame/features/app/widgets/base_scaffold.dart'; -import 'package:notredame/features/app/widgets/bottom_bar.dart'; import '../../helpers.dart'; import '../../mock/services/analytics_service_mock.dart'; diff --git a/test/ui/widgets/news_card_test.dart b/test/ui/widgets/news_card_test.dart index 44c540536..9d4babbee 100644 --- a/test/ui/widgets/news_card_test.dart +++ b/test/ui/widgets/news_card_test.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/features/ets/news/news_card.dart'; +import 'package:notredame/features/ets/events/news/news_card.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/news_skeleton_test.dart b/test/ui/widgets/news_skeleton_test.dart index 1e0ebde64..d836c27c2 100644 --- a/test/ui/widgets/news_skeleton_test.dart +++ b/test/ui/widgets/news_skeleton_test.dart @@ -3,7 +3,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shimmer/shimmer.dart'; // Project imports: -import 'package:notredame/features/ets/news/news_card_skeleton.dart'; +import 'package:notredame/features/ets/events/news/news_card_skeleton.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/web_link_card_test.dart b/test/ui/widgets/web_link_card_test.dart index 49f4cb8bc..2744d90df 100644 --- a/test/ui/widgets/web_link_card_test.dart +++ b/test/ui/widgets/web_link_card_test.dart @@ -10,7 +10,7 @@ import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; import 'package:notredame/features/app/analytics/analytics_service.dart'; import 'package:notredame/features/app/error/internal_info_service.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; -import 'package:notredame/features/ets/web_link_card.dart'; +import 'package:notredame/features/ets/web-link/web_link_card.dart'; import '../../helpers.dart'; import '../../mock/services/analytics_service_mock.dart'; import '../../mock/services/launch_url_service_mock.dart'; diff --git a/test/viewmodels/author_viewmodel_test.dart b/test/viewmodels/author_viewmodel_test.dart index 40718712e..70f977345 100644 --- a/test/viewmodels/author_viewmodel_test.dart +++ b/test/viewmodels/author_viewmodel_test.dart @@ -8,7 +8,7 @@ import 'package:mockito/mockito.dart'; // Project imports: import 'package:notredame/features/app/repository/author_repository.dart'; import 'package:notredame/features/app/repository/news_repository.dart'; -import 'package:notredame/features/ets/author/author_viewmodel.dart'; +import 'package:notredame/features/ets/events/author/author_viewmodel.dart'; import '../helpers.dart'; import '../mock/managers/author_repository_mock.dart'; import '../mock/managers/news_repository_mock.dart'; diff --git a/test/viewmodels/news_details_viewmodel_test.dart b/test/viewmodels/news_details_viewmodel_test.dart index c90cac1f1..1f85084ed 100644 --- a/test/viewmodels/news_details_viewmodel_test.dart +++ b/test/viewmodels/news_details_viewmodel_test.dart @@ -3,7 +3,7 @@ import 'package:ets_api_clients/models.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/features/ets/news/news-details/news_details_viewmodel.dart'; +import 'package:notredame/features/ets/events/news/news-details/news_details_viewmodel.dart'; import 'package:notredame/utils/app_theme.dart'; void main() { diff --git a/test/viewmodels/news_viewmodel_test.dart b/test/viewmodels/news_viewmodel_test.dart index 4817bca9f..737b5554e 100644 --- a/test/viewmodels/news_viewmodel_test.dart +++ b/test/viewmodels/news_viewmodel_test.dart @@ -6,7 +6,7 @@ import 'package:mockito/mockito.dart'; // Project imports: import 'package:notredame/features/app/repository/news_repository.dart'; import 'package:notredame/features/more/settings/settings_manager.dart'; -import 'package:notredame/features/ets/news/news_viewmodel.dart'; +import 'package:notredame/features/ets/events/news/news_viewmodel.dart'; import 'package:notredame/utils/locator.dart'; import '../helpers.dart'; import '../mock/managers/news_repository_mock.dart'; diff --git a/test/viewmodels/web_link_card_viewmodel_test.dart b/test/viewmodels/web_link_card_viewmodel_test.dart index a2b9b7236..2b71dc88b 100644 --- a/test/viewmodels/web_link_card_viewmodel_test.dart +++ b/test/viewmodels/web_link_card_viewmodel_test.dart @@ -12,7 +12,7 @@ import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; import 'package:notredame/features/app/analytics/analytics_service.dart'; import 'package:notredame/features/app/error/internal_info_service.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; -import 'package:notredame/features/ets/web_link_card_viewmodel.dart'; +import 'package:notredame/features/ets/web-link/web_link_card_viewmodel.dart'; import '../helpers.dart'; import '../mock/services/analytics_service_mock.dart'; import '../mock/services/internal_info_service_mock.dart'; From 93379d80421c31072337691612652b72fcdf1d7c Mon Sep 17 00:00:00 2001 From: Xavier Paquet-Rapold Date: Sat, 22 Jun 2024 21:24:37 -0400 Subject: [PATCH 3/4] Fixe events structure --- lib/features/app/navigation/router.dart | 2 +- .../ets/events/author/author_view.dart | 4 +- .../news/news-details/news_details_view.dart | 2 +- lib/features/ets/events/news/news_card.dart | 128 ---------- .../ets/events/news/news_card_skeleton.dart | 98 -------- lib/features/ets/events/news/news_view.dart | 4 +- lib/features/ets/events/report_news.dart | 220 ------------------ .../ets/events/social/social_links_card.dart | 2 +- .../ets/quick-link/quick_links_view.dart | 2 +- .../security-info/emergency_view.dart | 50 ---- .../models/emergency_procedure.dart | 6 - .../models/emergency_procedures.dart | 38 --- .../web-link/security-info/security_view.dart | 139 ----------- .../security-info/security_viewmodel.dart | 54 ----- lib/features/ets/web-link/web_link_card.dart | 54 ----- .../ets/web-link/web_link_card_viewmodel.dart | 43 ---- test/ui/views/author_view_test.dart | 2 +- test/ui/views/emergency_view_test.dart | 2 +- test/ui/views/news_view_test.dart | 2 +- test/ui/views/quick_links_view_test.dart | 2 +- test/ui/views/security_view_test.dart | 4 +- test/ui/widgets/news_card_test.dart | 2 +- test/ui/widgets/news_skeleton_test.dart | 2 +- test/ui/widgets/web_link_card_test.dart | 2 +- .../web_link_card_viewmodel_test.dart | 2 +- 25 files changed, 18 insertions(+), 848 deletions(-) delete mode 100644 lib/features/ets/events/news/news_card.dart delete mode 100644 lib/features/ets/events/news/news_card_skeleton.dart delete mode 100644 lib/features/ets/events/report_news.dart delete mode 100644 lib/features/ets/web-link/security-info/emergency_view.dart delete mode 100644 lib/features/ets/web-link/security-info/models/emergency_procedure.dart delete mode 100644 lib/features/ets/web-link/security-info/models/emergency_procedures.dart delete mode 100644 lib/features/ets/web-link/security-info/security_view.dart delete mode 100644 lib/features/ets/web-link/security-info/security_viewmodel.dart delete mode 100644 lib/features/ets/web-link/web_link_card.dart delete mode 100644 lib/features/ets/web-link/web_link_card_viewmodel.dart diff --git a/lib/features/app/navigation/router.dart b/lib/features/app/navigation/router.dart index a77d5cd78..f3b77d52d 100644 --- a/lib/features/app/navigation/router.dart +++ b/lib/features/app/navigation/router.dart @@ -26,7 +26,7 @@ import 'package:notredame/features/app/error/outage/outage_view.dart'; import 'package:notredame/features/ets/quick-link/quick_links_view.dart'; import 'package:notredame/features/schedule/schedule_default/schedule_default_view.dart'; import 'package:notredame/features/schedule/schedule_view.dart'; -import 'package:notredame/features/ets/web-link/security-info/security_view.dart'; +import 'package:notredame/features/ets/quick-link/widgets/security-info/security_view.dart'; import 'package:notredame/features/more/settings/settings_view.dart'; import 'package:notredame/features/app/startup/startup_view.dart'; import 'package:notredame/features/student/student_view.dart'; diff --git a/lib/features/ets/events/author/author_view.dart b/lib/features/ets/events/author/author_view.dart index 124fc51a9..465f2c2fd 100644 --- a/lib/features/ets/events/author/author_view.dart +++ b/lib/features/ets/events/author/author_view.dart @@ -15,8 +15,8 @@ import 'package:notredame/features/ets/events/author/author_viewmodel.dart'; import 'package:notredame/utils/app_theme.dart'; import 'package:notredame/features/ets/events/author/author_info_skeleton.dart'; import 'package:notredame/features/app/widgets/base_scaffold.dart'; -import 'package:notredame/features/ets/events/news/news_card.dart'; -import 'package:notredame/features/ets/events/news/news_card_skeleton.dart'; +import 'package:notredame/features/ets/events/news/widgets/news_card.dart'; +import 'package:notredame/features/ets/events/news/widgets/news_card_skeleton.dart'; import 'package:notredame/features/ets/events/social/social_links_card.dart'; class AuthorView extends StatefulWidget { diff --git a/lib/features/ets/events/news/news-details/news_details_view.dart b/lib/features/ets/events/news/news-details/news_details_view.dart index 113962171..2d6931f7e 100644 --- a/lib/features/ets/events/news/news-details/news_details_view.dart +++ b/lib/features/ets/events/news/news-details/news_details_view.dart @@ -8,7 +8,7 @@ import 'package:flutter_markdown/flutter_markdown.dart'; import 'package:flutter_svg/svg.dart'; import 'package:intl/intl.dart'; import 'package:notredame/features/app/analytics/remote_config_service.dart'; -import 'package:notredame/features/ets/events/report_news.dart'; +import 'package:notredame/features/ets/events/report-news/report_news_widget.dart'; import 'package:notredame/utils/utils.dart'; import 'package:notredame/features/schedule/calendar_selection_viewmodel.dart'; import 'package:notredame/features/schedule/widgets/calendar_selector.dart'; diff --git a/lib/features/ets/events/news/news_card.dart b/lib/features/ets/events/news/news_card.dart deleted file mode 100644 index a39bd0b6d..000000000 --- a/lib/features/ets/events/news/news_card.dart +++ /dev/null @@ -1,128 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:shimmer/shimmer.dart'; -import 'package:timeago/timeago.dart' as timeago; -import 'package:ets_api_clients/models.dart'; - -// Project imports: -import 'package:notredame/features/app/navigation/router_paths.dart'; -import 'package:notredame/features/app/navigation/navigation_service.dart'; -import 'package:notredame/utils/locator.dart'; -import 'package:notredame/utils/app_theme.dart'; - -class NewsCard extends StatefulWidget { - final News news; - - const NewsCard(this.news, {super.key}); - - @override - _NewsCardState createState() => _NewsCardState(); -} - -class _NewsCardState extends State { - final NavigationService _navigationService = locator(); - - @override - Widget build(BuildContext context) { - timeago.setLocaleMessages('fr', timeago.FrShortMessages()); - return GestureDetector( - onTap: () => _navigationService.pushNamed(RouterPaths.newsDetails, - arguments: widget.news), - child: Card( - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - key: UniqueKey(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Container( - padding: const EdgeInsets.fromLTRB(16, 16, 16, 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Hero( - tag: 'news_image_id_${widget.news.id}', - child: _buildImage(widget.news.imageUrl)), - const SizedBox(height: 8), - _buildTitleAndTime(widget.news, context), - ], - ), - ), - ], - ), - ), - ); - } - - Widget _buildImage(String? imageUrl) { - var isLoaded = false; - if (imageUrl != null && imageUrl != "") { - return ClipRRect( - borderRadius: BorderRadius.circular(16.0), - child: Image.network( - imageUrl == "" - ? "https://www.shutterstock.com/image-vector/no-photo-thumbnail-graphic-element-600nw-2311073121.jpg" - : imageUrl, - frameBuilder: (context, child, frame, wasSynchronouslyLoaded) { - isLoaded = frame != null; - return child; - }, - loadingBuilder: (context, child, loadingProgress) { - if (isLoaded && loadingProgress == null) { - return child; - } else { - return _shimmerEffect(); - } - }, - ), - ); - } - - return const SizedBox(); - } - - Widget _shimmerEffect() { - return Shimmer.fromColors( - baseColor: Theme.of(context).brightness == Brightness.light - ? AppTheme.lightThemeBackground - : AppTheme.darkThemeBackground, - highlightColor: Theme.of(context).brightness == Brightness.light - ? AppTheme.lightThemeAccent - : AppTheme.darkThemeAccent, - child: Container( - height: 200, - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.circular(16), - ), - ), - ); - } - - Widget _buildTitleAndTime(News news, BuildContext context) { - final TextStyle textStyle = - Theme.of(context).textTheme.titleMedium!.copyWith(fontSize: 16); - - return Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - child: Text( - news.title, - style: textStyle, - ), - ), - const SizedBox(width: 10), - Text( - timeago.format(news.publicationDate, - locale: AppIntl.of(context)!.localeName), - style: textStyle, - ), - ], - ); - } -} diff --git a/lib/features/ets/events/news/news_card_skeleton.dart b/lib/features/ets/events/news/news_card_skeleton.dart deleted file mode 100644 index ce3146e10..000000000 --- a/lib/features/ets/events/news/news_card_skeleton.dart +++ /dev/null @@ -1,98 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:shimmer/shimmer.dart'; - -// Project imports: -import 'package:notredame/utils/app_theme.dart'; - -class NewsCardSkeleton extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Card( - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Container( - padding: const EdgeInsets.fromLTRB(16, 16, 16, 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - _shimmerEffect(context), - const SizedBox(height: 8), - _shimmerTextEffect(context), - ], - ), - ), - ], - ), - ); - } - - Widget _shimmerEffect(BuildContext context) { - return Shimmer.fromColors( - baseColor: Theme.of(context).brightness == Brightness.light - ? AppTheme.lightThemeBackground - : AppTheme.darkThemeBackground, - highlightColor: Theme.of(context).brightness == Brightness.light - ? AppTheme.lightThemeAccent - : AppTheme.darkThemeAccent, - child: Container( - height: 200, - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.circular(16), - ), - ), - ); - } - - Widget _shimmerTextEffect(BuildContext context) { - return Shimmer.fromColors( - baseColor: Theme.of(context).brightness == Brightness.light - ? AppTheme.lightThemeBackground - : AppTheme.darkThemeBackground, - highlightColor: Theme.of(context).brightness == Brightness.light - ? AppTheme.lightThemeAccent - : AppTheme.darkThemeAccent, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - height: 20.0, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), - ), - ), - const SizedBox(height: 8), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 100, - height: 20.0, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), - ), - ), - Container( - width: 60, - height: 20.0, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), - ), - ), - ], - ), - ], - ), - ); - } -} diff --git a/lib/features/ets/events/news/news_view.dart b/lib/features/ets/events/news/news_view.dart index d540b8765..b88c7ed18 100644 --- a/lib/features/ets/events/news/news_view.dart +++ b/lib/features/ets/events/news/news_view.dart @@ -11,8 +11,8 @@ import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart'; // Project imports: import 'package:notredame/features/ets/events/news/news_viewmodel.dart'; -import 'package:notredame/features/ets/events/news/news_card.dart'; -import 'package:notredame/features/ets/events/news/news_card_skeleton.dart'; +import 'package:notredame/features/ets/events/news/widgets/news_card.dart'; +import 'package:notredame/features/ets/events/news/widgets/news_card_skeleton.dart'; class NewsView extends StatefulWidget { @override diff --git a/lib/features/ets/events/report_news.dart b/lib/features/ets/events/report_news.dart deleted file mode 100644 index 9a63c7f02..000000000 --- a/lib/features/ets/events/report_news.dart +++ /dev/null @@ -1,220 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:fluttertoast/fluttertoast.dart'; -import 'package:notredame/utils/app_theme.dart'; -import 'package:stacked/stacked.dart'; - -// Project imports: -import 'package:notredame/features/ets/events/report-news/report_news.dart'; -import 'package:notredame/utils/utils.dart'; -import 'package:notredame/features/ets/events/report-news/report_news_viewmodel.dart'; - -class ReportNews extends StatefulWidget { - final bool showHandle; - final String newsId; - - const ReportNews({super.key, required this.newsId, this.showHandle = true}); - - @override - _ReportNewsState createState() => _ReportNewsState(); -} - -class _ReportNewsState extends State { - String _reason = ""; - bool clicked = false; - int clickedIndex = -1; - - @override - Widget build(BuildContext context) => ViewModelBuilder.reactive( - viewModelBuilder: () => ReportNewsViewModel(), - builder: (context, model, child) => SizedBox( - height: MediaQuery.of(context).size.height * 0.50, - child: Column( - children: [ - if (widget.showHandle) _buildHandle(context), - if (!clicked) _buildTitle(context), - Expanded( - child: clicked && clickedIndex != -1 - ? Center( - child: _buildReportView(context, clickedIndex, model)) - : ColoredBox( - color: Utils.getColorByBrightness( - context, - AppTheme.lightThemeBackground, - AppTheme.darkThemeBackground, - ), - child: ListView.builder( - itemCount: - getLocalizedReportNewsItems(context).length, - itemBuilder: (context, index) { - return _buildListTile(index); - }, - )), - ), - ], - ), - ), - ); - - Widget _buildHandle(BuildContext context) { - return Container( - decoration: BoxDecoration( - color: Utils.getColorByBrightness( - context, - AppTheme.lightThemeBackground, - AppTheme.darkThemeBackground, - ), - borderRadius: const BorderRadius.only( - topLeft: Radius.circular(40.0), - topRight: Radius.circular(40.0), - ), - ), - child: Center( - child: Padding( - padding: const EdgeInsets.only(top: 8.0), - child: Container( - height: 5, - width: 50, - decoration: const BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.all(Radius.circular(8.0))), - ), - ), - ), - ); - } - - Widget _buildTitle(BuildContext context) { - return Container( - width: MediaQuery.of(context).size.width, - decoration: BoxDecoration( - color: Utils.getColorByBrightness( - context, - AppTheme.lightThemeBackground, - AppTheme.darkThemeBackground, - ), - ), - child: Center( - child: Padding( - padding: const EdgeInsets.fromLTRB(15, 20, 20, 20), - child: Text( - AppIntl.of(context)!.report_news, - style: Theme.of(context).textTheme.titleLarge, - ), - ), - ), - ); - } - - Widget _buildListTile(int index) { - final item = getLocalizedReportNewsItems(context)[index]; - return Padding( - padding: const EdgeInsets.only(left: 16.0, right: 16.0), - child: Card( - color: AppTheme.darkThemeAccent, - child: ListTile( - title: Text( - item.title, - style: const TextStyle(fontWeight: FontWeight.bold), - ), - subtitle: Text(item.description), - trailing: const Icon( - Icons.navigate_next, - ), - tileColor: AppTheme.darkThemeAccent, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), - ), - contentPadding: - const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), - onTap: () { - setState(() { - clicked = true; - clickedIndex = index; - }); - }, - ), - )); - } - - Widget _buildReportView( - BuildContext context, int index, ReportNewsViewModel model) { - final String reportTitle = - getLocalizedReportNewsItems(context)[index].title; - final String reportCategory = - getLocalizedReportNewsItems(context)[index].category; - - return Container( - padding: const EdgeInsets.all(8.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Align( - alignment: Alignment.topLeft, - child: IconButton( - icon: const Icon(Icons.arrow_back, color: Colors.white), - onPressed: () { - setState(() { - clicked = false; - clickedIndex = -1; - }); - }, - ), - ), - Expanded( - child: Center( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - '${AppIntl.of(context)!.report_as}\n${reportTitle.toLowerCase()}?', - style: const TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 24), - textAlign: TextAlign.center, - ), - const SizedBox(height: 24), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: TextField( - decoration: InputDecoration( - hintText: AppIntl.of(context)!.report_reason_hint, - ), - minLines: 1, - onChanged: (reason) => _reason = reason, - ), - ), - const SizedBox(height: 24), - ElevatedButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - AppTheme.etsLightRed), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - child: Text(AppIntl.of(context)!.report, - style: const TextStyle(color: Colors.white)), - onPressed: () { - model.reportNews(widget.newsId, reportCategory, _reason); - Fluttertoast.showToast( - msg: AppIntl.of(context)!.report_toast); - Navigator.pop(context); - }, - ), - ], - ), - ), - ), - ], - ), - ); - } -} diff --git a/lib/features/ets/events/social/social_links_card.dart b/lib/features/ets/events/social/social_links_card.dart index e67ddf699..becefd4b9 100644 --- a/lib/features/ets/events/social/social_links_card.dart +++ b/lib/features/ets/events/social/social_links_card.dart @@ -8,7 +8,7 @@ import 'package:stacked/stacked.dart'; // Project imports: import 'package:notredame/features/ets/events/social/models/social_link.dart'; import 'package:notredame/utils/utils.dart'; -import 'package:notredame/features/ets/web-link/web_link_card_viewmodel.dart'; +import 'package:notredame/features/ets/quick-link/widgets/web_link_card_viewmodel.dart'; import 'package:notredame/utils/app_theme.dart'; class SocialLinks extends StatefulWidget { diff --git a/lib/features/ets/quick-link/quick_links_view.dart b/lib/features/ets/quick-link/quick_links_view.dart index db65219c5..0400af219 100644 --- a/lib/features/ets/quick-link/quick_links_view.dart +++ b/lib/features/ets/quick-link/quick_links_view.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; // Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:notredame/features/ets/web-link/web_link_card.dart'; +import 'package:notredame/features/ets/quick-link/widgets/web_link_card.dart'; import 'package:reorderable_grid_view/reorderable_grid_view.dart'; import 'package:stacked/stacked.dart'; diff --git a/lib/features/ets/web-link/security-info/emergency_view.dart b/lib/features/ets/web-link/security-info/emergency_view.dart deleted file mode 100644 index eb4143221..000000000 --- a/lib/features/ets/web-link/security-info/emergency_view.dart +++ /dev/null @@ -1,50 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:webview_flutter/webview_flutter.dart'; - -// Project imports: -import 'package:notredame/features/app/presentation/webview_controller_extension.dart'; -import 'package:notredame/utils/utils.dart'; -import 'package:notredame/utils/app_theme.dart'; - -class EmergencyView extends StatefulWidget { - final String title; - final String description; - - const EmergencyView(this.title, this.description); - - @override - _EmergencyViewState createState() => _EmergencyViewState(); -} - -class _EmergencyViewState extends State { - @override - Widget build(BuildContext context) => Scaffold( - appBar: AppBar(title: Text(widget.title)), - floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, - floatingActionButton: FloatingActionButton.extended( - onPressed: () { - Utils.launchURL( - 'tel:${AppIntl.of(context)!.security_emergency_number}', - AppIntl.of(context)!) - .catchError((error) { - ScaffoldMessenger.of(context) - .showSnackBar(SnackBar(content: Text(error.toString()))); - }); - }, - label: Text( - AppIntl.of(context)!.security_reach_security, - style: const TextStyle(color: Colors.white, fontSize: 20), - ), - icon: const Icon(Icons.phone, size: 30, color: Colors.white), - backgroundColor: AppTheme.etsLightRed, - ), - body: WebViewWidget( - controller: WebViewControllerExtension(WebViewController()) - ..loadHtmlFromAssets( - widget.description, Theme.of(context).brightness)), - ); -} diff --git a/lib/features/ets/web-link/security-info/models/emergency_procedure.dart b/lib/features/ets/web-link/security-info/models/emergency_procedure.dart deleted file mode 100644 index 3c1ee8daa..000000000 --- a/lib/features/ets/web-link/security-info/models/emergency_procedure.dart +++ /dev/null @@ -1,6 +0,0 @@ -class EmergencyProcedure { - final String title; - final String detail; - - EmergencyProcedure({required this.title, required this.detail}); -} diff --git a/lib/features/ets/web-link/security-info/models/emergency_procedures.dart b/lib/features/ets/web-link/security-info/models/emergency_procedures.dart deleted file mode 100644 index 5c67c8650..000000000 --- a/lib/features/ets/web-link/security-info/models/emergency_procedures.dart +++ /dev/null @@ -1,38 +0,0 @@ -// Package imports: -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - -// Project imports: -import 'package:notredame/features/ets/web-link/security-info/models/emergency_procedure.dart'; - -List emergencyProcedures(AppIntl intl) => [ - EmergencyProcedure( - title: intl.security_bomb_threat_title, - detail: 'assets/html/${intl.security_bomb_threat_detail}'), - EmergencyProcedure( - title: intl.security_suspicious_packages_title, - detail: 'assets/html/${intl.security_suspicious_packages_detail}'), - EmergencyProcedure( - title: intl.security_evacuation_title, - detail: 'assets/html/${intl.security_evacuation_detail}'), - EmergencyProcedure( - title: intl.security_gas_leak_title, - detail: 'assets/html/${intl.security_gas_leak_detail}'), - EmergencyProcedure( - title: intl.security_fire_title, - detail: 'assets/html/${intl.security_fire_detail}'), - EmergencyProcedure( - title: intl.security_broken_elevator_title, - detail: 'assets/html/${intl.security_broken_elevator_detail}'), - EmergencyProcedure( - title: intl.security_electrical_outage_title, - detail: 'assets/html/${intl.security_electrical_outage_detail}'), - EmergencyProcedure( - title: intl.security_armed_person_title, - detail: 'assets/html/${intl.security_armed_person_detail}'), - EmergencyProcedure( - title: intl.security_earthquake_title, - detail: 'assets/html/${intl.security_earthquake_detail}'), - EmergencyProcedure( - title: intl.security_medical_emergency_title, - detail: 'assets/html/${intl.security_medical_emergency_detail}'), - ]; diff --git a/lib/features/ets/web-link/security-info/security_view.dart b/lib/features/ets/web-link/security-info/security_view.dart deleted file mode 100644 index 9e0728082..000000000 --- a/lib/features/ets/web-link/security-info/security_view.dart +++ /dev/null @@ -1,139 +0,0 @@ -// Flutter imports: -import 'package:flutter/foundation.dart'; -import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:stacked/stacked.dart'; - -// Project imports: -import 'package:notredame/utils/utils.dart'; -import 'package:notredame/features/ets/web-link/security-info/security_viewmodel.dart'; -import 'package:notredame/utils/app_theme.dart'; -import 'package:notredame/features/ets/web-link/security-info/emergency_view.dart'; - -class SecurityView extends StatefulWidget { - @override - _SecurityViewState createState() => _SecurityViewState(); -} - -class _SecurityViewState extends State { - static const CameraPosition _etsLocation = CameraPosition( - target: LatLng(45.49449875, -73.56246144109338), zoom: 17.0); - - @override - Widget build(BuildContext context) => - ViewModelBuilder.reactive( - viewModelBuilder: () => SecurityViewModel(intl: AppIntl.of(context)!), - builder: (context, model, child) => Scaffold( - appBar: AppBar( - title: Text(AppIntl.of(context)!.ets_security_title), - ), - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 250, - child: GoogleMap( - initialCameraPosition: _etsLocation, - zoomControlsEnabled: false, - markers: - model.getSecurityMarkersForMaps(model.markersList), - onMapCreated: (GoogleMapController controller) { - model.controller = controller; - model.changeMapMode(context); - }, - gestureRecognizers: >{ - Factory( - () => EagerGestureRecognizer()), - }), - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - AppIntl.of(context)!.security_reach_security, - style: const TextStyle( - color: AppTheme.etsLightRed, fontSize: 24), - ), - ), - Card( - child: InkWell( - splashColor: Colors.red.withAlpha(50), - onTap: () => Utils.launchURL( - 'tel:${AppIntl.of(context)!.security_emergency_number}', - AppIntl.of(context)!) - .catchError((error) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text(error.toString()))); - }), - child: ListTile( - leading: const Icon(Icons.phone, size: 30), - title: Text(AppIntl.of(context)!.security_emergency_call), - subtitle: - Text(AppIntl.of(context)!.security_emergency_number), - ), - ), - ), - Card( - elevation: 0, - color: Colors.transparent, - child: ListTile( - leading: const Icon(Icons.phone, size: 30), - title: Text( - AppIntl.of(context)!.security_emergency_intern_call), - subtitle: Text( - AppIntl.of(context)!.security_emergency_intern_number), - ), - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - AppIntl.of(context)!.security_emergency_procedures, - style: const TextStyle( - color: AppTheme.etsLightRed, fontSize: 24), - ), - ), - SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: List.generate( - model.emergencyProcedureList.length, - (index) => Card( - child: InkWell( - splashColor: Colors.red.withAlpha(50), - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => EmergencyView( - model.emergencyProcedureList[index].title, - model.emergencyProcedureList[index] - .detail))), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.only( - top: 16.0, bottom: 16.0, left: 16.0), - child: Text( - model.emergencyProcedureList[index].title, - style: const TextStyle(fontSize: 18), - ), - ), - const Icon(Icons.arrow_forward_ios), - ], - ), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ); -} diff --git a/lib/features/ets/web-link/security-info/security_viewmodel.dart b/lib/features/ets/web-link/security-info/security_viewmodel.dart deleted file mode 100644 index 09239d340..000000000 --- a/lib/features/ets/web-link/security-info/security_viewmodel.dart +++ /dev/null @@ -1,54 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -// Package imports: -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:stacked/stacked.dart'; - -// Project imports: -import 'package:notredame/features/ets/web-link/security-info/models/emergency_procedures.dart'; -import 'package:notredame/constants/markers.dart'; -import 'package:notredame/features/ets/web-link/security-info/models/emergency_procedure.dart'; - -class SecurityViewModel extends BaseViewModel { - GoogleMapController? controller; - - final List emergencyProcedureList; - - final List markersList; - - SecurityViewModel({required AppIntl intl}) - : emergencyProcedureList = emergencyProcedures(intl), - markersList = markers(intl); - - /// Used to get all security buildings to show in Google Maps - Set getSecurityMarkersForMaps(List markersList) { - final Map markers = {}; - - for (int i = 0; i < markersList.length; i++) { - markers[markersList[i].markerId] = markersList[i]; - } - return Set.of(markers.values); - } - - /// Used to load a Json file - Future getJsonFile(String path) async { - return rootBundle.loadString(path); - } - - /// Used to change the color of the map based on the brightness - void changeMapMode(BuildContext context) { - if (Theme.of(context).brightness == Brightness.dark) { - getJsonFile("assets/dark_map_style.json").then(setMapStyle); - } else { - getJsonFile("assets/normal_map_style.json").then(setMapStyle); - } - } - - /// Used to set the color of the map - void setMapStyle(String mapStyle) { - controller?.setMapStyle(mapStyle); - } -} diff --git a/lib/features/ets/web-link/web_link_card.dart b/lib/features/ets/web-link/web_link_card.dart deleted file mode 100644 index 246a7c24a..000000000 --- a/lib/features/ets/web-link/web_link_card.dart +++ /dev/null @@ -1,54 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:stacked/stacked.dart'; - -// Project imports: -import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; -import 'package:notredame/features/ets/web-link/web_link_card_viewmodel.dart'; -import 'package:notredame/utils/app_theme.dart'; - -class WebLinkCard extends StatelessWidget { - final QuickLink _links; - - const WebLinkCard(this._links); - - @override - Widget build(BuildContext context) => - ViewModelBuilder.reactive( - viewModelBuilder: () => WebLinkCardViewModel(), - builder: (context, model, child) { - return ConstrainedBox( - constraints: const BoxConstraints.expand(), - child: Card( - elevation: 4.0, - child: InkWell( - borderRadius: const BorderRadius.all(Radius.circular(10)), - onTap: () => - model.onLinkClicked(_links, Theme.of(context).brightness), - splashColor: AppTheme.etsLightRed.withAlpha(50), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Expanded( - flex: 40, - child: _links.image, - ), - FittedBox( - fit: BoxFit.fitWidth, - child: Text( - _links.name, - style: const TextStyle( - color: AppTheme.etsLightRed, fontSize: 18.0), - ), - ), - ], - ), - ), - ), - ), - ); - }); -} diff --git a/lib/features/ets/web-link/web_link_card_viewmodel.dart b/lib/features/ets/web-link/web_link_card_viewmodel.dart deleted file mode 100644 index 1b8bff47b..000000000 --- a/lib/features/ets/web-link/web_link_card_viewmodel.dart +++ /dev/null @@ -1,43 +0,0 @@ -// Flutter imports: -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:stacked/stacked.dart'; - -// Project imports: -import 'package:notredame/features/app/navigation/router_paths.dart'; -import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; -import 'package:notredame/features/app/analytics/analytics_service.dart'; -import 'package:notredame/features/app/integration/launch_url_service.dart'; -import 'package:notredame/features/app/navigation/navigation_service.dart'; -import 'package:notredame/utils/locator.dart'; - -class WebLinkCardViewModel extends BaseViewModel { - /// used to redirect on the security. - final NavigationService _navigationService = locator(); - - final AnalyticsService _analyticsService = locator(); - - final LaunchUrlService _launchUrlService = locator(); - - /// used to open a website or the security view - Future onLinkClicked(QuickLink link, Brightness brightness) async { - _analyticsService.logEvent("QuickLink", "QuickLink clicked: ${link.name}"); - - if (link.link == 'security') { - _navigationService.pushNamed(RouterPaths.security); - } else { - try { - await _launchUrlService.launchInBrowser(link.link, brightness); - } catch (error) { - // An exception is thrown if browser app is not installed on Android device. - await launchWebView(link); - } - } - } - - Future launchWebView(QuickLink link) async { - _navigationService.pushNamed(RouterPaths.webView, arguments: link); - } -} diff --git a/test/ui/views/author_view_test.dart b/test/ui/views/author_view_test.dart index 71933911c..17f79c486 100644 --- a/test/ui/views/author_view_test.dart +++ b/test/ui/views/author_view_test.dart @@ -18,7 +18,7 @@ import 'package:notredame/features/app/integration/launch_url_service.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; import 'package:notredame/features/app/integration/networking_service.dart'; import 'package:notredame/features/ets/events/author/author_view.dart'; -import 'package:notredame/features/ets/events/news/news_card.dart'; +import 'package:notredame/features/ets/events/news/widgets/news_card.dart'; import 'package:notredame/features/ets/events/social/social_links_card.dart'; import '../../helpers.dart'; import '../../mock/managers/author_repository_mock.dart'; diff --git a/test/ui/views/emergency_view_test.dart b/test/ui/views/emergency_view_test.dart index 07764dcf2..cff82deea 100644 --- a/test/ui/views/emergency_view_test.dart +++ b/test/ui/views/emergency_view_test.dart @@ -7,7 +7,7 @@ import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter_android/webview_flutter_android.dart'; // Project imports: -import 'package:notredame/features/ets/web-link/security-info/emergency_view.dart'; +import 'package:notredame/features/ets/quick-link/widgets/security-info/emergency_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/views/news_view_test.dart b/test/ui/views/news_view_test.dart index 961fb7d1b..46e24eac5 100644 --- a/test/ui/views/news_view_test.dart +++ b/test/ui/views/news_view_test.dart @@ -14,7 +14,7 @@ import 'package:notredame/features/more/settings/settings_manager.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; import 'package:notredame/features/app/integration/networking_service.dart'; import 'package:notredame/features/ets/events/news/news_view.dart'; -import 'package:notredame/features/ets/events/news/news_card.dart'; +import 'package:notredame/features/ets/events/news/widgets/news_card.dart'; import '../../helpers.dart'; import '../../mock/managers/news_repository_mock.dart'; diff --git a/test/ui/views/quick_links_view_test.dart b/test/ui/views/quick_links_view_test.dart index 1b6868116..f7225c38b 100644 --- a/test/ui/views/quick_links_view_test.dart +++ b/test/ui/views/quick_links_view_test.dart @@ -15,7 +15,7 @@ import 'package:notredame/features/app/repository/quick_link_repository.dart'; import 'package:notredame/features/app/integration/launch_url_service.dart'; import 'package:notredame/features/app/integration/networking_service.dart'; import 'package:notredame/features/ets/quick-link/quick_links_view.dart'; -import 'package:notredame/features/ets/web-link/web_link_card.dart'; +import 'package:notredame/features/ets/quick-link/widgets/web_link_card.dart'; import '../../helpers.dart'; import '../../mock/managers/quick_links_repository_mock.dart'; import '../../mock/services/analytics_service_mock.dart'; diff --git a/test/ui/views/security_view_test.dart b/test/ui/views/security_view_test.dart index 6cc5634ca..ada787023 100644 --- a/test/ui/views/security_view_test.dart +++ b/test/ui/views/security_view_test.dart @@ -7,8 +7,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; // Project imports: -import 'package:notredame/features/ets/web-link/security-info/models/emergency_procedures.dart'; -import 'package:notredame/features/ets/web-link/security-info/security_view.dart'; +import 'package:notredame/features/ets/quick-link/widgets/security-info/models/emergency_procedures.dart'; +import 'package:notredame/features/ets/quick-link/widgets/security-info/security_view.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/news_card_test.dart b/test/ui/widgets/news_card_test.dart index 9d4babbee..d06907d1e 100644 --- a/test/ui/widgets/news_card_test.dart +++ b/test/ui/widgets/news_card_test.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; // Project imports: -import 'package:notredame/features/ets/events/news/news_card.dart'; +import 'package:notredame/features/ets/events/news/widgets/news_card.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/news_skeleton_test.dart b/test/ui/widgets/news_skeleton_test.dart index d836c27c2..d574e3920 100644 --- a/test/ui/widgets/news_skeleton_test.dart +++ b/test/ui/widgets/news_skeleton_test.dart @@ -3,7 +3,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shimmer/shimmer.dart'; // Project imports: -import 'package:notredame/features/ets/events/news/news_card_skeleton.dart'; +import 'package:notredame/features/ets/events/news/widgets/news_card_skeleton.dart'; import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/web_link_card_test.dart b/test/ui/widgets/web_link_card_test.dart index 2744d90df..02c2be5a8 100644 --- a/test/ui/widgets/web_link_card_test.dart +++ b/test/ui/widgets/web_link_card_test.dart @@ -10,7 +10,7 @@ import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; import 'package:notredame/features/app/analytics/analytics_service.dart'; import 'package:notredame/features/app/error/internal_info_service.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; -import 'package:notredame/features/ets/web-link/web_link_card.dart'; +import 'package:notredame/features/ets/quick-link/widgets/web_link_card.dart'; import '../../helpers.dart'; import '../../mock/services/analytics_service_mock.dart'; import '../../mock/services/launch_url_service_mock.dart'; diff --git a/test/viewmodels/web_link_card_viewmodel_test.dart b/test/viewmodels/web_link_card_viewmodel_test.dart index 2b71dc88b..8a6f9420e 100644 --- a/test/viewmodels/web_link_card_viewmodel_test.dart +++ b/test/viewmodels/web_link_card_viewmodel_test.dart @@ -12,7 +12,7 @@ import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; import 'package:notredame/features/app/analytics/analytics_service.dart'; import 'package:notredame/features/app/error/internal_info_service.dart'; import 'package:notredame/features/app/navigation/navigation_service.dart'; -import 'package:notredame/features/ets/web-link/web_link_card_viewmodel.dart'; +import 'package:notredame/features/ets/quick-link/widgets/web_link_card_viewmodel.dart'; import '../helpers.dart'; import '../mock/services/analytics_service_mock.dart'; import '../mock/services/internal_info_service_mock.dart'; From 921900cab4b821abf382c69dae12def5ce45d2b9 Mon Sep 17 00:00:00 2001 From: Xavier Paquet-Rapold Date: Sat, 22 Jun 2024 21:25:03 -0400 Subject: [PATCH 4/4] Fix events structure --- .../ets/events/news/widgets/news_card.dart | 128 ++++++++++ .../news/widgets/news_card_skeleton.dart | 98 ++++++++ .../report-news/report_news_widget.dart | 220 ++++++++++++++++++ .../widgets/security-info/emergency_view.dart | 50 ++++ .../models/emergency_procedure.dart | 6 + .../models/emergency_procedures.dart | 38 +++ .../widgets/security-info/security_view.dart | 139 +++++++++++ .../security-info/security_viewmodel.dart | 54 +++++ .../ets/quick-link/widgets/web_link_card.dart | 54 +++++ .../widgets/web_link_card_viewmodel.dart | 43 ++++ 10 files changed, 830 insertions(+) create mode 100644 lib/features/ets/events/news/widgets/news_card.dart create mode 100644 lib/features/ets/events/news/widgets/news_card_skeleton.dart create mode 100644 lib/features/ets/events/report-news/report_news_widget.dart create mode 100644 lib/features/ets/quick-link/widgets/security-info/emergency_view.dart create mode 100644 lib/features/ets/quick-link/widgets/security-info/models/emergency_procedure.dart create mode 100644 lib/features/ets/quick-link/widgets/security-info/models/emergency_procedures.dart create mode 100644 lib/features/ets/quick-link/widgets/security-info/security_view.dart create mode 100644 lib/features/ets/quick-link/widgets/security-info/security_viewmodel.dart create mode 100644 lib/features/ets/quick-link/widgets/web_link_card.dart create mode 100644 lib/features/ets/quick-link/widgets/web_link_card_viewmodel.dart diff --git a/lib/features/ets/events/news/widgets/news_card.dart b/lib/features/ets/events/news/widgets/news_card.dart new file mode 100644 index 000000000..a39bd0b6d --- /dev/null +++ b/lib/features/ets/events/news/widgets/news_card.dart @@ -0,0 +1,128 @@ +// Flutter imports: +import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:shimmer/shimmer.dart'; +import 'package:timeago/timeago.dart' as timeago; +import 'package:ets_api_clients/models.dart'; + +// Project imports: +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/utils/locator.dart'; +import 'package:notredame/utils/app_theme.dart'; + +class NewsCard extends StatefulWidget { + final News news; + + const NewsCard(this.news, {super.key}); + + @override + _NewsCardState createState() => _NewsCardState(); +} + +class _NewsCardState extends State { + final NavigationService _navigationService = locator(); + + @override + Widget build(BuildContext context) { + timeago.setLocaleMessages('fr', timeago.FrShortMessages()); + return GestureDetector( + onTap: () => _navigationService.pushNamed(RouterPaths.newsDetails, + arguments: widget.news), + child: Card( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + key: UniqueKey(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: const EdgeInsets.fromLTRB(16, 16, 16, 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Hero( + tag: 'news_image_id_${widget.news.id}', + child: _buildImage(widget.news.imageUrl)), + const SizedBox(height: 8), + _buildTitleAndTime(widget.news, context), + ], + ), + ), + ], + ), + ), + ); + } + + Widget _buildImage(String? imageUrl) { + var isLoaded = false; + if (imageUrl != null && imageUrl != "") { + return ClipRRect( + borderRadius: BorderRadius.circular(16.0), + child: Image.network( + imageUrl == "" + ? "https://www.shutterstock.com/image-vector/no-photo-thumbnail-graphic-element-600nw-2311073121.jpg" + : imageUrl, + frameBuilder: (context, child, frame, wasSynchronouslyLoaded) { + isLoaded = frame != null; + return child; + }, + loadingBuilder: (context, child, loadingProgress) { + if (isLoaded && loadingProgress == null) { + return child; + } else { + return _shimmerEffect(); + } + }, + ), + ); + } + + return const SizedBox(); + } + + Widget _shimmerEffect() { + return Shimmer.fromColors( + baseColor: Theme.of(context).brightness == Brightness.light + ? AppTheme.lightThemeBackground + : AppTheme.darkThemeBackground, + highlightColor: Theme.of(context).brightness == Brightness.light + ? AppTheme.lightThemeAccent + : AppTheme.darkThemeAccent, + child: Container( + height: 200, + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(16), + ), + ), + ); + } + + Widget _buildTitleAndTime(News news, BuildContext context) { + final TextStyle textStyle = + Theme.of(context).textTheme.titleMedium!.copyWith(fontSize: 16); + + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + child: Text( + news.title, + style: textStyle, + ), + ), + const SizedBox(width: 10), + Text( + timeago.format(news.publicationDate, + locale: AppIntl.of(context)!.localeName), + style: textStyle, + ), + ], + ); + } +} diff --git a/lib/features/ets/events/news/widgets/news_card_skeleton.dart b/lib/features/ets/events/news/widgets/news_card_skeleton.dart new file mode 100644 index 000000000..ce3146e10 --- /dev/null +++ b/lib/features/ets/events/news/widgets/news_card_skeleton.dart @@ -0,0 +1,98 @@ +// Flutter imports: +import 'package:flutter/material.dart'; + +// Package imports: +import 'package:shimmer/shimmer.dart'; + +// Project imports: +import 'package:notredame/utils/app_theme.dart'; + +class NewsCardSkeleton extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Card( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: const EdgeInsets.fromLTRB(16, 16, 16, 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _shimmerEffect(context), + const SizedBox(height: 8), + _shimmerTextEffect(context), + ], + ), + ), + ], + ), + ); + } + + Widget _shimmerEffect(BuildContext context) { + return Shimmer.fromColors( + baseColor: Theme.of(context).brightness == Brightness.light + ? AppTheme.lightThemeBackground + : AppTheme.darkThemeBackground, + highlightColor: Theme.of(context).brightness == Brightness.light + ? AppTheme.lightThemeAccent + : AppTheme.darkThemeAccent, + child: Container( + height: 200, + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(16), + ), + ), + ); + } + + Widget _shimmerTextEffect(BuildContext context) { + return Shimmer.fromColors( + baseColor: Theme.of(context).brightness == Brightness.light + ? AppTheme.lightThemeBackground + : AppTheme.darkThemeBackground, + highlightColor: Theme.of(context).brightness == Brightness.light + ? AppTheme.lightThemeAccent + : AppTheme.darkThemeAccent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + height: 20.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 100, + height: 20.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + ), + Container( + width: 60, + height: 20.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/lib/features/ets/events/report-news/report_news_widget.dart b/lib/features/ets/events/report-news/report_news_widget.dart new file mode 100644 index 000000000..9a63c7f02 --- /dev/null +++ b/lib/features/ets/events/report-news/report_news_widget.dart @@ -0,0 +1,220 @@ +// Flutter imports: +import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:fluttertoast/fluttertoast.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:stacked/stacked.dart'; + +// Project imports: +import 'package:notredame/features/ets/events/report-news/report_news.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/ets/events/report-news/report_news_viewmodel.dart'; + +class ReportNews extends StatefulWidget { + final bool showHandle; + final String newsId; + + const ReportNews({super.key, required this.newsId, this.showHandle = true}); + + @override + _ReportNewsState createState() => _ReportNewsState(); +} + +class _ReportNewsState extends State { + String _reason = ""; + bool clicked = false; + int clickedIndex = -1; + + @override + Widget build(BuildContext context) => ViewModelBuilder.reactive( + viewModelBuilder: () => ReportNewsViewModel(), + builder: (context, model, child) => SizedBox( + height: MediaQuery.of(context).size.height * 0.50, + child: Column( + children: [ + if (widget.showHandle) _buildHandle(context), + if (!clicked) _buildTitle(context), + Expanded( + child: clicked && clickedIndex != -1 + ? Center( + child: _buildReportView(context, clickedIndex, model)) + : ColoredBox( + color: Utils.getColorByBrightness( + context, + AppTheme.lightThemeBackground, + AppTheme.darkThemeBackground, + ), + child: ListView.builder( + itemCount: + getLocalizedReportNewsItems(context).length, + itemBuilder: (context, index) { + return _buildListTile(index); + }, + )), + ), + ], + ), + ), + ); + + Widget _buildHandle(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Utils.getColorByBrightness( + context, + AppTheme.lightThemeBackground, + AppTheme.darkThemeBackground, + ), + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(40.0), + topRight: Radius.circular(40.0), + ), + ), + child: Center( + child: Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Container( + height: 5, + width: 50, + decoration: const BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.all(Radius.circular(8.0))), + ), + ), + ), + ); + } + + Widget _buildTitle(BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + color: Utils.getColorByBrightness( + context, + AppTheme.lightThemeBackground, + AppTheme.darkThemeBackground, + ), + ), + child: Center( + child: Padding( + padding: const EdgeInsets.fromLTRB(15, 20, 20, 20), + child: Text( + AppIntl.of(context)!.report_news, + style: Theme.of(context).textTheme.titleLarge, + ), + ), + ), + ); + } + + Widget _buildListTile(int index) { + final item = getLocalizedReportNewsItems(context)[index]; + return Padding( + padding: const EdgeInsets.only(left: 16.0, right: 16.0), + child: Card( + color: AppTheme.darkThemeAccent, + child: ListTile( + title: Text( + item.title, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text(item.description), + trailing: const Icon( + Icons.navigate_next, + ), + tileColor: AppTheme.darkThemeAccent, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5), + ), + contentPadding: + const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + onTap: () { + setState(() { + clicked = true; + clickedIndex = index; + }); + }, + ), + )); + } + + Widget _buildReportView( + BuildContext context, int index, ReportNewsViewModel model) { + final String reportTitle = + getLocalizedReportNewsItems(context)[index].title; + final String reportCategory = + getLocalizedReportNewsItems(context)[index].category; + + return Container( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Align( + alignment: Alignment.topLeft, + child: IconButton( + icon: const Icon(Icons.arrow_back, color: Colors.white), + onPressed: () { + setState(() { + clicked = false; + clickedIndex = -1; + }); + }, + ), + ), + Expanded( + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '${AppIntl.of(context)!.report_as}\n${reportTitle.toLowerCase()}?', + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 24), + textAlign: TextAlign.center, + ), + const SizedBox(height: 24), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: TextField( + decoration: InputDecoration( + hintText: AppIntl.of(context)!.report_reason_hint, + ), + minLines: 1, + onChanged: (reason) => _reason = reason, + ), + ), + const SizedBox(height: 24), + ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all( + AppTheme.etsLightRed), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + child: Text(AppIntl.of(context)!.report, + style: const TextStyle(color: Colors.white)), + onPressed: () { + model.reportNews(widget.newsId, reportCategory, _reason); + Fluttertoast.showToast( + msg: AppIntl.of(context)!.report_toast); + Navigator.pop(context); + }, + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/features/ets/quick-link/widgets/security-info/emergency_view.dart b/lib/features/ets/quick-link/widgets/security-info/emergency_view.dart new file mode 100644 index 000000000..eb4143221 --- /dev/null +++ b/lib/features/ets/quick-link/widgets/security-info/emergency_view.dart @@ -0,0 +1,50 @@ +// Flutter imports: +import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:webview_flutter/webview_flutter.dart'; + +// Project imports: +import 'package:notredame/features/app/presentation/webview_controller_extension.dart'; +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/utils/app_theme.dart'; + +class EmergencyView extends StatefulWidget { + final String title; + final String description; + + const EmergencyView(this.title, this.description); + + @override + _EmergencyViewState createState() => _EmergencyViewState(); +} + +class _EmergencyViewState extends State { + @override + Widget build(BuildContext context) => Scaffold( + appBar: AppBar(title: Text(widget.title)), + floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, + floatingActionButton: FloatingActionButton.extended( + onPressed: () { + Utils.launchURL( + 'tel:${AppIntl.of(context)!.security_emergency_number}', + AppIntl.of(context)!) + .catchError((error) { + ScaffoldMessenger.of(context) + .showSnackBar(SnackBar(content: Text(error.toString()))); + }); + }, + label: Text( + AppIntl.of(context)!.security_reach_security, + style: const TextStyle(color: Colors.white, fontSize: 20), + ), + icon: const Icon(Icons.phone, size: 30, color: Colors.white), + backgroundColor: AppTheme.etsLightRed, + ), + body: WebViewWidget( + controller: WebViewControllerExtension(WebViewController()) + ..loadHtmlFromAssets( + widget.description, Theme.of(context).brightness)), + ); +} diff --git a/lib/features/ets/quick-link/widgets/security-info/models/emergency_procedure.dart b/lib/features/ets/quick-link/widgets/security-info/models/emergency_procedure.dart new file mode 100644 index 000000000..3c1ee8daa --- /dev/null +++ b/lib/features/ets/quick-link/widgets/security-info/models/emergency_procedure.dart @@ -0,0 +1,6 @@ +class EmergencyProcedure { + final String title; + final String detail; + + EmergencyProcedure({required this.title, required this.detail}); +} diff --git a/lib/features/ets/quick-link/widgets/security-info/models/emergency_procedures.dart b/lib/features/ets/quick-link/widgets/security-info/models/emergency_procedures.dart new file mode 100644 index 000000000..e9169c84e --- /dev/null +++ b/lib/features/ets/quick-link/widgets/security-info/models/emergency_procedures.dart @@ -0,0 +1,38 @@ +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +// Project imports: +import 'package:notredame/features/ets/quick-link/widgets/security-info/models/emergency_procedure.dart'; + +List emergencyProcedures(AppIntl intl) => [ + EmergencyProcedure( + title: intl.security_bomb_threat_title, + detail: 'assets/html/${intl.security_bomb_threat_detail}'), + EmergencyProcedure( + title: intl.security_suspicious_packages_title, + detail: 'assets/html/${intl.security_suspicious_packages_detail}'), + EmergencyProcedure( + title: intl.security_evacuation_title, + detail: 'assets/html/${intl.security_evacuation_detail}'), + EmergencyProcedure( + title: intl.security_gas_leak_title, + detail: 'assets/html/${intl.security_gas_leak_detail}'), + EmergencyProcedure( + title: intl.security_fire_title, + detail: 'assets/html/${intl.security_fire_detail}'), + EmergencyProcedure( + title: intl.security_broken_elevator_title, + detail: 'assets/html/${intl.security_broken_elevator_detail}'), + EmergencyProcedure( + title: intl.security_electrical_outage_title, + detail: 'assets/html/${intl.security_electrical_outage_detail}'), + EmergencyProcedure( + title: intl.security_armed_person_title, + detail: 'assets/html/${intl.security_armed_person_detail}'), + EmergencyProcedure( + title: intl.security_earthquake_title, + detail: 'assets/html/${intl.security_earthquake_detail}'), + EmergencyProcedure( + title: intl.security_medical_emergency_title, + detail: 'assets/html/${intl.security_medical_emergency_detail}'), + ]; diff --git a/lib/features/ets/quick-link/widgets/security-info/security_view.dart b/lib/features/ets/quick-link/widgets/security-info/security_view.dart new file mode 100644 index 000000000..466f050a5 --- /dev/null +++ b/lib/features/ets/quick-link/widgets/security-info/security_view.dart @@ -0,0 +1,139 @@ +// Flutter imports: +import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:stacked/stacked.dart'; + +// Project imports: +import 'package:notredame/utils/utils.dart'; +import 'package:notredame/features/ets/quick-link/widgets/security-info/security_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; +import 'package:notredame/features/ets/quick-link/widgets/security-info/emergency_view.dart'; + +class SecurityView extends StatefulWidget { + @override + _SecurityViewState createState() => _SecurityViewState(); +} + +class _SecurityViewState extends State { + static const CameraPosition _etsLocation = CameraPosition( + target: LatLng(45.49449875, -73.56246144109338), zoom: 17.0); + + @override + Widget build(BuildContext context) => + ViewModelBuilder.reactive( + viewModelBuilder: () => SecurityViewModel(intl: AppIntl.of(context)!), + builder: (context, model, child) => Scaffold( + appBar: AppBar( + title: Text(AppIntl.of(context)!.ets_security_title), + ), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 250, + child: GoogleMap( + initialCameraPosition: _etsLocation, + zoomControlsEnabled: false, + markers: + model.getSecurityMarkersForMaps(model.markersList), + onMapCreated: (GoogleMapController controller) { + model.controller = controller; + model.changeMapMode(context); + }, + gestureRecognizers: >{ + Factory( + () => EagerGestureRecognizer()), + }), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + AppIntl.of(context)!.security_reach_security, + style: const TextStyle( + color: AppTheme.etsLightRed, fontSize: 24), + ), + ), + Card( + child: InkWell( + splashColor: Colors.red.withAlpha(50), + onTap: () => Utils.launchURL( + 'tel:${AppIntl.of(context)!.security_emergency_number}', + AppIntl.of(context)!) + .catchError((error) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text(error.toString()))); + }), + child: ListTile( + leading: const Icon(Icons.phone, size: 30), + title: Text(AppIntl.of(context)!.security_emergency_call), + subtitle: + Text(AppIntl.of(context)!.security_emergency_number), + ), + ), + ), + Card( + elevation: 0, + color: Colors.transparent, + child: ListTile( + leading: const Icon(Icons.phone, size: 30), + title: Text( + AppIntl.of(context)!.security_emergency_intern_call), + subtitle: Text( + AppIntl.of(context)!.security_emergency_intern_number), + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + AppIntl.of(context)!.security_emergency_procedures, + style: const TextStyle( + color: AppTheme.etsLightRed, fontSize: 24), + ), + ), + SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: List.generate( + model.emergencyProcedureList.length, + (index) => Card( + child: InkWell( + splashColor: Colors.red.withAlpha(50), + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => EmergencyView( + model.emergencyProcedureList[index].title, + model.emergencyProcedureList[index] + .detail))), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only( + top: 16.0, bottom: 16.0, left: 16.0), + child: Text( + model.emergencyProcedureList[index].title, + style: const TextStyle(fontSize: 18), + ), + ), + const Icon(Icons.arrow_forward_ios), + ], + ), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ); +} diff --git a/lib/features/ets/quick-link/widgets/security-info/security_viewmodel.dart b/lib/features/ets/quick-link/widgets/security-info/security_viewmodel.dart new file mode 100644 index 000000000..346fe0a75 --- /dev/null +++ b/lib/features/ets/quick-link/widgets/security-info/security_viewmodel.dart @@ -0,0 +1,54 @@ +// Flutter imports: +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:stacked/stacked.dart'; + +// Project imports: +import 'package:notredame/features/ets/quick-link/widgets/security-info/models/emergency_procedures.dart'; +import 'package:notredame/constants/markers.dart'; +import 'package:notredame/features/ets/quick-link/widgets/security-info/models/emergency_procedure.dart'; + +class SecurityViewModel extends BaseViewModel { + GoogleMapController? controller; + + final List emergencyProcedureList; + + final List markersList; + + SecurityViewModel({required AppIntl intl}) + : emergencyProcedureList = emergencyProcedures(intl), + markersList = markers(intl); + + /// Used to get all security buildings to show in Google Maps + Set getSecurityMarkersForMaps(List markersList) { + final Map markers = {}; + + for (int i = 0; i < markersList.length; i++) { + markers[markersList[i].markerId] = markersList[i]; + } + return Set.of(markers.values); + } + + /// Used to load a Json file + Future getJsonFile(String path) async { + return rootBundle.loadString(path); + } + + /// Used to change the color of the map based on the brightness + void changeMapMode(BuildContext context) { + if (Theme.of(context).brightness == Brightness.dark) { + getJsonFile("assets/dark_map_style.json").then(setMapStyle); + } else { + getJsonFile("assets/normal_map_style.json").then(setMapStyle); + } + } + + /// Used to set the color of the map + void setMapStyle(String mapStyle) { + controller?.setMapStyle(mapStyle); + } +} diff --git a/lib/features/ets/quick-link/widgets/web_link_card.dart b/lib/features/ets/quick-link/widgets/web_link_card.dart new file mode 100644 index 000000000..c10554164 --- /dev/null +++ b/lib/features/ets/quick-link/widgets/web_link_card.dart @@ -0,0 +1,54 @@ +// Flutter imports: +import 'package:flutter/material.dart'; + +// Package imports: +import 'package:stacked/stacked.dart'; + +// Project imports: +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/ets/quick-link/widgets/web_link_card_viewmodel.dart'; +import 'package:notredame/utils/app_theme.dart'; + +class WebLinkCard extends StatelessWidget { + final QuickLink _links; + + const WebLinkCard(this._links); + + @override + Widget build(BuildContext context) => + ViewModelBuilder.reactive( + viewModelBuilder: () => WebLinkCardViewModel(), + builder: (context, model, child) { + return ConstrainedBox( + constraints: const BoxConstraints.expand(), + child: Card( + elevation: 4.0, + child: InkWell( + borderRadius: const BorderRadius.all(Radius.circular(10)), + onTap: () => + model.onLinkClicked(_links, Theme.of(context).brightness), + splashColor: AppTheme.etsLightRed.withAlpha(50), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Expanded( + flex: 40, + child: _links.image, + ), + FittedBox( + fit: BoxFit.fitWidth, + child: Text( + _links.name, + style: const TextStyle( + color: AppTheme.etsLightRed, fontSize: 18.0), + ), + ), + ], + ), + ), + ), + ), + ); + }); +} diff --git a/lib/features/ets/quick-link/widgets/web_link_card_viewmodel.dart b/lib/features/ets/quick-link/widgets/web_link_card_viewmodel.dart new file mode 100644 index 000000000..1b8bff47b --- /dev/null +++ b/lib/features/ets/quick-link/widgets/web_link_card_viewmodel.dart @@ -0,0 +1,43 @@ +// Flutter imports: +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// Package imports: +import 'package:stacked/stacked.dart'; + +// Project imports: +import 'package:notredame/features/app/navigation/router_paths.dart'; +import 'package:notredame/features/ets/quick-link/models/quick_link.dart'; +import 'package:notredame/features/app/analytics/analytics_service.dart'; +import 'package:notredame/features/app/integration/launch_url_service.dart'; +import 'package:notredame/features/app/navigation/navigation_service.dart'; +import 'package:notredame/utils/locator.dart'; + +class WebLinkCardViewModel extends BaseViewModel { + /// used to redirect on the security. + final NavigationService _navigationService = locator(); + + final AnalyticsService _analyticsService = locator(); + + final LaunchUrlService _launchUrlService = locator(); + + /// used to open a website or the security view + Future onLinkClicked(QuickLink link, Brightness brightness) async { + _analyticsService.logEvent("QuickLink", "QuickLink clicked: ${link.name}"); + + if (link.link == 'security') { + _navigationService.pushNamed(RouterPaths.security); + } else { + try { + await _launchUrlService.launchInBrowser(link.link, brightness); + } catch (error) { + // An exception is thrown if browser app is not installed on Android device. + await launchWebView(link); + } + } + } + + Future launchWebView(QuickLink link) async { + _navigationService.pushNamed(RouterPaths.webView, arguments: link); + } +}