diff --git a/.githooks/pre-commit b/.githooks/pre-commit old mode 100644 new mode 100755 index 03939fb9d..b13cc8a69 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,3 +1,4 @@ #!/usr/bin/env bash -flutter format . \ No newline at end of file +flutter pub run import_sorter:main +flutter format . diff --git a/lib/core/constants/custom_feedback_localization.dart b/lib/core/constants/custom_feedback_localization.dart index e1752b299..f85c86d9d 100644 --- a/lib/core/constants/custom_feedback_localization.dart +++ b/lib/core/constants/custom_feedback_localization.dart @@ -1,6 +1,9 @@ -import 'package:feedback/feedback.dart'; +// Flutter imports: import 'package:flutter/material.dart'; +// Package imports: +import 'package:feedback/feedback.dart'; + abstract class CustomFeedbackLocalizations implements FeedbackLocalizations { String get email; } diff --git a/lib/core/constants/emergency_procedures.dart b/lib/core/constants/emergency_procedures.dart index e9d19d644..3508f29d9 100644 --- a/lib/core/constants/emergency_procedures.dart +++ b/lib/core/constants/emergency_procedures.dart @@ -1,4 +1,7 @@ +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +// Project imports: import 'package:notredame/core/models/emergency_procedure.dart'; List emergencyProcedures(AppIntl intl) => [ diff --git a/lib/core/constants/faq.dart b/lib/core/constants/faq.dart index 05592e81a..0b4272ead 100644 --- a/lib/core/constants/faq.dart +++ b/lib/core/constants/faq.dart @@ -1,13 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -// MODELS +// 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'; -// CONSTANTS -import 'package:notredame/core/constants/app_info.dart'; - class Faq { List questions = [ QuestionItem( diff --git a/lib/core/constants/markers.dart b/lib/core/constants/markers.dart index 52ebb1a8a..441d8d28c 100644 --- a/lib/core/constants/markers.dart +++ b/lib/core/constants/markers.dart @@ -1,5 +1,6 @@ -import 'package:google_maps_flutter/google_maps_flutter.dart'; +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; List markers(AppIntl intl) => [ Marker( diff --git a/lib/core/constants/preferences_flags.dart b/lib/core/constants/preferences_flags.dart index 3b578a17c..c62f6acb2 100644 --- a/lib/core/constants/preferences_flags.dart +++ b/lib/core/constants/preferences_flags.dart @@ -1,6 +1,9 @@ -import 'package:enum_to_string/enum_to_string.dart'; +// Flutter imports: import 'package:flutter/cupertino.dart'; +// Package imports: +import 'package:enum_to_string/enum_to_string.dart'; + enum PreferencesFlag { // Meta flag concerning the app versioning appVersion, diff --git a/lib/core/constants/quick_links.dart b/lib/core/constants/quick_links.dart index 823195e6e..78e462e63 100644 --- a/lib/core/constants/quick_links.dart +++ b/lib/core/constants/quick_links.dart @@ -1,13 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/widgets.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// MODELS +// Project imports: import 'package:notredame/core/models/quick_link.dart'; - -// UTILS import 'package:notredame/ui/utils/app_theme.dart'; List quickLinks(AppIntl intl) => [ diff --git a/lib/core/managers/cache_manager.dart b/lib/core/managers/cache_manager.dart index 9121cce8b..79b529661 100644 --- a/lib/core/managers/cache_manager.dart +++ b/lib/core/managers/cache_manager.dart @@ -1,13 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; +// Package imports: import 'package:flutter_cache_manager/flutter_cache_manager.dart' as lib; -// SERVICES +// Project imports: import 'package:notredame/core/services/analytics_service.dart'; import 'package:notredame/core/utils/cache_exception.dart'; - -// OTHER import 'package:notredame/locator.dart'; /// Abstraction of the cache management system. diff --git a/lib/core/managers/course_repository.dart b/lib/core/managers/course_repository.dart index f3182a02a..fc81c31f5 100644 --- a/lib/core/managers/course_repository.dart +++ b/lib/core/managers/course_repository.dart @@ -1,24 +1,22 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:ets_api_clients/clients.dart'; +import 'package:ets_api_clients/exceptions.dart'; +import 'package:ets_api_clients/models.dart'; import 'package:logger/logger.dart'; -// SERVICES -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/networking_service.dart'; +// Project imports: import 'package:notredame/core/managers/cache_manager.dart'; import 'package:notredame/core/managers/user_repository.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// UTILS +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:ets_api_clients/exceptions.dart'; - -// OTHER import 'package:notredame/locator.dart'; -import 'package:ets_api_clients/clients.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/core/managers/quick_link_repository.dart index 9250445b2..3bc2392c5 100644 --- a/lib/core/managers/quick_link_repository.dart +++ b/lib/core/managers/quick_link_repository.dart @@ -1,18 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// SERVICES +// Project imports: +import 'package:notredame/core/constants/quick_links.dart'; import 'package:notredame/core/managers/cache_manager.dart'; - -// MODELS import 'package:notredame/core/models/quick_link.dart'; import 'package:notredame/core/models/quick_link_data.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/quick_links.dart'; - -// OTHERS import 'package:notredame/locator.dart'; class QuickLinkRepository { diff --git a/lib/core/managers/settings_manager.dart b/lib/core/managers/settings_manager.dart index 58655fd93..93160f8c6 100644 --- a/lib/core/managers/settings_manager.dart +++ b/lib/core/managers/settings_manager.dart @@ -1,21 +1,19 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: +import 'package:flutter/material.dart'; + +// Package imports: import 'package:calendar_view/calendar_view.dart'; import 'package:enum_to_string/enum_to_string.dart'; -import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:intl/intl.dart'; import 'package:logger/logger.dart'; import 'package:table_calendar/table_calendar.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// SERVICES +// 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'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; - -// OTHER import 'package:notredame/locator.dart'; class SettingsManager with ChangeNotifier { diff --git a/lib/core/managers/user_repository.dart b/lib/core/managers/user_repository.dart index 5436013a2..1e74544d5 100644 --- a/lib/core/managers/user_repository.dart +++ b/lib/core/managers/user_repository.dart @@ -1,26 +1,23 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; +// Flutter imports: import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + +// Package imports: +import 'package:ets_api_clients/clients.dart'; +import 'package:ets_api_clients/exceptions.dart'; +import 'package:ets_api_clients/models.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:logger/logger.dart'; -// SERVICES +// 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/managers/cache_manager.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// UTILS -import 'package:ets_api_clients/exceptions.dart'; import 'package:notredame/core/utils/cache_exception.dart'; - -// OTHER import 'package:notredame/locator.dart'; -import 'package:ets_api_clients/clients.dart'; class UserRepository { static const String tag = "UserRepository"; diff --git a/lib/core/models/discovery.dart b/lib/core/models/discovery.dart index 9113c27db..c2d9949cf 100644 --- a/lib/core/models/discovery.dart +++ b/lib/core/models/discovery.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; class Discovery { diff --git a/lib/core/models/emergency_procedure.dart b/lib/core/models/emergency_procedure.dart index aa4340566..606f32ffd 100644 --- a/lib/core/models/emergency_procedure.dart +++ b/lib/core/models/emergency_procedure.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; class EmergencyProcedure { diff --git a/lib/core/models/faq_actions.dart b/lib/core/models/faq_actions.dart index c229ede28..17c268540 100644 --- a/lib/core/models/faq_actions.dart +++ b/lib/core/models/faq_actions.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; class ActionItem { diff --git a/lib/core/models/faq_questions.dart b/lib/core/models/faq_questions.dart index a96bc41a3..d7ea0ba98 100644 --- a/lib/core/models/faq_questions.dart +++ b/lib/core/models/faq_questions.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; class QuestionItem { diff --git a/lib/core/models/feedback_issue.dart b/lib/core/models/feedback_issue.dart index 7e1dfcae4..5dccbb517 100644 --- a/lib/core/models/feedback_issue.dart +++ b/lib/core/models/feedback_issue.dart @@ -1,3 +1,4 @@ +// Package imports: import 'package:github/github.dart'; class FeedbackIssue { diff --git a/lib/core/models/group_discovery.dart b/lib/core/models/group_discovery.dart index 0793dc06a..adfb0d3e0 100644 --- a/lib/core/models/group_discovery.dart +++ b/lib/core/models/group_discovery.dart @@ -1,7 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -// MODELS +// Project imports: import 'package:notredame/core/models/discovery.dart'; class GroupDiscovery { diff --git a/lib/core/models/quick_link.dart b/lib/core/models/quick_link.dart index d2699d7e3..60a28c0e1 100644 --- a/lib/core/models/quick_link.dart +++ b/lib/core/models/quick_link.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; class QuickLink { diff --git a/lib/core/models/quick_link_data.dart b/lib/core/models/quick_link_data.dart index 274b89b29..7895b9917 100644 --- a/lib/core/models/quick_link_data.dart +++ b/lib/core/models/quick_link_data.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; class QuickLinkData { diff --git a/lib/core/models/widget_models.dart b/lib/core/models/widget_models.dart index 540ab7a47..ef447a687 100644 --- a/lib/core/models/widget_models.dart +++ b/lib/core/models/widget_models.dart @@ -1,3 +1,4 @@ +// Flutter imports: import 'package:flutter/foundation.dart'; class GradesWidgetData { diff --git a/lib/core/services/analytics_service.dart b/lib/core/services/analytics_service.dart index 8c7c87ec0..d98fab89a 100644 --- a/lib/core/services/analytics_service.dart +++ b/lib/core/services/analytics_service.dart @@ -1,7 +1,9 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: +import 'package:flutter/material.dart'; + +// Package imports: import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; -import 'package:flutter/material.dart'; /// Manage the analytics of the application class AnalyticsService { diff --git a/lib/core/services/app_widget_service.dart b/lib/core/services/app_widget_service.dart index 895ea37b8..078ba8449 100644 --- a/lib/core/services/app_widget_service.dart +++ b/lib/core/services/app_widget_service.dart @@ -1,18 +1,22 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/services.dart'; + +// Package imports: import 'package:home_widget/home_widget.dart'; -// MODEL +// 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'; + +// MODEL // CONSTANTS -import 'package:notredame/core/constants/widget_helper.dart'; // MANAGER / SERVICE -import 'package:notredame/core/services/analytics_service.dart'; // OTHER -import 'package:notredame/locator.dart'; /// Manage the app widget function to update data and visual. class AppWidgetService { diff --git a/lib/core/services/github_api.dart b/lib/core/services/github_api.dart index f5f03a8d3..8b38a2c14 100644 --- a/lib/core/services/github_api.dart +++ b/lib/core/services/github_api.dart @@ -1,22 +1,22 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; import 'dart:io'; + +// Flutter imports: import 'package:flutter/foundation.dart'; + +// Package imports: +import 'package:flutter_config/flutter_config.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:github/github.dart'; import 'package:logger/logger.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:flutter_config/flutter_config.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// SERVICES -import 'package:notredame/core/services/internal_info_service.dart'; -import 'package:notredame/core/services/analytics_service.dart'; - -// MODELS +// Project imports: import 'package:notredame/core/models/feedback_issue.dart'; - -// OTHERS +import 'package:notredame/core/services/analytics_service.dart'; +import 'package:notredame/core/services/internal_info_service.dart'; import 'package:notredame/locator.dart'; class GithubApi { diff --git a/lib/core/services/in_app_review_service.dart b/lib/core/services/in_app_review_service.dart index 060f41426..2e5b03008 100644 --- a/lib/core/services/in_app_review_service.dart +++ b/lib/core/services/in_app_review_service.dart @@ -1,9 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:in_app_review/in_app_review.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/app_info.dart'; +// CONSTANTS + /// Manage the analytics of the application class InAppReviewService { final InAppReview _inAppReview = InAppReview.instance; diff --git a/lib/core/services/internal_info_service.dart b/lib/core/services/internal_info_service.dart index ee12b7d2a..5d30cc1af 100644 --- a/lib/core/services/internal_info_service.dart +++ b/lib/core/services/internal_info_service.dart @@ -1,13 +1,17 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Package imports: import 'package:device_info_plus/device_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart'; -// UTILS +// Project imports: +import 'package:notredame/core/services/networking_service.dart'; import 'package:notredame/locator.dart'; +// UTILS + // SERVICES -import 'package:notredame/core/services/networking_service.dart'; class InternalInfoService { // Build the error message with the current device informations diff --git a/lib/core/services/launch_url_service.dart b/lib/core/services/launch_url_service.dart index 145a527e2..b52bb4d22 100644 --- a/lib/core/services/launch_url_service.dart +++ b/lib/core/services/launch_url_service.dart @@ -1,16 +1,20 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_custom_tabs/flutter_custom_tabs.dart' as custom_tabs; import 'package:url_launcher/url_launcher.dart' as url_launch; -// Managers +// Project imports: import 'package:notredame/core/managers/settings_manager.dart'; +import 'package:notredame/locator.dart'; +import 'package:notredame/ui/utils/app_theme.dart'; + +// Managers // UTILS -import 'package:notredame/ui/utils/app_theme.dart'; // OTHER -import 'package:notredame/locator.dart'; class LaunchUrlService { final SettingsManager settingsManager = locator(); diff --git a/lib/core/services/navigation_service.dart b/lib/core/services/navigation_service.dart index 016391a56..06ff0599d 100644 --- a/lib/core/services/navigation_service.dart +++ b/lib/core/services/navigation_service.dart @@ -1,14 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -//SERVICE +// Project imports: +import 'package:notredame/core/constants/router_paths.dart'; import 'package:notredame/core/services/remote_config_service.dart'; +import 'package:notredame/locator.dart'; + +//SERVICE //CONSTANT -import 'package:notredame/core/constants/router_paths.dart'; //OTHERS -import 'package:notredame/locator.dart'; /// Navigation service who doesn't use the BuildContext which allow us to call it from anywhere. class NavigationService { diff --git a/lib/core/services/networking_service.dart b/lib/core/services/networking_service.dart index ce8b89363..d0318f944 100644 --- a/lib/core/services/networking_service.dart +++ b/lib/core/services/networking_service.dart @@ -1,5 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:async'; + +// Package imports: import 'package:connectivity_plus/connectivity_plus.dart'; class NetworkingService { diff --git a/lib/core/services/preferences_service.dart b/lib/core/services/preferences_service.dart index ed7ec0939..110a42b23 100644 --- a/lib/core/services/preferences_service.dart +++ b/lib/core/services/preferences_service.dart @@ -1,10 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:shared_preferences/shared_preferences.dart'; -// CONSTANT +// Project imports: import 'package:notredame/core/constants/preferences_flags.dart'; +// CONSTANT + class PreferencesService { final persistentsKey = [ PreferencesFlag.discoveryDashboard, diff --git a/lib/core/services/remote_config_service.dart b/lib/core/services/remote_config_service.dart index 995ed91a0..3c8f05e67 100644 --- a/lib/core/services/remote_config_service.dart +++ b/lib/core/services/remote_config_service.dart @@ -1,11 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES //SERVICE -import 'package:notredame/core/services/analytics_service.dart'; -//OTHERS +// Package imports: import 'package:firebase_remote_config/firebase_remote_config.dart'; + +// Project imports: +import 'package:notredame/core/services/analytics_service.dart'; import 'package:notredame/locator.dart'; +//OTHERS + /// Manage the analytics of the application class RemoteConfigService { static const String tag = "RemoteConfigService"; diff --git a/lib/core/services/rive_animation_service.dart b/lib/core/services/rive_animation_service.dart index a5ae43bc9..c1f910b7b 100644 --- a/lib/core/services/rive_animation_service.dart +++ b/lib/core/services/rive_animation_service.dart @@ -1,9 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + +// Package imports: import 'package:rive/rive.dart'; -// OTHER +// Project imports: import 'package:notredame/core/utils/animation_exception.dart'; /// Manage the rive animation for the application diff --git a/lib/core/services/siren_flutter_service.dart b/lib/core/services/siren_flutter_service.dart index e90455fd0..407a2ed7c 100644 --- a/lib/core/services/siren_flutter_service.dart +++ b/lib/core/services/siren_flutter_service.dart @@ -1,9 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/cupertino.dart'; + +// Package imports: import 'package:flutter_siren/flutter_siren.dart'; +import 'package:pub_semver/pub_semver.dart'; // SERVICES -import 'package:pub_semver/pub_semver.dart'; class SirenFlutterService { Siren _siren; diff --git a/lib/core/utils/animation_exception.dart b/lib/core/utils/animation_exception.dart index 54e025c9d..cc89e1daf 100644 --- a/lib/core/utils/animation_exception.dart +++ b/lib/core/utils/animation_exception.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; /// Exception that can be thrown by the rive animation service diff --git a/lib/core/utils/cache_exception.dart b/lib/core/utils/cache_exception.dart index 3086262d2..7f73f8e30 100644 --- a/lib/core/utils/cache_exception.dart +++ b/lib/core/utils/cache_exception.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; /// Exception that can be thrown by the [CacheManager] diff --git a/lib/core/utils/login_mask.dart b/lib/core/utils/login_mask.dart index d9da0c500..e45bd0351 100644 --- a/lib/core/utils/login_mask.dart +++ b/lib/core/utils/login_mask.dart @@ -1,3 +1,4 @@ +// Flutter imports: import 'package:flutter/services.dart'; class LoginMask extends TextInputFormatter { diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart index 9925a7dc4..2c12245db 100644 --- a/lib/core/utils/utils.dart +++ b/lib/core/utils/utils.dart @@ -1,9 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// 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:table_calendar/table_calendar.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; mixin Utils { /// Used to open a url diff --git a/lib/core/viewmodels/choose_language_viewmodel.dart b/lib/core/viewmodels/choose_language_viewmodel.dart index bcdf466db..84f7bd280 100644 --- a/lib/core/viewmodels/choose_language_viewmodel.dart +++ b/lib/core/viewmodels/choose_language_viewmodel.dart @@ -1,15 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -// SERVICE -import 'package:notredame/core/services/navigation_service.dart'; +// Project imports: +import 'package:notredame/core/constants/router_paths.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// OTHER +import 'package:notredame/core/services/navigation_service.dart'; import 'package:notredame/locator.dart'; -import 'package:notredame/core/constants/router_paths.dart'; class ChooseLanguageViewModel extends BaseViewModel { static const int english = 0; diff --git a/lib/core/viewmodels/contributors_viewmodel.dart b/lib/core/viewmodels/contributors_viewmodel.dart index 9678be18a..2272a88f9 100644 --- a/lib/core/viewmodels/contributors_viewmodel.dart +++ b/lib/core/viewmodels/contributors_viewmodel.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:github/github.dart'; import 'package:stacked/stacked.dart'; diff --git a/lib/core/viewmodels/dashboard_viewmodel.dart b/lib/core/viewmodels/dashboard_viewmodel.dart index 2f9752706..02a9fcda9 100644 --- a/lib/core/viewmodels/dashboard_viewmodel.dart +++ b/lib/core/viewmodels/dashboard_viewmodel.dart @@ -1,37 +1,33 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:collection'; + +// Flutter imports: +import 'package:flutter/material.dart'; + +// Package imports: +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:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.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/update_code.dart'; import 'package:notredame/core/constants/widget_helper.dart'; - -// MANAGER / SERVICE -import 'package:notredame/core/managers/settings_manager.dart'; import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/services/in_app_review_service.dart'; -import 'package:notredame/core/services/siren_flutter_service.dart'; -import 'package:notredame/core/services/preferences_service.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/preferences_service.dart'; import 'package:notredame/core/services/remote_config_service.dart'; - -// MODEL -import 'package:notredame/core/models/widget_models.dart'; -import 'package:ets_api_clients/models.dart'; - -// UTILS -import 'package:notredame/ui/utils/discovery_components.dart'; - -// OTHER +import 'package:notredame/core/services/siren_flutter_service.dart'; import 'package:notredame/locator.dart'; +import 'package:notredame/ui/utils/discovery_components.dart'; class DashboardViewModel extends FutureViewModel> { static const String tag = "DashboardViewModel"; diff --git a/lib/core/viewmodels/emergency_viewmodel.dart b/lib/core/viewmodels/emergency_viewmodel.dart index 6cc6c6ce6..aeb410d82 100644 --- a/lib/core/viewmodels/emergency_viewmodel.dart +++ b/lib/core/viewmodels/emergency_viewmodel.dart @@ -1,11 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; + +// Flutter imports: import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:webview_flutter/webview_flutter.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:webview_flutter/webview_flutter.dart'; -// VIEWMODEL +// Project imports: import 'package:notredame/core/viewmodels/security_viewmodel.dart'; class EmergencyViewModel extends SecurityViewModel { diff --git a/lib/core/viewmodels/faq_viewmodel.dart b/lib/core/viewmodels/faq_viewmodel.dart index 2fba133d9..4381124fb 100644 --- a/lib/core/viewmodels/faq_viewmodel.dart +++ b/lib/core/viewmodels/faq_viewmodel.dart @@ -1,18 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:notredame/locator.dart'; -import 'package:stacked/stacked.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -// MANAGERS +// Project imports: +import 'package:notredame/core/constants/app_info.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// SERVICES -import 'package:notredame/core/services/launch_url_service.dart'; import 'package:notredame/core/services/analytics_service.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/app_info.dart'; +import 'package:notredame/core/services/launch_url_service.dart'; +import 'package:notredame/locator.dart'; class FaqViewModel extends BaseViewModel { final SettingsManager _settingsManager = locator(); diff --git a/lib/core/viewmodels/feedback_viewmodel.dart b/lib/core/viewmodels/feedback_viewmodel.dart index 9ab085cf6..a6ca32345 100644 --- a/lib/core/viewmodels/feedback_viewmodel.dart +++ b/lib/core/viewmodels/feedback_viewmodel.dart @@ -1,26 +1,24 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; import 'dart:typed_data'; -import 'package:feedback/feedback.dart'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:feedback/feedback.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:github/github.dart'; -import 'package:stacked/stacked.dart'; import 'package:image/image.dart' as image; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -//SERVICE +// 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'; - -// MODELS -import 'package:notredame/core/models/feedback_issue.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/feedback_type.dart'; - -// OTHERS import 'package:notredame/locator.dart'; class FeedbackViewModel extends FutureViewModel { diff --git a/lib/core/viewmodels/grades_details_viewmodel.dart b/lib/core/viewmodels/grades_details_viewmodel.dart index f43c4dae9..75c1d9c88 100644 --- a/lib/core/viewmodels/grades_details_viewmodel.dart +++ b/lib/core/viewmodels/grades_details_viewmodel.dart @@ -1,27 +1,21 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:ets_api_clients/exceptions.dart'; +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:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/discovery_ids.dart'; import 'package:notredame/core/constants/preferences_flags.dart'; - -// UTILS -import 'package:notredame/ui/utils/discovery_components.dart'; -import 'package:ets_api_clients/exceptions.dart'; - -// MANAGERS / SERVICES import 'package:notredame/core/managers/course_repository.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// OTHER import 'package:notredame/locator.dart'; +import 'package:notredame/ui/utils/discovery_components.dart'; class GradesDetailsViewModel extends FutureViewModel { /// Used to get the courses of the student diff --git a/lib/core/viewmodels/grades_viewmodel.dart b/lib/core/viewmodels/grades_viewmodel.dart index 5eebe6eb5..1b2fb41d2 100644 --- a/lib/core/viewmodels/grades_viewmodel.dart +++ b/lib/core/viewmodels/grades_viewmodel.dart @@ -1,26 +1,20 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +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:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; +// Project imports: import 'package:notredame/core/constants/discovery_ids.dart'; - -// MANAGER +import 'package:notredame/core/constants/preferences_flags.dart'; import 'package:notredame/core/managers/course_repository.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// MODEL -import 'package:ets_api_clients/models.dart'; - -// UTILS -import 'package:notredame/ui/utils/discovery_components.dart'; - -// OTHER import 'package:notredame/locator.dart'; +import 'package:notredame/ui/utils/discovery_components.dart'; class GradesViewModel extends FutureViewModel>> { /// Used to get the courses of the student diff --git a/lib/core/viewmodels/login_viewmodel.dart b/lib/core/viewmodels/login_viewmodel.dart index 0061bda40..5e25b150e 100644 --- a/lib/core/viewmodels/login_viewmodel.dart +++ b/lib/core/viewmodels/login_viewmodel.dart @@ -1,20 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -// MANAGER +// 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'; - -// SERVICE import 'package:notredame/core/services/navigation_service.dart'; import 'package:notredame/core/services/preferences_service.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/router_paths.dart'; - -// OTHER import 'package:notredame/locator.dart'; class LoginViewModel extends BaseViewModel { diff --git a/lib/core/viewmodels/more_viewmodel.dart b/lib/core/viewmodels/more_viewmodel.dart index 8664d851e..838dbd74c 100644 --- a/lib/core/viewmodels/more_viewmodel.dart +++ b/lib/core/viewmodels/more_viewmodel.dart @@ -1,32 +1,26 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:feature_discovery/feature_discovery.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:stacked/stacked.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// UTILS -import 'package:notredame/ui/utils/discovery_components.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; +// Project imports: import 'package:notredame/core/constants/discovery_ids.dart'; - -// MANAGER +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/user_repository.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; import 'package:notredame/core/managers/course_repository.dart'; - -//SERVICE +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/navigation_service.dart'; import 'package:notredame/core/services/preferences_service.dart'; -import 'package:notredame/core/services/in_app_review_service.dart'; - -// OTHERS -import 'package:notredame/core/constants/router_paths.dart'; import 'package:notredame/locator.dart'; +import 'package:notredame/ui/utils/discovery_components.dart'; class MoreViewModel extends FutureViewModel { /// Cache manager diff --git a/lib/core/viewmodels/not_found_viewmodel.dart b/lib/core/viewmodels/not_found_viewmodel.dart index e3893d16f..3e4b7945d 100644 --- a/lib/core/viewmodels/not_found_viewmodel.dart +++ b/lib/core/viewmodels/not_found_viewmodel.dart @@ -1,16 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:rive/rive.dart'; import 'package:stacked/stacked.dart'; -// SERVICE +// 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'; - -// OTHER import 'package:notredame/locator.dart'; -import 'package:notredame/core/constants/router_paths.dart'; class NotFoundViewModel extends BaseViewModel { static const String tag = "NotFoundViewModel"; diff --git a/lib/core/viewmodels/outage_viewmodel.dart b/lib/core/viewmodels/outage_viewmodel.dart index 0dbf7ff43..aadd05e1d 100644 --- a/lib/core/viewmodels/outage_viewmodel.dart +++ b/lib/core/viewmodels/outage_viewmodel.dart @@ -1,18 +1,15 @@ +// Flutter imports: import 'package:flutter/material.dart'; -//SERVICE -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/remote_config_service.dart'; - -//VIEW -import 'package:notredame/ui/views/startup_view.dart'; +// Package imports: +import 'package:stacked/stacked.dart'; -//CONSTANT +// Project imports: import 'package:notredame/core/constants/router_paths.dart'; - -//OTHERS +import 'package:notredame/core/services/navigation_service.dart'; +import 'package:notredame/core/services/remote_config_service.dart'; import 'package:notredame/locator.dart'; -import 'package:stacked/stacked.dart'; +import 'package:notredame/ui/views/startup_view.dart'; class OutageViewModel extends BaseViewModel { int _lastTap = DateTime.now().millisecondsSinceEpoch; diff --git a/lib/core/viewmodels/profile_viewmodel.dart b/lib/core/viewmodels/profile_viewmodel.dart index 7128d93ca..58139e95f 100644 --- a/lib/core/viewmodels/profile_viewmodel.dart +++ b/lib/core/viewmodels/profile_viewmodel.dart @@ -1,22 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:fluttertoast/fluttertoast.dart'; -import 'package:stacked/stacked.dart'; +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - -// SERVICES -import 'package:notredame/core/services/analytics_service.dart'; - -// MANAGERS -import 'package:notredame/core/managers/user_repository.dart'; -// MODELS +// Package imports: import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:fluttertoast/fluttertoast.dart'; +import 'package:stacked/stacked.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/programs_credits.dart'; - -// OTHERS +import 'package:notredame/core/managers/user_repository.dart'; +import 'package:notredame/core/services/analytics_service.dart'; import 'package:notredame/locator.dart'; class ProfileViewModel extends FutureViewModel> { diff --git a/lib/core/viewmodels/quick_links_viewmodel.dart b/lib/core/viewmodels/quick_links_viewmodel.dart index ca59736b8..dfb2f6524 100644 --- a/lib/core/viewmodels/quick_links_viewmodel.dart +++ b/lib/core/viewmodels/quick_links_viewmodel.dart @@ -1,15 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; -// MANAGERS +// Project imports: import 'package:notredame/core/managers/quick_link_repository.dart'; - -// MODELS import 'package:notredame/core/models/quick_link.dart'; import 'package:notredame/core/models/quick_link_data.dart'; - -// OTHERS import 'package:notredame/locator.dart'; class QuickLinksViewModel extends FutureViewModel> { diff --git a/lib/core/viewmodels/schedule_settings_viewmodel.dart b/lib/core/viewmodels/schedule_settings_viewmodel.dart index 88d47f670..1055c1f3d 100644 --- a/lib/core/viewmodels/schedule_settings_viewmodel.dart +++ b/lib/core/viewmodels/schedule_settings_viewmodel.dart @@ -1,20 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:calendar_view/calendar_view.dart'; import 'package:enum_to_string/enum_to_string.dart'; +import 'package:ets_api_clients/models.dart'; import 'package:stacked/stacked.dart'; import 'package:table_calendar/table_calendar.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/preferences_flags.dart'; - -// MANAGERS -import 'package:notredame/core/managers/settings_manager.dart'; import 'package:notredame/core/managers/course_repository.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// OTHER +import 'package:notredame/core/managers/settings_manager.dart'; import 'package:notredame/locator.dart'; class ScheduleSettingsViewModel diff --git a/lib/core/viewmodels/schedule_viewmodel.dart b/lib/core/viewmodels/schedule_viewmodel.dart index 0ae75ccf6..bbd872c6a 100644 --- a/lib/core/viewmodels/schedule_viewmodel.dart +++ b/lib/core/viewmodels/schedule_viewmodel.dart @@ -1,31 +1,25 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: +import 'package:flutter/material.dart'; +// Package imports: import 'package:calendar_view/calendar_view.dart'; import 'package:enum_to_string/enum_to_string.dart'; +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:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; import 'package:table_calendar/table_calendar.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/discovery_ids.dart'; -// MANAGER +import 'package:notredame/core/constants/preferences_flags.dart'; import 'package:notredame/core/managers/course_repository.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// UTILS -import 'package:notredame/ui/utils/discovery_components.dart'; import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; - -// OTHER import 'package:notredame/locator.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; +import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/ui/utils/discovery_components.dart'; class ScheduleViewModel extends FutureViewModel> { /// Load the events diff --git a/lib/core/viewmodels/security_viewmodel.dart b/lib/core/viewmodels/security_viewmodel.dart index 14896d957..32cc23981 100644 --- a/lib/core/viewmodels/security_viewmodel.dart +++ b/lib/core/viewmodels/security_viewmodel.dart @@ -1,15 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES +// 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'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/emergency_procedures.dart'; import 'package:notredame/core/constants/markers.dart'; - -// MODEL import 'package:notredame/core/models/emergency_procedure.dart'; class SecurityViewModel extends BaseViewModel { diff --git a/lib/core/viewmodels/settings_viewmodel.dart b/lib/core/viewmodels/settings_viewmodel.dart index aa22058c0..20ebed7e2 100644 --- a/lib/core/viewmodels/settings_viewmodel.dart +++ b/lib/core/viewmodels/settings_viewmodel.dart @@ -1,12 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -// MANAGER +// Project imports: import 'package:notredame/core/managers/settings_manager.dart'; - -// OTHERS import 'package:notredame/locator.dart'; class SettingsViewModel extends FutureViewModel { diff --git a/lib/core/viewmodels/startup_viewmodel.dart b/lib/core/viewmodels/startup_viewmodel.dart index dff633be2..de5525d10 100644 --- a/lib/core/viewmodels/startup_viewmodel.dart +++ b/lib/core/viewmodels/startup_viewmodel.dart @@ -1,23 +1,19 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:stacked/stacked.dart'; -// SERVICES / MANAGER -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/core/services/navigation_service.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/core/services/analytics_service.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/update_code.dart'; - -// OTHER import 'package:notredame/locator.dart'; -import 'package:notredame/core/constants/router_paths.dart'; class StartUpViewModel extends BaseViewModel { /// Manage the settings diff --git a/lib/core/viewmodels/web_link_card_viewmodel.dart b/lib/core/viewmodels/web_link_card_viewmodel.dart index 27e285bb2..b61cef761 100644 --- a/lib/core/viewmodels/web_link_card_viewmodel.dart +++ b/lib/core/viewmodels/web_link_card_viewmodel.dart @@ -1,18 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:notredame/core/models/quick_link.dart'; + +// Package imports: import 'package:stacked/stacked.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/router_paths.dart'; - -// SERVICES +import 'package:notredame/core/models/quick_link.dart'; import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/navigation_service.dart'; import 'package:notredame/core/services/launch_url_service.dart'; - -// OTHER +import 'package:notredame/core/services/navigation_service.dart'; import 'package:notredame/locator.dart'; class WebLinkCardViewModel extends BaseViewModel { diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart index 0dc26c13c..6116c019b 100644 --- a/lib/firebase_options.dart +++ b/lib/firebase_options.dart @@ -1,6 +1,9 @@ // File generated by FlutterFire CLI. // ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members + +// Package imports: import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; + import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform; diff --git a/lib/locator.dart b/lib/locator.dart index abc371eab..ea8ee8336 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,31 +1,27 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:ets_api_clients/clients.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:get_it/get_it.dart'; import 'package:logger/logger.dart'; -// SERVICES -import 'package:notredame/core/services/navigation_service.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/github_api.dart'; -import 'package:notredame/core/services/internal_info_service.dart'; import 'package:notredame/core/services/siren_flutter_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/remote_config_service.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; - -// MANAGERS -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/managers/quick_link_repository.dart'; - -// OTHER -import 'package:ets_api_clients/clients.dart'; GetIt locator = GetIt.instance; diff --git a/lib/main.dart b/lib/main.dart index de659e3b3..6be1ef4db 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,41 +1,35 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:async'; + +// Flutter imports: +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +// Package imports: import 'package:calendar_view/calendar_view.dart'; import 'package:feature_discovery/feature_discovery.dart'; import 'package:feedback/feedback.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:firebase_core/firebase_core.dart'; -import 'package:notredame/firebase_options.dart'; -import 'package:notredame/ui/views/outage_view.dart'; -import 'package:notredame/ui/widgets/custom_feedback.dart'; -import 'package:provider/provider.dart'; +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter_config/flutter_config.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:provider/provider.dart'; -//CONSTANTS +// Project imports: import 'package:notredame/core/constants/custom_feedback_localization.dart'; - -// ROUTER -import 'package:notredame/ui/router.dart'; - -// SERVICES -import 'package:notredame/core/services/navigation_service.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'; - -// UTILS +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'; - -// MANAGER -import 'package:notredame/core/managers/settings_manager.dart'; - -// VIEW +import 'package:notredame/ui/views/outage_view.dart'; import 'package:notredame/ui/views/startup_view.dart'; +import 'package:notredame/ui/widgets/custom_feedback.dart'; Future main() async { setupLocator(); diff --git a/lib/ui/router.dart b/lib/ui/router.dart index b7739e1c0..8c857bddc 100644 --- a/lib/ui/router.dart +++ b/lib/ui/router.dart @@ -1,21 +1,23 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -// MODELS -import 'package:notredame/core/models/quick_link.dart'; +// Package imports: +import 'package:ets_api_clients/models.dart'; -// ROUTES +// Project imports: import 'package:notredame/core/constants/router_paths.dart'; - -// MODELS -import 'package:ets_api_clients/models.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'; - -// VIEWS +import 'package:notredame/ui/views/grade_details_view.dart'; import 'package:notredame/ui/views/login_view.dart'; -import 'package:notredame/ui/views/faq_view.dart'; -import 'package:notredame/ui/views/not_found_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_view.dart'; @@ -23,18 +25,8 @@ 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/views/about_view.dart'; -import 'package:notredame/ui/views/contributors_view.dart'; -import 'package:notredame/ui/views/choose_language_view.dart'; -import 'package:notredame/ui/views/dashboard_view.dart'; -import 'package:notredame/ui/views/grade_details_view.dart'; - -// WIDGETS import 'package:notredame/ui/widgets/link_web_view.dart'; -// CONSTANTS -import 'package:notredame/core/constants/update_code.dart'; - Route generateRoute(RouteSettings routeSettings) { switch (routeSettings.name) { case RouterPaths.startup: diff --git a/lib/ui/utils/app_theme.dart b/lib/ui/utils/app_theme.dart index 8cb651a3e..e0a993ea6 100644 --- a/lib/ui/utils/app_theme.dart +++ b/lib/ui/utils/app_theme.dart @@ -1,3 +1,4 @@ +// Flutter imports: import 'package:flutter/material.dart'; /// Contains all the colors and theme of the ETS, App|ETS and specific to the app diff --git a/lib/ui/utils/discovery_components.dart b/lib/ui/utils/discovery_components.dart index b7236cf6a..10196faee 100644 --- a/lib/ui/utils/discovery_components.dart +++ b/lib/ui/utils/discovery_components.dart @@ -1,25 +1,19 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// CONSTANTS +// 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/constants/discovery_ids.dart'; - -// MANAGERS import 'package:notredame/core/managers/settings_manager.dart'; - -// MODELS import 'package:notredame/core/models/discovery.dart'; import 'package:notredame/core/models/group_discovery.dart'; - -// UTILS -import 'package:notredame/ui/utils/app_theme.dart'; - -// OTHER import 'package:notredame/locator.dart'; +import 'package:notredame/ui/utils/app_theme.dart'; List discoveryComponents(BuildContext context) { return [ diff --git a/lib/ui/utils/loading.dart b/lib/ui/utils/loading.dart index 6ae89ec7b..a88c07882 100644 --- a/lib/ui/utils/loading.dart +++ b/lib/ui/utils/loading.dart @@ -1,3 +1,4 @@ +// Flutter imports: import 'package:flutter/material.dart'; Widget buildLoading({bool isInteractionLimitedWhileLoading = true}) => Stack( diff --git a/lib/ui/views/about_view.dart b/lib/ui/views/about_view.dart index 7d1044ac8..9cb3769cb 100644 --- a/lib/ui/views/about_view.dart +++ b/lib/ui/views/about_view.dart @@ -1,13 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:easter_egg_trigger/easter_egg_trigger.dart'; +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:easter_egg_trigger/easter_egg_trigger.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/urls.dart'; - -// OTHERS import 'package:notredame/core/utils/utils.dart'; class AboutView extends StatefulWidget { diff --git a/lib/ui/views/choose_language_view.dart b/lib/ui/views/choose_language_view.dart index 27d2e4743..98d77759e 100644 --- a/lib/ui/views/choose_language_view.dart +++ b/lib/ui/views/choose_language_view.dart @@ -1,15 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -// UTILS +// Project imports: import 'package:notredame/core/utils/utils.dart'; - -// VIEWMODELS import 'package:notredame/core/viewmodels/choose_language_viewmodel.dart'; - -// OTHER import 'package:notredame/ui/utils/app_theme.dart'; class ChooseLanguageView extends StatefulWidget { diff --git a/lib/ui/views/contributors_view.dart b/lib/ui/views/contributors_view.dart index b0f351c0f..a54d6ce45 100644 --- a/lib/ui/views/contributors_view.dart +++ b/lib/ui/views/contributors_view.dart @@ -1,16 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:github/github.dart'; import 'package:stacked/stacked.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// VIEWMODEL +// Project imports: +import 'package:notredame/core/utils/utils.dart'; import 'package:notredame/core/viewmodels/contributors_viewmodel.dart'; - -// OTHERS import 'package:notredame/ui/utils/loading.dart'; import 'package:notredame/ui/widgets/base_scaffold.dart'; -import 'package:notredame/core/utils/utils.dart'; class ContributorsView extends StatelessWidget { @override diff --git a/lib/ui/views/dashboard_view.dart b/lib/ui/views/dashboard_view.dart index ec86874da..50eb4b9ec 100644 --- a/lib/ui/views/dashboard_view.dart +++ b/lib/ui/views/dashboard_view.dart @@ -1,41 +1,35 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:auto_size_text/auto_size_text.dart'; -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; + +// Package imports: +import 'package:auto_size_text/auto_size_text.dart'; +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:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:stacked/stacked.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - -// VIEWMODEL -import 'package:notredame/core/viewmodels/dashboard_viewmodel.dart'; -// WIDGETS -import 'package:notredame/ui/widgets/dismissible_card.dart'; -import 'package:notredame/ui/widgets/base_scaffold.dart'; -import 'package:notredame/ui/widgets/course_activity_tile.dart'; -import 'package:notredame/ui/widgets/grade_button.dart'; -import 'package:notredame/ui/widgets/haptics_container.dart'; - -// MODELS / CONSTANTS -import 'package:ets_api_clients/models.dart'; -import 'package:notredame/locator.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/urls.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/update_code.dart'; import 'package:notredame/core/constants/router_paths.dart'; - -// UTILS +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/ui/utils/loading.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'; - -// SERVICES -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/analytics_service.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'; class DashboardView extends StatefulWidget { final UpdateCode updateCode; diff --git a/lib/ui/views/emergency_view.dart b/lib/ui/views/emergency_view.dart index 82a306127..bfa797267 100644 --- a/lib/ui/views/emergency_view.dart +++ b/lib/ui/views/emergency_view.dart @@ -1,15 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:stacked/stacked.dart'; import 'package:webview_flutter/webview_flutter.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// VIEW-MODEL +// Project imports: +import 'package:notredame/core/utils/utils.dart'; import 'package:notredame/core/viewmodels/emergency_viewmodel.dart'; - -// OTHERS import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/core/utils/utils.dart'; class EmergencyView extends StatefulWidget { final String title; diff --git a/lib/ui/views/faq_view.dart b/lib/ui/views/faq_view.dart index e088180b9..632974d4e 100644 --- a/lib/ui/views/faq_view.dart +++ b/lib/ui/views/faq_view.dart @@ -1,17 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:carousel_slider/carousel_slider.dart'; +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// VIEWMODEL -import 'package:notredame/core/viewmodels/faq_viewmodel.dart'; - -// MODELS -import 'package:notredame/core/models/faq_actions.dart'; +// Package imports: +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -// CONSTANTS +// 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'; class FaqView extends StatefulWidget { final Color backgroundColor; diff --git a/lib/ui/views/feedback_view.dart b/lib/ui/views/feedback_view.dart index 1277be85d..2ce12be95 100644 --- a/lib/ui/views/feedback_view.dart +++ b/lib/ui/views/feedback_view.dart @@ -1,19 +1,17 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feedback/feedback.dart'; +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:stacked/stacked.dart'; -// UTILS +// Package imports: +import 'package:feedback/feedback.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:notredame/ui/utils/loading.dart'; - -// VIEWMODEL -import 'package:notredame/core/viewmodels/feedback_viewmodel.dart'; +import 'package:stacked/stacked.dart'; -// CONSTANTS +// 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'; class FeedbackView extends StatefulWidget { @override diff --git a/lib/ui/views/grade_details_view.dart b/lib/ui/views/grade_details_view.dart index 271c7917c..6eed4b880 100644 --- a/lib/ui/views/grade_details_view.dart +++ b/lib/ui/views/grade_details_view.dart @@ -1,25 +1,21 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -import 'package:stacked/stacked.dart'; - -// VIEWMODELS -import 'package:notredame/core/viewmodels/grades_details_viewmodel.dart'; -// MODELS +// Package imports: import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -// WIDGETS -import 'package:notredame/ui/widgets/grade_circular_progress.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'; -// OTHERS -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:notredame/core/utils/utils.dart'; - class GradesDetailsView extends StatefulWidget { final Course course; diff --git a/lib/ui/views/grades_view.dart b/lib/ui/views/grades_view.dart index 7917d483d..e1d6730d6 100644 --- a/lib/ui/views/grades_view.dart +++ b/lib/ui/views/grades_view.dart @@ -1,28 +1,20 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; -import 'package:stacked/stacked.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// MODELS +// Package imports: import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; +import 'package:stacked/stacked.dart'; -// VIEW MODEL -import 'package:notredame/core/viewmodels/grades_viewmodel.dart'; - -// WIDGETS -import 'package:notredame/ui/widgets/grade_button.dart'; - -// SERVICES +// Project imports: import 'package:notredame/core/services/analytics_service.dart'; - -// UTILS -import 'package:notredame/ui/utils/loading.dart'; - -// OTHER -import 'package:notredame/ui/utils/app_theme.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'; class GradesView extends StatefulWidget { @override diff --git a/lib/ui/views/login_view.dart b/lib/ui/views/login_view.dart index 8135e44b6..c9ca7424b 100644 --- a/lib/ui/views/login_view.dart +++ b/lib/ui/views/login_view.dart @@ -1,31 +1,23 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:stacked/stacked.dart'; -// SERVICE -import 'package:notredame/core/services/navigation_service.dart'; +// Project imports: +import 'package:notredame/core/constants/router_paths.dart'; +import 'package:notredame/core/constants/urls.dart'; import 'package:notredame/core/services/launch_url_service.dart'; - -// UTILS -import 'package:notredame/core/utils/utils.dart'; +import 'package:notredame/core/services/navigation_service.dart'; import 'package:notredame/core/utils/login_mask.dart'; - -// VIEW MODEL +import 'package:notredame/core/utils/utils.dart'; import 'package:notredame/core/viewmodels/login_viewmodel.dart'; - -// WIDGETS -import 'package:notredame/ui/widgets/password_text_field.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/urls.dart'; -import 'package:notredame/core/constants/router_paths.dart'; - -// OTHER -import 'package:notredame/ui/utils/app_theme.dart'; import 'package:notredame/locator.dart'; +import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/ui/widgets/password_text_field.dart'; class LoginView extends StatefulWidget { @override diff --git a/lib/ui/views/more_view.dart b/lib/ui/views/more_view.dart index 8ed7f33d3..44c2b4a52 100644 --- a/lib/ui/views/more_view.dart +++ b/lib/ui/views/more_view.dart @@ -1,29 +1,23 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -import 'package:stacked/stacked.dart'; -import 'package:flutter/gestures.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// UTILS -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/ui/utils/discovery_components.dart'; +// Package imports: +import 'package:feature_discovery/feature_discovery.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -// CONSTANTS -import 'package:notredame/core/constants/router_paths.dart'; +// Project imports: import 'package:notredame/core/constants/discovery_ids.dart'; - -// VIEWMODELS -import 'package:notredame/core/viewmodels/more_viewmodel.dart'; - -// SERVICE +import 'package:notredame/core/constants/router_paths.dart'; import 'package:notredame/core/services/analytics_service.dart'; - -// OTHERS -import 'package:notredame/ui/widgets/base_scaffold.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'; class MoreView extends StatefulWidget { @override diff --git a/lib/ui/views/not_found_view.dart b/lib/ui/views/not_found_view.dart index 5e99c6c7a..111f7ddd4 100644 --- a/lib/ui/views/not_found_view.dart +++ b/lib/ui/views/not_found_view.dart @@ -1,13 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; -import 'package:rive/rive.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:rive/rive.dart'; +import 'package:stacked/stacked.dart'; -// VIEWMODELS +// Project imports: import 'package:notredame/core/viewmodels/not_found_viewmodel.dart'; - -// OTHER import 'package:notredame/ui/utils/app_theme.dart'; class NotFoundView extends StatefulWidget { diff --git a/lib/ui/views/outage_view.dart b/lib/ui/views/outage_view.dart index baf801bd0..cf21081a0 100644 --- a/lib/ui/views/outage_view.dart +++ b/lib/ui/views/outage_view.dart @@ -1,21 +1,17 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:stacked/stacked.dart'; -// UTILS +// Project imports: +import 'package:notredame/core/constants/urls.dart'; import 'package:notredame/core/utils/utils.dart'; - -// VIEW MODEL import 'package:notredame/core/viewmodels/outage_viewmodel.dart'; - -//UTILS import 'package:notredame/ui/utils/app_theme.dart'; -//CONSTANT -import 'package:notredame/core/constants/urls.dart'; - class OutageView extends StatelessWidget { @override Widget build(BuildContext context) => ViewModelBuilder< diff --git a/lib/ui/views/profile_view.dart b/lib/ui/views/profile_view.dart index c90eb2912..7a6738f82 100644 --- a/lib/ui/views/profile_view.dart +++ b/lib/ui/views/profile_view.dart @@ -1,27 +1,19 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:percent_indicator/percent_indicator.dart'; - -// VIEW-MODEL -import 'package:notredame/core/viewmodels/profile_viewmodel.dart'; -// MODEL +// Package imports: import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:percent_indicator/percent_indicator.dart'; +import 'package:stacked/stacked.dart'; -// SERVICES +// Project imports: import 'package:notredame/core/services/analytics_service.dart'; - -// WIDGETS -import 'package:notredame/ui/widgets/student_program.dart'; - -// UTILS -import 'package:notredame/ui/utils/loading.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; - -// OTHER +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'; class ProfileView extends StatefulWidget { @override diff --git a/lib/ui/views/quick_links_view.dart b/lib/ui/views/quick_links_view.dart index 3c3fb8d8d..c97aadeb9 100644 --- a/lib/ui/views/quick_links_view.dart +++ b/lib/ui/views/quick_links_view.dart @@ -1,21 +1,17 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:reorderable_grid_view/reorderable_grid_view.dart'; +import 'package:stacked/stacked.dart'; -// MODEL +// Project imports: import 'package:notredame/core/models/quick_link.dart'; - -// VIEW-MODEL import 'package:notredame/core/viewmodels/quick_links_viewmodel.dart'; - -// UTILS import 'package:notredame/ui/utils/app_theme.dart'; - -// WIDGETS import 'package:notredame/ui/widgets/base_scaffold.dart'; import 'package:notredame/ui/widgets/web_link_card.dart'; -import 'package:reorderable_grid_view/reorderable_grid_view.dart'; class QuickLinksView extends StatefulWidget { @override diff --git a/lib/ui/views/schedule_view.dart b/lib/ui/views/schedule_view.dart index ca2dd6121..f0140cb10 100644 --- a/lib/ui/views/schedule_view.dart +++ b/lib/ui/views/schedule_view.dart @@ -1,39 +1,29 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:calendar_view/calendar_view.dart' as calendar_view; -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; + +// Package imports: +import 'package:calendar_view/calendar_view.dart' as calendar_view; +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:stacked/stacked.dart'; import 'package:table_calendar/table_calendar.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// UTILS -import 'package:notredame/ui/utils/discovery_components.dart'; - -// VIEWMODEL -import 'package:notredame/core/viewmodels/schedule_viewmodel.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// SERVICES +// 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'; - -// WIDGET +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_settings.dart'; import 'package:notredame/ui/widgets/schedule_calendar_tile.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/discovery_ids.dart'; - -// OTHER -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/locator.dart'; +import 'package:notredame/ui/widgets/schedule_settings.dart'; class ScheduleView extends StatefulWidget { @visibleForTesting diff --git a/lib/ui/views/security_view.dart b/lib/ui/views/security_view.dart index 9102d7551..806fdd7e5 100644 --- a/lib/ui/views/security_view.dart +++ b/lib/ui/views/security_view.dart @@ -1,20 +1,18 @@ -// Flutter / DART / THIRD-PARTIES +// 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'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// VIEW MODEL +// Project imports: +import 'package:notredame/core/utils/utils.dart'; import 'package:notredame/core/viewmodels/security_viewmodel.dart'; - -// VIEWS -import 'package:notredame/ui/views/emergency_view.dart'; - -// OTHER import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/core/utils/utils.dart'; +import 'package:notredame/ui/views/emergency_view.dart'; class SecurityView extends StatefulWidget { @override diff --git a/lib/ui/views/settings_view.dart b/lib/ui/views/settings_view.dart index ffb8104ab..d19d1a31c 100644 --- a/lib/ui/views/settings_view.dart +++ b/lib/ui/views/settings_view.dart @@ -1,16 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; -// VIEWMODEL +// Project imports: import 'package:notredame/core/viewmodels/settings_viewmodel.dart'; - -// WIDGETS -import 'package:notredame/ui/widgets/base_scaffold.dart'; - -// OTHERS import 'package:notredame/ui/utils/app_theme.dart'; +import 'package:notredame/ui/widgets/base_scaffold.dart'; class SettingsView extends StatefulWidget { @override diff --git a/lib/ui/views/startup_view.dart b/lib/ui/views/startup_view.dart index e9e0361ee..dff487b38 100644 --- a/lib/ui/views/startup_view.dart +++ b/lib/ui/views/startup_view.dart @@ -1,15 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_svg/flutter_svg.dart'; import 'package:stacked/stacked.dart'; -// UTILS +// Project imports: import 'package:notredame/core/utils/utils.dart'; - -// VIEW MODEL import 'package:notredame/core/viewmodels/startup_viewmodel.dart'; - -// OTHER import 'package:notredame/ui/utils/app_theme.dart'; class StartUpView extends StatelessWidget { diff --git a/lib/ui/views/student_view.dart b/lib/ui/views/student_view.dart index 10e997584..75cfe9533 100644 --- a/lib/ui/views/student_view.dart +++ b/lib/ui/views/student_view.dart @@ -1,17 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:notredame/ui/views/grades_view.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/discovery_ids.dart'; - -// UTILS import 'package:notredame/ui/utils/app_theme.dart'; import 'package:notredame/ui/utils/discovery_components.dart'; - -// WIDGET +import 'package:notredame/ui/views/grades_view.dart'; import 'package:notredame/ui/views/profile_view.dart'; import 'package:notredame/ui/widgets/base_scaffold.dart'; diff --git a/lib/ui/widgets/base_scaffold.dart b/lib/ui/widgets/base_scaffold.dart index 044683d9e..90d585727 100644 --- a/lib/ui/widgets/base_scaffold.dart +++ b/lib/ui/widgets/base_scaffold.dart @@ -1,20 +1,21 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:async'; -import 'package:connectivity_plus/connectivity_plus.dart'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:notredame/core/services/networking_service.dart'; -// UTILS +// Project imports: +import 'package:notredame/core/services/networking_service.dart'; import 'package:notredame/core/utils/utils.dart'; -import 'package:notredame/ui/utils/loading.dart'; +import 'package:notredame/locator.dart'; import 'package:notredame/ui/utils/app_theme.dart'; - -// WIDGETS +import 'package:notredame/ui/utils/loading.dart'; import 'package:notredame/ui/widgets/bottom_bar.dart'; -import 'package:notredame/locator.dart'; - /// Basic Scaffold to avoid boilerplate code in the application. /// Contains a loader controlled by [_isLoading] class BaseScaffold extends StatefulWidget { diff --git a/lib/ui/widgets/bottom_bar.dart b/lib/ui/widgets/bottom_bar.dart index 2d3d09e24..69ff87825 100644 --- a/lib/ui/widgets/bottom_bar.dart +++ b/lib/ui/widgets/bottom_bar.dart @@ -1,22 +1,18 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:feature_discovery/feature_discovery.dart'; -// SERVICE -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/analytics_service.dart'; +// Package imports: +import 'package:feature_discovery/feature_discovery.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// CONSTANT -import 'package:notredame/core/constants/router_paths.dart'; +// Project imports: import 'package:notredame/core/constants/discovery_ids.dart'; - -// UTILS -import 'package:notredame/ui/utils/discovery_components.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; - -// OTHER +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'; /// Bottom navigation bar for the application. class BottomBar extends StatefulWidget { diff --git a/lib/ui/widgets/course_activity_tile.dart b/lib/ui/widgets/course_activity_tile.dart index 6f9ff5677..c8757c55d 100644 --- a/lib/ui/widgets/course_activity_tile.dart +++ b/lib/ui/widgets/course_activity_tile.dart @@ -1,9 +1,9 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -// MODELS +// Package imports: import 'package:ets_api_clients/models.dart'; +import 'package:intl/intl.dart'; class CourseActivityTile extends StatelessWidget { /// Course to display diff --git a/lib/ui/widgets/custom_feedback.dart b/lib/ui/widgets/custom_feedback.dart index c0cadbca5..4694cbd7a 100644 --- a/lib/ui/widgets/custom_feedback.dart +++ b/lib/ui/widgets/custom_feedback.dart @@ -1,11 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feedback/feedback.dart'; +// Flutter imports: import 'package:flutter/material.dart'; -// CONSTANTS -import 'package:notredame/core/constants/custom_feedback_localization.dart'; +// Package imports: +import 'package:feedback/feedback.dart'; -// MODELS +// Project imports: +import 'package:notredame/core/constants/custom_feedback_localization.dart'; import 'package:notredame/core/models/feedback.dart'; /// A form that prompts the user for the type of feedback they want to give and a diff --git a/lib/ui/widgets/dismissible_card.dart b/lib/ui/widgets/dismissible_card.dart index 2da595fb4..80ba3919b 100644 --- a/lib/ui/widgets/dismissible_card.dart +++ b/lib/ui/widgets/dismissible_card.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; class DismissibleCard extends StatelessWidget { diff --git a/lib/ui/widgets/grade_button.dart b/lib/ui/widgets/grade_button.dart index c2ee75b4b..4772f1884 100644 --- a/lib/ui/widgets/grade_button.dart +++ b/lib/ui/widgets/grade_button.dart @@ -1,24 +1,18 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// MANAGERS -import 'package:notredame/core/managers/settings_manager.dart'; +// Package imports: +import 'package:ets_api_clients/models.dart'; +import 'package:feature_discovery/feature_discovery.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -//CONSTANTS -import 'package:notredame/core/constants/router_paths.dart'; +// Project imports: import 'package:notredame/core/constants/discovery_ids.dart'; import 'package:notredame/core/constants/preferences_flags.dart'; - -// MODEL -import 'package:ets_api_clients/models.dart'; - -//OTHER +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'; - -// CONSTANT import 'package:notredame/ui/utils/app_theme.dart'; import 'package:notredame/ui/utils/discovery_components.dart'; diff --git a/lib/ui/widgets/grade_circular_progress.dart b/lib/ui/widgets/grade_circular_progress.dart index d53a0ef50..4511a3f0a 100644 --- a/lib/ui/widgets/grade_circular_progress.dart +++ b/lib/ui/widgets/grade_circular_progress.dart @@ -1,13 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:percent_indicator/percent_indicator.dart'; -// UTILS +// Project imports: import 'package:notredame/ui/utils/app_theme.dart'; -// OTHERS -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - class GradeCircularProgress extends StatefulWidget { final bool completed; final String finalGrade; diff --git a/lib/ui/widgets/grade_evaluation_tile.dart b/lib/ui/widgets/grade_evaluation_tile.dart index 0a6065555..41b53206c 100644 --- a/lib/ui/widgets/grade_evaluation_tile.dart +++ b/lib/ui/widgets/grade_evaluation_tile.dart @@ -1,28 +1,24 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:math'; -import 'package:feature_discovery/feature_discovery.dart'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:auto_size_text/auto_size_text.dart'; -import 'package:marquee/marquee.dart'; +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:marquee/marquee.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/discovery_ids.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// UTILS +import 'package:notredame/core/utils/utils.dart'; +import 'package:notredame/ui/utils/app_theme.dart'; import 'package:notredame/ui/utils/discovery_components.dart'; - -// WIDGETS import 'package:notredame/ui/widgets/grade_circular_progress.dart'; -// OTHER -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:notredame/ui/utils/app_theme.dart'; -import 'package:notredame/core/utils/utils.dart'; - class GradeEvaluationTile extends StatefulWidget { final bool completed; final CourseEvaluation evaluation; diff --git a/lib/ui/widgets/grade_not_available.dart b/lib/ui/widgets/grade_not_available.dart index cbdb1fe70..8b6e1e4ab 100644 --- a/lib/ui/widgets/grade_not_available.dart +++ b/lib/ui/widgets/grade_not_available.dart @@ -1,8 +1,10 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -// OTHER +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +// Project imports: import 'package:notredame/ui/utils/app_theme.dart'; class GradeNotAvailable extends StatelessWidget { diff --git a/lib/ui/widgets/haptics_container.dart b/lib/ui/widgets/haptics_container.dart index d96ba0a3e..c6fbba0fd 100644 --- a/lib/ui/widgets/haptics_container.dart +++ b/lib/ui/widgets/haptics_container.dart @@ -1,4 +1,4 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; diff --git a/lib/ui/widgets/link_web_view.dart b/lib/ui/widgets/link_web_view.dart index 69fbb0c47..c35e1150f 100644 --- a/lib/ui/widgets/link_web_view.dart +++ b/lib/ui/widgets/link_web_view.dart @@ -1,11 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:webview_flutter/webview_flutter.dart'; -// MODELS +// Project imports: import 'package:notredame/core/models/quick_link.dart'; - -// WIDGETS import 'package:notredame/ui/widgets/base_scaffold.dart'; class LinkWebView extends StatefulWidget { diff --git a/lib/ui/widgets/password_text_field.dart b/lib/ui/widgets/password_text_field.dart index 742af01d4..1fd9fe079 100644 --- a/lib/ui/widgets/password_text_field.dart +++ b/lib/ui/widgets/password_text_field.dart @@ -1,5 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; class PasswordFormField extends StatefulWidget { diff --git a/lib/ui/widgets/schedule_calendar_tile.dart b/lib/ui/widgets/schedule_calendar_tile.dart index 390306e4c..59ef8c6b0 100644 --- a/lib/ui/widgets/schedule_calendar_tile.dart +++ b/lib/ui/widgets/schedule_calendar_tile.dart @@ -1,5 +1,8 @@ -import 'package:auto_size_text/auto_size_text.dart'; +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; class ScheduleCalendarTile extends StatefulWidget { diff --git a/lib/ui/widgets/schedule_settings.dart b/lib/ui/widgets/schedule_settings.dart index 4ac5f184d..27cd95e02 100644 --- a/lib/ui/widgets/schedule_settings.dart +++ b/lib/ui/widgets/schedule_settings.dart @@ -1,19 +1,16 @@ -import 'package:calendar_view/calendar_view.dart'; +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:table_calendar/table_calendar.dart'; -// MODELS +// Package imports: +import 'package:calendar_view/calendar_view.dart'; import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:stacked/stacked.dart'; +import 'package:table_calendar/table_calendar.dart'; -// UTILS +// Project imports: import 'package:notredame/core/utils/utils.dart'; - -// VIEWMODELS import 'package:notredame/core/viewmodels/schedule_settings_viewmodel.dart'; - -// OTHER import 'package:notredame/ui/utils/app_theme.dart'; class ScheduleSettings extends StatefulWidget { diff --git a/lib/ui/widgets/student_program.dart b/lib/ui/widgets/student_program.dart index 6c19f01c0..d9aefc2de 100644 --- a/lib/ui/widgets/student_program.dart +++ b/lib/ui/widgets/student_program.dart @@ -1,12 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:math'; + +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// MODEL +// Package imports: import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// OTHER +// Project imports: import 'package:notredame/ui/utils/app_theme.dart'; class StudentProgram extends StatefulWidget { diff --git a/lib/ui/widgets/web_link_card.dart b/lib/ui/widgets/web_link_card.dart index f0d4e5a6d..2ca0360b0 100644 --- a/lib/ui/widgets/web_link_card.dart +++ b/lib/ui/widgets/web_link_card.dart @@ -1,14 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:stacked/stacked.dart'; -// VIEWMODEL -import 'package:notredame/core/viewmodels/web_link_card_viewmodel.dart'; +// Package imports: +import 'package:stacked/stacked.dart'; -// MODEL +// Project imports: import 'package:notredame/core/models/quick_link.dart'; - -// UTILS +import 'package:notredame/core/viewmodels/web_link_card_viewmodel.dart'; import 'package:notredame/ui/utils/app_theme.dart'; class WebLinkCard extends StatelessWidget { diff --git a/pubspec.lock b/pubspec.lock index 54a5724b1..b2e55531b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -632,6 +632,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.3" + import_sorter: + dependency: "direct main" + description: + name: import_sorter + url: "https://pub.dartlang.org" + source: hosted + version: "4.6.0" in_app_review: dependency: "direct main" description: @@ -1113,6 +1120,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.12" + tint: + dependency: transitive + description: + name: tint + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" typed_data: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 30cf5dc5a..fa7f893a5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ 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.28.0+1 +version: 4.28.1+1 environment: sdk: ">=2.10.0 <3.0.0" @@ -73,6 +73,7 @@ dependencies: calendar_view: ^1.0.1 carousel_slider: ^4.2.1 reorderable_grid_view: ^2.2.6 + import_sorter: ^4.6.0 dev_dependencies: flutter_test: diff --git a/test/helpers.dart b/test/helpers.dart index 2b8e67a91..798cb6b61 100644 --- a/test/helpers.dart +++ b/test/helpers.dart @@ -1,37 +1,35 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + +// Package imports: +import 'package:ets_api_clients/clients.dart'; +import 'package:ets_api_clients/testing.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:logger/logger.dart'; -// OTHER -import 'package:notredame/locator.dart'; -import 'package:ets_api_clients/clients.dart'; - -// SERVICES / MANAGERS -import 'package:notredame/core/services/navigation_service.dart'; -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/services/rive_animation_service.dart'; -import 'package:notredame/core/managers/user_repository.dart'; +// Project imports: import 'package:notredame/core/managers/cache_manager.dart'; -import 'package:notredame/core/services/preferences_service.dart'; import 'package:notredame/core/managers/course_repository.dart'; -import 'package:notredame/core/services/github_api.dart'; +import 'package:notredame/core/managers/quick_link_repository.dart'; import 'package:notredame/core/managers/settings_manager.dart'; -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/core/services/internal_info_service.dart'; -import 'package:notredame/core/services/siren_flutter_service.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/managers/quick_link_repository.dart'; - -// MOCKS -import 'package:ets_api_clients/testing.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 '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 ab251fd88..9ec3e0da1 100644 --- a/test/managers/course_repository_test.dart +++ b/test/managers/course_repository_test.dart @@ -1,25 +1,21 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; + +// Package imports: +import 'package:ets_api_clients/clients.dart'; +import 'package:ets_api_clients/exceptions.dart'; +import 'package:ets_api_clients/models.dart'; +import 'package:ets_api_clients/testing.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart'; import 'package:mockito/mockito.dart'; -// SERVICES / MANAGER -import 'package:notredame/core/services/analytics_service.dart'; -import 'package:notredame/core/managers/user_repository.dart'; +// Project imports: import 'package:notredame/core/managers/cache_manager.dart'; import 'package:notredame/core/managers/course_repository.dart'; -import 'package:ets_api_clients/clients.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; -import 'package:ets_api_clients/exceptions.dart'; - -// UTILS +import 'package:notredame/core/managers/user_repository.dart'; +import 'package:notredame/core/services/analytics_service.dart'; import '../helpers.dart'; - -// MOCKS -import 'package:ets_api_clients/testing.dart'; import '../mock/managers/cache_manager_mock.dart'; import '../mock/managers/user_repository_mock.dart'; import '../mock/services/networking_service_mock.dart'; diff --git a/test/managers/quick_link_repository_test.dart b/test/managers/quick_link_repository_test.dart index f65b26e8e..f3de245f0 100644 --- a/test/managers/quick_link_repository_test.dart +++ b/test/managers/quick_link_repository_test.dart @@ -1,21 +1,19 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// SERVICES / MANAGER +// Project imports: import 'package:notredame/core/managers/cache_manager.dart'; import 'package:notredame/core/managers/quick_link_repository.dart'; - -// MODELS import 'package:notredame/core/models/quick_link.dart'; import 'package:notredame/core/models/quick_link_data.dart'; - -// UTILS import '../helpers.dart'; - -// MOCKS import '../mock/managers/cache_manager_mock.dart'; void main() { diff --git a/test/managers/settings_manager_test.dart b/test/managers/settings_manager_test.dart index 731eb5c5c..e3ff48dca 100644 --- a/test/managers/settings_manager_test.dart +++ b/test/managers/settings_manager_test.dart @@ -1,26 +1,21 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: +import 'package:flutter/material.dart'; + +// Package imports: import 'package:calendar_view/calendar_view.dart'; import 'package:enum_to_string/enum_to_string.dart'; -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart'; import 'package:mockito/mockito.dart'; import 'package:table_calendar/table_calendar.dart'; -// MANAGER +// Project imports: +import 'package:notredame/core/constants/preferences_flags.dart'; import 'package:notredame/core/managers/settings_manager.dart'; import 'package:notredame/core/services/analytics_service.dart'; - -// SERVICE import 'package:notredame/core/services/preferences_service.dart'; import 'package:notredame/core/services/remote_config_service.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; - import '../helpers.dart'; - -// MOCK import '../mock/services/preferences_service_mock.dart'; import '../mock/services/remote_config_service_mock.dart'; diff --git a/test/managers/user_repository_test.dart b/test/managers/user_repository_test.dart index 1a9d650d2..95b23e34d 100644 --- a/test/managers/user_repository_test.dart +++ b/test/managers/user_repository_test.dart @@ -1,34 +1,28 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; + +// Flutter imports: import 'package:flutter/services.dart'; + +// Package imports: +import 'package:ets_api_clients/clients.dart'; +import 'package:ets_api_clients/exceptions.dart'; +import 'package:ets_api_clients/models.dart'; +import 'package:ets_api_clients/testing.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// SERVICES / MANAGER -import 'package:notredame/core/managers/user_repository.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'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// UTILS -import 'package:ets_api_clients/exceptions.dart'; - -// HELPERS import '../helpers.dart'; - -// MOCKS -import 'package:ets_api_clients/testing.dart'; import '../mock/managers/cache_manager_mock.dart'; import '../mock/services/flutter_secure_storage_mock.dart'; import '../mock/services/networking_service_mock.dart'; -// OTHER -import 'package:ets_api_clients/clients.dart'; - void main() { AnalyticsService analyticsService; MonETSAPIClient monETSApi; diff --git a/test/mock/managers/cache_manager_mock.dart b/test/mock/managers/cache_manager_mock.dart index 907f63fd1..19bc43c80 100644 --- a/test/mock/managers/cache_manager_mock.dart +++ b/test/mock/managers/cache_manager_mock.dart @@ -1,10 +1,8 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/managers/cache_manager.dart'; - -// UTILS import 'package:notredame/core/utils/cache_exception.dart'; /// Mock for the [CacheManager] diff --git a/test/mock/managers/course_repository_mock.dart b/test/mock/managers/course_repository_mock.dart index 0f07ceb8b..4dfbda627 100644 --- a/test/mock/managers/course_repository_mock.dart +++ b/test/mock/managers/course_repository_mock.dart @@ -1,15 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:ets_api_clients/exceptions.dart'; +import 'package:ets_api_clients/models.dart'; import 'package:mockito/mockito.dart'; -// MANAGER +// Project imports: import 'package:notredame/core/managers/course_repository.dart'; -// MODELS -import 'package:ets_api_clients/models.dart'; - -// UTILS -import 'package:ets_api_clients/exceptions.dart'; - class CourseRepositoryMock extends Mock implements CourseRepository { /// Stub the getter [coursesActivities] of [mock] when called will return [toReturn]. static void stubCoursesActivities(CourseRepositoryMock mock, diff --git a/test/mock/managers/quick_links_repository_mock.dart b/test/mock/managers/quick_links_repository_mock.dart index af529884d..8cde2beb5 100644 --- a/test/mock/managers/quick_links_repository_mock.dart +++ b/test/mock/managers/quick_links_repository_mock.dart @@ -1,16 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:ets_api_clients/exceptions.dart'; import 'package:mockito/mockito.dart'; -// MANAGER +// Project imports: import 'package:notredame/core/managers/quick_link_repository.dart'; - -// MODELS import 'package:notredame/core/models/quick_link.dart'; import 'package:notredame/core/models/quick_link_data.dart'; -// UTILS -import 'package:ets_api_clients/exceptions.dart'; - class QuickLinkRepositoryMock extends Mock implements QuickLinkRepository { /// Stub the function [getQuickLinkDataFromCache] of [mock] when called will return [toReturn]. static void stubGetQuickLinkDataFromCache(QuickLinkRepositoryMock mock, diff --git a/test/mock/managers/settings_manager_mock.dart b/test/mock/managers/settings_manager_mock.dart index 44cf261e0..5a90997cb 100644 --- a/test/mock/managers/settings_manager_mock.dart +++ b/test/mock/managers/settings_manager_mock.dart @@ -1,12 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:mockito/mockito.dart'; -// MANAGER -import 'package:notredame/core/managers/settings_manager.dart'; +// Package imports: +import 'package:mockito/mockito.dart'; -// MODEL +// Project imports: import 'package:notredame/core/constants/preferences_flags.dart'; +import 'package:notredame/core/managers/settings_manager.dart'; class SettingsManagerMock extends Mock implements SettingsManager { /// Stub the [getScheduleSettings] function of [mock], when called return [toReturn]. diff --git a/test/mock/managers/user_repository_mock.dart b/test/mock/managers/user_repository_mock.dart index 0c8f1847c..0eb6b9955 100644 --- a/test/mock/managers/user_repository_mock.dart +++ b/test/mock/managers/user_repository_mock.dart @@ -1,15 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:ets_api_clients/exceptions.dart'; +import 'package:ets_api_clients/models.dart'; import 'package:mockito/mockito.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/managers/user_repository.dart'; -// MODELS -import 'package:ets_api_clients/models.dart'; - -// UTILS -import 'package:ets_api_clients/exceptions.dart'; - /// Mock for the [UserRepository] class UserRepositoryMock extends Mock implements UserRepository { /// When [monETSUser] is called will return [userToReturn] diff --git a/test/mock/services/analytics_service_mock.dart b/test/mock/services/analytics_service_mock.dart index 06d542fa3..78cd8a958 100644 --- a/test/mock/services/analytics_service_mock.dart +++ b/test/mock/services/analytics_service_mock.dart @@ -1,7 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/services/analytics_service.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 7186e5b2c..f2edbb8b2 100644 --- a/test/mock/services/app_widget_service_mock.dart +++ b/test/mock/services/app_widget_service_mock.dart @@ -1,7 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/services/app_widget_service.dart'; /// Mock for the [AppWidgetService] diff --git a/test/mock/services/flutter_secure_storage_mock.dart b/test/mock/services/flutter_secure_storage_mock.dart index 56a2337fd..4d6b425d4 100644 --- a/test/mock/services/flutter_secure_storage_mock.dart +++ b/test/mock/services/flutter_secure_storage_mock.dart @@ -1,5 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:mockito/mockito.dart'; diff --git a/test/mock/services/github_api_mock.dart b/test/mock/services/github_api_mock.dart index b350001a6..c70ffcab6 100644 --- a/test/mock/services/github_api_mock.dart +++ b/test/mock/services/github_api_mock.dart @@ -1,12 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; -import 'package:mockito/mockito.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:mockito/mockito.dart'; -// MODELS +// Project imports: import 'package:notredame/core/models/feedback_issue.dart'; - -// SERVICES import 'package:notredame/core/services/github_api.dart'; /// Mock for the [GithubApi] diff --git a/test/mock/services/home_widget_mock.dart b/test/mock/services/home_widget_mock.dart index cf20d3a40..71f1f619c 100644 --- a/test/mock/services/home_widget_mock.dart +++ b/test/mock/services/home_widget_mock.dart @@ -1,75 +1,77 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:home_widget/home_widget.dart'; -import 'package:mockito/mockito.dart'; - -// SERVICE -import 'package:notredame/core/services/app_widget_service.dart'; - -/// Pseudo-mock for the static [HomeWidget] class (mocks the channel instead) -class HomeWidgetMock extends Mock { - MethodChannel _channel; - TestDefaultBinaryMessenger _messenger; - - HomeWidgetMock() { - _channel = const MethodChannel('home_widget'); - - _messenger = - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger; - } - - /// Overrides [HomeWidget]'s channel messenger behavior on [HomeWidget.setAppGroupId] - /// to enable [AppWidgetService.init] testing - void stubInit() { - _messenger.setMockMethodCallHandler(_channel, - (MethodCall methodCall) async { - if (methodCall.method == 'setAppGroupId' && - methodCall.arguments.toString() == - {'groupId': 'group.ca.etsmtl.applets.ETSMobile'}.toString()) { - return true; - } - return false; - }); - } - - /// Overrides [HomeWidget]'s channel messenger behavior on [HomeWidget.saveWidgetData] - /// to enable [AppWidgetService] send...Data testing - void stubSaveWidgetDataMock( - List expectedIds, List expectedDatas) { - _messenger.setMockMethodCallHandler(_channel, - (MethodCall methodCall) async { - for (int i = 0; i < expectedIds.length; i++) { - if (methodCall.method == 'saveWidgetData' && - methodCall.arguments.toString() == - { - 'id': expectedIds[i], - 'data': expectedDatas[i], - }.toString()) { - return true; - } - } - - throw PlatformException(code: "ERR1", message: "Test failed, wrong data"); - }); - } - - /// Overrides [HomeWidget]'s channel messenger behavior on [HomeWidget.saveWidgetData] - /// to enable [AppWidgetService] send...Data testing - void stubUpdateWidgetMock(String name, String androidName, String iOSName) { - _messenger.setMockMethodCallHandler(_channel, - (MethodCall methodCall) async { - if (methodCall.method == 'updateWidget' && - methodCall.arguments.toString() == - { - 'name': name, - 'android': androidName, - 'ios': iOSName, - 'qualifiedAndroidName': null - }.toString()) { - return true; - } - return false; - }); - } -} +// Flutter imports: +import 'package:flutter/services.dart'; + +// Package imports: +import 'package:flutter_test/flutter_test.dart'; +import 'package:home_widget/home_widget.dart'; +import 'package:mockito/mockito.dart'; + +// Project imports: +import 'package:notredame/core/services/app_widget_service.dart'; + +/// Pseudo-mock for the static [HomeWidget] class (mocks the channel instead) +class HomeWidgetMock extends Mock { + MethodChannel _channel; + TestDefaultBinaryMessenger _messenger; + + HomeWidgetMock() { + _channel = const MethodChannel('home_widget'); + + _messenger = + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger; + } + + /// Overrides [HomeWidget]'s channel messenger behavior on [HomeWidget.setAppGroupId] + /// to enable [AppWidgetService.init] testing + void stubInit() { + _messenger.setMockMethodCallHandler(_channel, + (MethodCall methodCall) async { + if (methodCall.method == 'setAppGroupId' && + methodCall.arguments.toString() == + {'groupId': 'group.ca.etsmtl.applets.ETSMobile'}.toString()) { + return true; + } + return false; + }); + } + + /// Overrides [HomeWidget]'s channel messenger behavior on [HomeWidget.saveWidgetData] + /// to enable [AppWidgetService] send...Data testing + void stubSaveWidgetDataMock( + List expectedIds, List expectedDatas) { + _messenger.setMockMethodCallHandler(_channel, + (MethodCall methodCall) async { + for (int i = 0; i < expectedIds.length; i++) { + if (methodCall.method == 'saveWidgetData' && + methodCall.arguments.toString() == + { + 'id': expectedIds[i], + 'data': expectedDatas[i], + }.toString()) { + return true; + } + } + + throw PlatformException(code: "ERR1", message: "Test failed, wrong data"); + }); + } + + /// Overrides [HomeWidget]'s channel messenger behavior on [HomeWidget.saveWidgetData] + /// to enable [AppWidgetService] send...Data testing + void stubUpdateWidgetMock(String name, String androidName, String iOSName) { + _messenger.setMockMethodCallHandler(_channel, + (MethodCall methodCall) async { + if (methodCall.method == 'updateWidget' && + methodCall.arguments.toString() == + { + 'name': name, + 'android': androidName, + 'ios': iOSName, + 'qualifiedAndroidName': null + }.toString()) { + return true; + } + return false; + }); + } +} diff --git a/test/mock/services/http_client_mock.dart b/test/mock/services/http_client_mock.dart index bb8c4c0cc..085cb1d69 100644 --- a/test/mock/services/http_client_mock.dart +++ b/test/mock/services/http_client_mock.dart @@ -1,7 +1,9 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:convert'; -import 'package:mockito/mockito.dart'; + +// Package imports: import 'package:http/http.dart' as http; +import 'package:mockito/mockito.dart'; /// Mock for the Http client class HttpClientMock extends Mock implements http.Client { diff --git a/test/mock/services/in_app_review_service_mock.dart b/test/mock/services/in_app_review_service_mock.dart index e539f3f8c..a0367af1f 100644 --- a/test/mock/services/in_app_review_service_mock.dart +++ b/test/mock/services/in_app_review_service_mock.dart @@ -1,7 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/services/in_app_review_service.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 f7c9cfb48..570b81ff3 100644 --- a/test/mock/services/internal_info_service_mock.dart +++ b/test/mock/services/internal_info_service_mock.dart @@ -1,8 +1,10 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; -import 'package:notredame/core/services/internal_info_service.dart'; import 'package:package_info_plus/package_info_plus.dart'; +// Project imports: +import 'package:notredame/core/services/internal_info_service.dart'; + class InternalInfoServiceMock extends Mock implements InternalInfoService { /// Stub the answer of [getDeviceInfoForErrorReporting] static void stubGetDeviceInfoForErrorReporting(InternalInfoServiceMock mock) { diff --git a/test/mock/services/launch_url_service_mock.dart b/test/mock/services/launch_url_service_mock.dart index 90a4d0bcd..0a328d3b6 100644 --- a/test/mock/services/launch_url_service_mock.dart +++ b/test/mock/services/launch_url_service_mock.dart @@ -1,7 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/services/launch_url_service.dart'; /// Mock for the [LaunchUrlService] diff --git a/test/mock/services/navigation_service_mock.dart b/test/mock/services/navigation_service_mock.dart index 3ad75bbd5..0d53f6aef 100644 --- a/test/mock/services/navigation_service_mock.dart +++ b/test/mock/services/navigation_service_mock.dart @@ -1,7 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/services/navigation_service.dart'; /// Mock for the [NavigationService] diff --git a/test/mock/services/networking_service_mock.dart b/test/mock/services/networking_service_mock.dart index 0d9591cde..e56f0ffd9 100644 --- a/test/mock/services/networking_service_mock.dart +++ b/test/mock/services/networking_service_mock.dart @@ -1,8 +1,8 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:mockito/mockito.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/services/networking_service.dart'; /// Mock for the [NetworkingService] diff --git a/test/mock/services/preferences_service_mock.dart b/test/mock/services/preferences_service_mock.dart index ce52db54e..dcacca670 100644 --- a/test/mock/services/preferences_service_mock.dart +++ b/test/mock/services/preferences_service_mock.dart @@ -1,10 +1,8 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; -// CONSTANT +// Project imports: import 'package:notredame/core/constants/preferences_flags.dart'; - -// SERVICE import 'package:notredame/core/services/preferences_service.dart'; class PreferencesServiceMock extends Mock implements PreferencesService { diff --git a/test/mock/services/remote_config_service_mock.dart b/test/mock/services/remote_config_service_mock.dart index 567653208..10da62de9 100644 --- a/test/mock/services/remote_config_service_mock.dart +++ b/test/mock/services/remote_config_service_mock.dart @@ -1,5 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; + +// Project imports: import 'package:notredame/core/services/remote_config_service.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 883d58624..958573652 100644 --- a/test/mock/services/rive_animation_service_mock.dart +++ b/test/mock/services/rive_animation_service_mock.dart @@ -1,11 +1,9 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; - -// SERVICE -import 'package:notredame/core/services/rive_animation_service.dart'; import 'package:rive/rive.dart'; -// OTHER +// Project imports: +import 'package:notredame/core/services/rive_animation_service.dart'; import 'package:notredame/core/utils/animation_exception.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 5a7a672ba..36826c96b 100644 --- a/test/mock/services/siren_flutter_service_mock.dart +++ b/test/mock/services/siren_flutter_service_mock.dart @@ -1,9 +1,11 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:mockito/mockito.dart'; import 'package:pub_semver/pub_semver.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/services/siren_flutter_service.dart'; /// Mock for the [SirenFlutterService] diff --git a/test/mock/viewmodels/login_viewmodel.dart b/test/mock/viewmodels/login_viewmodel.dart index 47513a0af..f61441693 100644 --- a/test/mock/viewmodels/login_viewmodel.dart +++ b/test/mock/viewmodels/login_viewmodel.dart @@ -1,7 +1,7 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:mockito/mockito.dart'; -// VIEWMODEL +// Project imports: import 'package:notredame/core/viewmodels/login_viewmodel.dart'; class LoginViewModelMock extends Mock implements LoginViewModel {} diff --git a/test/models/feedback_issue_test.dart b/test/models/feedback_issue_test.dart index 78a1278a5..2aa0a2afd 100644 --- a/test/models/feedback_issue_test.dart +++ b/test/models/feedback_issue_test.dart @@ -1,8 +1,8 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:github/github.dart'; +// Package imports: import 'package:flutter_test/flutter_test.dart'; +import 'package:github/github.dart'; -// MODELS +// Project imports: import 'package:notredame/core/models/feedback_issue.dart'; void main() { diff --git a/test/services/app_widget_service_test.dart b/test/services/app_widget_service_test.dart index 1e8118d0b..5e291b4a3 100644 --- a/test/services/app_widget_service_test.dart +++ b/test/services/app_widget_service_test.dart @@ -1,164 +1,158 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:flutter_test/flutter_test.dart'; -import 'package:home_widget/home_widget.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/widget_helper.dart'; - -// SERVICE -import 'package:notredame/core/services/app_widget_service.dart'; - -// MODEL -import 'package:notredame/core/models/widget_models.dart'; - -// OTHER -import '../helpers.dart'; -import '../mock/services/home_widget_mock.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - AppWidgetService service; - HomeWidgetMock homeWidgetMock; - - group("AppWidgetServiceTest - ", () { - setUp(() { - setupAnalyticsServiceMock(); - service = AppWidgetService(); - homeWidgetMock = HomeWidgetMock(); - }); - - test("init", () async { - homeWidgetMock.stubInit(); - expect(await service.init(), true); - }); - - group("Progress Widget", () { - const String title = "Widget title"; - const double progress = 0.5; - const int elapsedDays = 10; - const int totalDays = 20; - const String suffix = "d"; - - test("sendProgressData is successful", () async { - final ProgressWidgetData progressWidgetData = ProgressWidgetData( - title: title, - progress: progress, - elapsedDays: elapsedDays, - totalDays: totalDays, - suffix: suffix); - - // stub HomeWidget saveData behavior to match given input - final listIds = [ - '${ProgressWidgetData.keyPrefix}progress', - '${ProgressWidgetData.keyPrefix}elapsedDays', - '${ProgressWidgetData.keyPrefix}totalDays', - '${ProgressWidgetData.keyPrefix}suffix', - '${ProgressWidgetData.keyPrefix}title' - ]; - final listDatas = [progress, elapsedDays, totalDays, suffix, title]; - homeWidgetMock.stubSaveWidgetDataMock(listIds, listDatas); - - final test = await service.sendProgressData(progressWidgetData); - expect(test, true); - }); - - test("sendProgressData stopped on error", () async { - final ProgressWidgetData progressWidgetData = ProgressWidgetData( - title: title, - progress: progress, - elapsedDays: elapsedDays, - totalDays: totalDays, - suffix: suffix); - - // stub HomeWidget saveData behavior to match given input - final listIds = [ - '${ProgressWidgetData.keyPrefix}progress', - '${ProgressWidgetData.keyPrefix}elapsedDays', - '${ProgressWidgetData.keyPrefix}totalDays', - '${ProgressWidgetData.keyPrefix}suffix', - '${ProgressWidgetData.keyPrefix}title' - ]; - final listDatas = [ - progress, - elapsedDays, - totalDays, - suffix, - "Expected title (different from the one actually sent)" - ]; - homeWidgetMock.stubSaveWidgetDataMock(listIds, listDatas); - - expect(() async => service.sendProgressData(progressWidgetData), - throwsException, - reason: "Data is invalid for widget"); - }); - }); - - group("Grades Widget", () { - const List courseAcronyms = ["ABC123", "DEF456", "GHI789"]; - const List grades = ["A+", "B-", "N/A"]; - const String title = "Grades widget title"; - - test("sendGradesData is successful", () async { - final GradesWidgetData gradesWidgetData = GradesWidgetData( - title: title, courseAcronyms: courseAcronyms, grades: grades); - - // stub HomeWidget saveData behavior to match given input - final listIds = [ - '${GradesWidgetData.keyPrefix}courseAcronyms', - '${GradesWidgetData.keyPrefix}grades', - '${GradesWidgetData.keyPrefix}title' - ]; - final listDatas = [courseAcronyms, grades, title]; - homeWidgetMock.stubSaveWidgetDataMock(listIds, listDatas); - - final test = await service.sendGradesData(gradesWidgetData); - expect(test, true); - }); - - test("sendGradesData stopped on error", () async { - final GradesWidgetData gradesWidgetData = GradesWidgetData( - title: title, courseAcronyms: courseAcronyms, grades: grades); - - // stub HomeWidget saveData behavior to match given input - final listIds = [ - '${GradesWidgetData.keyPrefix}courseAcronyms', - '${GradesWidgetData.keyPrefix}grades', - '${GradesWidgetData.keyPrefix}title' - ]; - final listDatas = [courseAcronyms, grades, "Not the given title"]; - homeWidgetMock.stubSaveWidgetDataMock(listIds, listDatas); - - expect(() async => service.sendGradesData(gradesWidgetData), - throwsException, - reason: "Data is invalid for widget"); - }); - }); - - group("updateWidget", () { - test("progress", () async { - const WidgetType type = WidgetType.progress; - homeWidgetMock.stubUpdateWidgetMock( - type.androidName, type.androidName, type.iOSname); - expect( - await HomeWidget.updateWidget( - name: type.androidName, - androidName: type.androidName, - iOSName: type.iOSname), - true); - }); - - test("grades", () async { - const WidgetType type = WidgetType.grades; - homeWidgetMock.stubUpdateWidgetMock( - type.androidName, type.androidName, type.iOSname); - expect( - await HomeWidget.updateWidget( - name: type.androidName, - androidName: type.androidName, - iOSName: type.iOSname), - true); - }); - }); - }); -} +// Package imports: +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 '../helpers.dart'; +import '../mock/services/home_widget_mock.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + AppWidgetService service; + HomeWidgetMock homeWidgetMock; + + group("AppWidgetServiceTest - ", () { + setUp(() { + setupAnalyticsServiceMock(); + service = AppWidgetService(); + homeWidgetMock = HomeWidgetMock(); + }); + + test("init", () async { + homeWidgetMock.stubInit(); + expect(await service.init(), true); + }); + + group("Progress Widget", () { + const String title = "Widget title"; + const double progress = 0.5; + const int elapsedDays = 10; + const int totalDays = 20; + const String suffix = "d"; + + test("sendProgressData is successful", () async { + final ProgressWidgetData progressWidgetData = ProgressWidgetData( + title: title, + progress: progress, + elapsedDays: elapsedDays, + totalDays: totalDays, + suffix: suffix); + + // stub HomeWidget saveData behavior to match given input + final listIds = [ + '${ProgressWidgetData.keyPrefix}progress', + '${ProgressWidgetData.keyPrefix}elapsedDays', + '${ProgressWidgetData.keyPrefix}totalDays', + '${ProgressWidgetData.keyPrefix}suffix', + '${ProgressWidgetData.keyPrefix}title' + ]; + final listDatas = [progress, elapsedDays, totalDays, suffix, title]; + homeWidgetMock.stubSaveWidgetDataMock(listIds, listDatas); + + final test = await service.sendProgressData(progressWidgetData); + expect(test, true); + }); + + test("sendProgressData stopped on error", () async { + final ProgressWidgetData progressWidgetData = ProgressWidgetData( + title: title, + progress: progress, + elapsedDays: elapsedDays, + totalDays: totalDays, + suffix: suffix); + + // stub HomeWidget saveData behavior to match given input + final listIds = [ + '${ProgressWidgetData.keyPrefix}progress', + '${ProgressWidgetData.keyPrefix}elapsedDays', + '${ProgressWidgetData.keyPrefix}totalDays', + '${ProgressWidgetData.keyPrefix}suffix', + '${ProgressWidgetData.keyPrefix}title' + ]; + final listDatas = [ + progress, + elapsedDays, + totalDays, + suffix, + "Expected title (different from the one actually sent)" + ]; + homeWidgetMock.stubSaveWidgetDataMock(listIds, listDatas); + + expect(() async => service.sendProgressData(progressWidgetData), + throwsException, + reason: "Data is invalid for widget"); + }); + }); + + group("Grades Widget", () { + const List courseAcronyms = ["ABC123", "DEF456", "GHI789"]; + const List grades = ["A+", "B-", "N/A"]; + const String title = "Grades widget title"; + + test("sendGradesData is successful", () async { + final GradesWidgetData gradesWidgetData = GradesWidgetData( + title: title, courseAcronyms: courseAcronyms, grades: grades); + + // stub HomeWidget saveData behavior to match given input + final listIds = [ + '${GradesWidgetData.keyPrefix}courseAcronyms', + '${GradesWidgetData.keyPrefix}grades', + '${GradesWidgetData.keyPrefix}title' + ]; + final listDatas = [courseAcronyms, grades, title]; + homeWidgetMock.stubSaveWidgetDataMock(listIds, listDatas); + + final test = await service.sendGradesData(gradesWidgetData); + expect(test, true); + }); + + test("sendGradesData stopped on error", () async { + final GradesWidgetData gradesWidgetData = GradesWidgetData( + title: title, courseAcronyms: courseAcronyms, grades: grades); + + // stub HomeWidget saveData behavior to match given input + final listIds = [ + '${GradesWidgetData.keyPrefix}courseAcronyms', + '${GradesWidgetData.keyPrefix}grades', + '${GradesWidgetData.keyPrefix}title' + ]; + final listDatas = [courseAcronyms, grades, "Not the given title"]; + homeWidgetMock.stubSaveWidgetDataMock(listIds, listDatas); + + expect(() async => service.sendGradesData(gradesWidgetData), + throwsException, + reason: "Data is invalid for widget"); + }); + }); + + group("updateWidget", () { + test("progress", () async { + const WidgetType type = WidgetType.progress; + homeWidgetMock.stubUpdateWidgetMock( + type.androidName, type.androidName, type.iOSname); + expect( + await HomeWidget.updateWidget( + name: type.androidName, + androidName: type.androidName, + iOSName: type.iOSname), + true); + }); + + test("grades", () async { + const WidgetType type = WidgetType.grades; + homeWidgetMock.stubUpdateWidgetMock( + type.androidName, type.androidName, type.iOSname); + expect( + await HomeWidget.updateWidget( + name: type.androidName, + androidName: type.androidName, + iOSName: type.iOSname), + true); + }); + }); + }); +} diff --git a/test/services/preferences_service_test.dart b/test/services/preferences_service_test.dart index ee0a409d7..b103d5100 100644 --- a/test/services/preferences_service_test.dart +++ b/test/services/preferences_service_test.dart @@ -1,10 +1,10 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:flutter_test/flutter_test.dart'; -import 'package:notredame/core/services/preferences_service.dart'; import 'package:shared_preferences/shared_preferences.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/preferences_flags.dart'; +import 'package:notredame/core/services/preferences_service.dart'; void main() { SharedPreferences sharedPreferences; diff --git a/test/ui/views/about_view_test.dart b/test/ui/views/about_view_test.dart index 072f4b910..2de8c019a 100644 --- a/test/ui/views/about_view_test.dart +++ b/test/ui/views/about_view_test.dart @@ -1,11 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; -// VIEW +// Project imports: import 'package:notredame/ui/views/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 7c8158041..23b9b0f14 100644 --- a/test/ui/views/choose_language_view_test.dart +++ b/test/ui/views/choose_language_view_test.dart @@ -1,16 +1,17 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; -// MANAGERS / SERVICES -import 'package:notredame/core/services/navigation_service.dart'; +// Project imports: import 'package:notredame/core/managers/settings_manager.dart'; - -// VIEW +import 'package:notredame/core/services/navigation_service.dart'; import 'package:notredame/ui/views/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 66af76823..775d70128 100644 --- a/test/ui/views/dashboard_view_test.dart +++ b/test/ui/views/dashboard_view_test.dart @@ -1,32 +1,24 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; -import 'package:feature_discovery/feature_discovery.dart'; + +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; + +// Package imports: +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:flutter_test/flutter_test.dart'; -// MANAGERS +// 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'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// VIEW +import 'package:notredame/core/services/remote_config_service.dart'; import 'package:notredame/ui/views/dashboard_view.dart'; import 'package:notredame/ui/widgets/course_activity_tile.dart'; import 'package:notredame/ui/widgets/grade_button.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; - -// SERVICES -import 'package:notredame/core/services/remote_config_service.dart'; - -// OTHERS import '../../helpers.dart'; - -// MOCKS import '../../mock/managers/course_repository_mock.dart'; import '../../mock/managers/settings_manager_mock.dart'; import '../../mock/services/in_app_review_service_mock.dart'; diff --git a/test/ui/views/emergency_view_test.dart b/test/ui/views/emergency_view_test.dart index 7bdefc928..e99588c88 100644 --- a/test/ui/views/emergency_view_test.dart +++ b/test/ui/views/emergency_view_test.dart @@ -1,9 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; -import 'package:notredame/ui/views/emergency_view.dart'; import 'package:webview_flutter/webview_flutter.dart'; +// Project imports: +import 'package:notredame/ui/views/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 057f61b6d..795eead34 100644 --- a/test/ui/views/faq_view_test.dart +++ b/test/ui/views/faq_view_test.dart @@ -1,20 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; -// MANAGERS +// Project imports: +import 'package:notredame/core/constants/faq.dart'; import 'package:notredame/core/managers/settings_manager.dart'; -import '../../mock/managers/settings_manager_mock.dart'; - -// VIEW import 'package:notredame/ui/views/faq_view.dart'; - -// HELPERS import '../../helpers.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/faq.dart'; +import '../../mock/managers/settings_manager_mock.dart'; void main() { group('FaqView - ', () { diff --git a/test/ui/views/feedback_view_test.dart b/test/ui/views/feedback_view_test.dart index 33aefce31..c9e0912c0 100644 --- a/test/ui/views/feedback_view_test.dart +++ b/test/ui/views/feedback_view_test.dart @@ -1,12 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; -// VIEW +// Project imports: import 'package:notredame/ui/views/feedback_view.dart'; - -// HELPERS 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 4d3458cd4..56a614bea 100644 --- a/test/ui/views/grades_details_view_test.dart +++ b/test/ui/views/grades_details_view_test.dart @@ -1,23 +1,19 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; -import 'package:feature_discovery/feature_discovery.dart'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:ets_api_clients/models.dart'; +import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_test/flutter_test.dart'; -// MANAGERS +// Project imports: import 'package:notredame/core/managers/course_repository.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// SERVICES import 'package:notredame/core/services/networking_service.dart'; - -// VIEWS import 'package:notredame/ui/views/grade_details_view.dart'; - -// OTHERS 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 2a9235120..a1abdf0bd 100644 --- a/test/ui/views/grades_view_test.dart +++ b/test/ui/views/grades_view_test.dart @@ -1,27 +1,23 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; -import 'package:feature_discovery/feature_discovery.dart'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +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:flutter_test/flutter_test.dart'; -// MANAGER +// Project imports: import 'package:notredame/core/managers/course_repository.dart'; import 'package:notredame/core/managers/settings_manager.dart'; -import '../../mock/managers/course_repository_mock.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// SERVICES import 'package:notredame/core/services/networking_service.dart'; - -// VIEW / WIDGETS import 'package:notredame/ui/views/grades_view.dart'; import 'package:notredame/ui/widgets/grade_button.dart'; - -// OTHERS import '../../helpers.dart'; +import '../../mock/managers/course_repository_mock.dart'; void main() { CourseRepository courseRepository; diff --git a/test/ui/views/login_view_test.dart b/test/ui/views/login_view_test.dart index a55332483..f9279280e 100644 --- a/test/ui/views/login_view_test.dart +++ b/test/ui/views/login_view_test.dart @@ -1,26 +1,22 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; -// MANAGERS / SERVICES +// 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/managers/settings_manager.dart'; import 'package:notredame/core/services/preferences_service.dart'; - -// MOCKS -import '../../mock/services/analytics_service_mock.dart'; -import '../../mock/services/launch_url_service_mock.dart'; - -// VIEWS import 'package:notredame/ui/views/login_view.dart'; import 'package:notredame/ui/widgets/password_text_field.dart'; - -// HELPERS import '../../helpers.dart'; +import '../../mock/services/analytics_service_mock.dart'; +import '../../mock/services/launch_url_service_mock.dart'; void main() { AppIntl intl; diff --git a/test/ui/views/more_view_test.dart b/test/ui/views/more_view_test.dart index d7cc7387f..4cf82cbc7 100644 --- a/test/ui/views/more_view_test.dart +++ b/test/ui/views/more_view_test.dart @@ -1,22 +1,20 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:feature_discovery/feature_discovery.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:feature_discovery/feature_discovery.dart'; -import 'package:notredame/core/constants/preferences_flags.dart'; -// CONSTANTS +// Project imports: +import 'package:notredame/core/constants/preferences_flags.dart'; import 'package:notredame/core/constants/router_paths.dart'; - -// SERVICES import 'package:notredame/core/services/navigation_service.dart'; - -// VIEW import 'package:notredame/ui/views/more_view.dart'; - -// HELPERS 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 9d9f415a4..49236e082 100644 --- a/test/ui/views/not_found_view_test.dart +++ b/test/ui/views/not_found_view_test.dart @@ -1,12 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; -// VIEW +// Project imports: import 'package:notredame/ui/views/not_found_view.dart'; - -// OTHER import '../../helpers.dart'; void main() { diff --git a/test/ui/views/profile_view_test.dart b/test/ui/views/profile_view_test.dart index a8022a9a7..25b060c87 100644 --- a/test/ui/views/profile_view_test.dart +++ b/test/ui/views/profile_view_test.dart @@ -1,26 +1,21 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// MODELS +// Package imports: import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; -// MANAGERS +// Project imports: import 'package:notredame/core/managers/user_repository.dart'; - -// SERVICES import 'package:notredame/core/services/networking_service.dart'; -import '../../mock/services/analytics_service_mock.dart'; - -// VIEW import 'package:notredame/ui/views/profile_view.dart'; - import '../../helpers.dart'; - -// MOCKS import '../../mock/managers/user_repository_mock.dart'; +import '../../mock/services/analytics_service_mock.dart'; void main() { AppIntl intl; diff --git a/test/ui/views/quick_links_view_test.dart b/test/ui/views/quick_links_view_test.dart index 4e0c7e0c3..9e6a08fb5 100644 --- a/test/ui/views/quick_links_view_test.dart +++ b/test/ui/views/quick_links_view_test.dart @@ -1,30 +1,22 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; -import 'package:feature_discovery/feature_discovery.dart'; + +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; + +// Package imports: +import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/quick_links.dart'; - -// SERVICES -import 'package:notredame/core/services/networking_service.dart'; -import 'package:notredame/core/services/launch_url_service.dart'; - -// MANAGERS import 'package:notredame/core/managers/quick_link_repository.dart'; - -// VIEW +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'; - -// WIDGETS import 'package:notredame/ui/widgets/web_link_card.dart'; - -// UTILS import '../../helpers.dart'; - -// MOCKS import '../../mock/managers/quick_links_repository_mock.dart'; import '../../mock/services/analytics_service_mock.dart'; import '../../mock/services/internal_info_service_mock.dart'; diff --git a/test/ui/views/schedule_view_test.dart b/test/ui/views/schedule_view_test.dart index 0c2125d81..9805ce502 100644 --- a/test/ui/views/schedule_view_test.dart +++ b/test/ui/views/schedule_view_test.dart @@ -1,30 +1,24 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:ets_api_clients/models.dart'; +import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart'; import 'package:table_calendar/table_calendar.dart'; -import 'package:feature_discovery/feature_discovery.dart'; -// MANAGERS +// 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'; - -// MODELS / CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:ets_api_clients/models.dart'; - -// VIEW / WIDGETS +import 'package:notredame/core/services/remote_config_service.dart'; import 'package:notredame/ui/views/schedule_view.dart'; import 'package:notredame/ui/widgets/schedule_settings.dart'; - -// HELPERS import '../../helpers.dart'; - -// SERVICES -import 'package:notredame/core/services/remote_config_service.dart'; - -// MOCKS import '../../mock/managers/course_repository_mock.dart'; import '../../mock/managers/settings_manager_mock.dart'; import '../../mock/services/remote_config_service_mock.dart'; diff --git a/test/ui/views/security_view_test.dart b/test/ui/views/security_view_test.dart index ed96672bb..2afa64f61 100644 --- a/test/ui/views/security_view_test.dart +++ b/test/ui/views/security_view_test.dart @@ -1,15 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/emergency_procedures.dart'; - -// VIEW import 'package:notredame/ui/views/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 b98db0f06..f90bc9647 100644 --- a/test/ui/views/settings_view_test.dart +++ b/test/ui/views/settings_view_test.dart @@ -1,19 +1,19 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + +// Package imports: import 'package:feature_discovery/feature_discovery.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; -// SERVICES +// Project imports: import 'package:notredame/core/services/networking_service.dart'; -import '../../mock/services/analytics_service_mock.dart'; - -// VIEW import 'package:notredame/ui/views/settings_view.dart'; - -// HELPERS import '../../helpers.dart'; +import '../../mock/services/analytics_service_mock.dart'; void main() { AppIntl intl; diff --git a/test/ui/views/student_view_test.dart b/test/ui/views/student_view_test.dart index add98bde6..1cc8c7421 100644 --- a/test/ui/views/student_view_test.dart +++ b/test/ui/views/student_view_test.dart @@ -1,28 +1,22 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; -import 'package:feature_discovery/feature_discovery.dart'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_test/flutter_test.dart'; -// MANAGER +// Project imports: import 'package:notredame/core/managers/course_repository.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// SERVICES import 'package:notredame/core/services/networking_service.dart'; -import '../../mock/services/analytics_service_mock.dart'; - -// VIEWS import 'package:notredame/ui/views/student_view.dart'; - -//WIDGETS import 'package:notredame/ui/widgets/base_scaffold.dart'; - -// HELPER import '../../helpers.dart'; - -// MOCKS import '../../mock/managers/course_repository_mock.dart'; +import '../../mock/services/analytics_service_mock.dart'; void main() { CourseRepository courseRepository; diff --git a/test/ui/widgets/base_scaffold_test.dart b/test/ui/widgets/base_scaffold_test.dart index 96c2010d3..f2a02b669 100644 --- a/test/ui/widgets/base_scaffold_test.dart +++ b/test/ui/widgets/base_scaffold_test.dart @@ -1,19 +1,17 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; + +// Package imports: import 'package:feature_discovery/feature_discovery.dart'; +import 'package:flutter_test/flutter_test.dart'; -// SERVICE +// Project imports: import 'package:notredame/core/services/navigation_service.dart'; import 'package:notredame/core/services/networking_service.dart'; -import '../../mock/services/analytics_service_mock.dart'; - -// WIDGET import 'package:notredame/ui/widgets/base_scaffold.dart'; import 'package:notredame/ui/widgets/bottom_bar.dart'; - -// HELPERS import '../../helpers.dart'; +import '../../mock/services/analytics_service_mock.dart'; void main() { group('BaseScaffold - ', () { diff --git a/test/ui/widgets/bottom_bar_test.dart b/test/ui/widgets/bottom_bar_test.dart index d39f5fdb8..b3aa81f7d 100644 --- a/test/ui/widgets/bottom_bar_test.dart +++ b/test/ui/widgets/bottom_bar_test.dart @@ -1,22 +1,18 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:feature_discovery/feature_discovery.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:feature_discovery/feature_discovery.dart'; -// SERVICE +// 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 '../../mock/services/analytics_service_mock.dart'; - -// WIDGET import 'package:notredame/ui/widgets/bottom_bar.dart'; - -// OTHERS -import 'package:notredame/core/constants/router_paths.dart'; - -// HELPERS import '../../helpers.dart'; +import '../../mock/services/analytics_service_mock.dart'; NavigationService navigationService; diff --git a/test/ui/widgets/course_activity_tile_test.dart b/test/ui/widgets/course_activity_tile_test.dart index 6bf476406..452d592da 100644 --- a/test/ui/widgets/course_activity_tile_test.dart +++ b/test/ui/widgets/course_activity_tile_test.dart @@ -1,14 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -// MODEL +// Package imports: import 'package:ets_api_clients/models.dart'; +import 'package:flutter_test/flutter_test.dart'; -// WIDGET +// Project imports: import 'package:notredame/ui/widgets/course_activity_tile.dart'; - -// HELPERS 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 cae723c39..a4a8100de 100644 --- a/test/ui/widgets/dismissible_card_test.dart +++ b/test/ui/widgets/dismissible_card_test.dart @@ -1,7 +1,11 @@ +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; -import 'package:notredame/ui/widgets/dismissible_card.dart'; +// Project imports: +import 'package:notredame/ui/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 76aa52998..8ba846668 100644 --- a/test/ui/widgets/grade_button_test.dart +++ b/test/ui/widgets/grade_button_test.dart @@ -1,26 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:flutter_test/flutter_test.dart'; +// Package imports: +import 'package:ets_api_clients/models.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/preferences_flags.dart'; - -// MANAGERS +import 'package:notredame/core/constants/router_paths.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; -// SERVICE import 'package:notredame/core/services/navigation_service.dart'; - -// OTHERS -import 'package:notredame/core/constants/router_paths.dart'; - -// WIDGET import 'package:notredame/ui/widgets/grade_button.dart'; - -// HELPERS import '../../helpers.dart'; import '../../mock/managers/settings_manager_mock.dart'; diff --git a/test/ui/widgets/grade_circular_progress_test.dart b/test/ui/widgets/grade_circular_progress_test.dart index 2a54ecc23..2e5f4ff49 100644 --- a/test/ui/widgets/grade_circular_progress_test.dart +++ b/test/ui/widgets/grade_circular_progress_test.dart @@ -1,12 +1,10 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:flutter_test/flutter_test.dart'; +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:percent_indicator/percent_indicator.dart'; -// WIDGETS +// Project imports: import 'package:notredame/ui/widgets/grade_circular_progress.dart'; - -// HELPERS 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 4c79bbafb..400237fbb 100644 --- a/test/ui/widgets/grade_evaluation_tile_test.dart +++ b/test/ui/widgets/grade_evaluation_tile_test.dart @@ -1,17 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:feature_discovery/feature_discovery.dart'; +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - -// WIDGETS -import 'package:notredame/ui/widgets/grade_evaluation_tile.dart'; -import 'package:notredame/ui/widgets/grade_circular_progress.dart'; -// MODELS +// Package imports: 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:flutter_test/flutter_test.dart'; -// HELPERS +// Project imports: +import 'package:notredame/ui/widgets/grade_circular_progress.dart'; +import 'package:notredame/ui/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 d7baa2570..d24ed5e38 100644 --- a/test/ui/widgets/grade_not_available_test.dart +++ b/test/ui/widgets/grade_not_available_test.dart @@ -1,12 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; -// MODELS +// Project imports: import 'package:notredame/ui/widgets/grade_not_available.dart'; - -// HELPERS 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 93ce97810..3aba1903a 100644 --- a/test/ui/widgets/link_web_view_test.dart +++ b/test/ui/widgets/link_web_view_test.dart @@ -1,15 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; import 'package:webview_flutter/webview_flutter.dart'; -// MODELS +// Project imports: import 'package:notredame/core/models/quick_link.dart'; - -// WIDGETS import 'package:notredame/ui/widgets/link_web_view.dart'; - -// OTHER 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 fb8fca6b9..1378b228f 100644 --- a/test/ui/widgets/password_text_field_test.dart +++ b/test/ui/widgets/password_text_field_test.dart @@ -1,12 +1,12 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; + +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; -// WIDGET +// Project imports: import 'package:notredame/ui/widgets/password_text_field.dart'; - -// HELPERS import '../../helpers.dart'; void main() { diff --git a/test/ui/widgets/schedule_settings_test.dart b/test/ui/widgets/schedule_settings_test.dart index 3b8489107..937294fa3 100644 --- a/test/ui/widgets/schedule_settings_test.dart +++ b/test/ui/widgets/schedule_settings_test.dart @@ -1,27 +1,22 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; + +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart'; import 'package:mockito/mockito.dart'; import 'package:table_calendar/table_calendar.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - -// MANAGERS -import 'package:notredame/core/managers/settings_manager.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/preferences_flags.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// WIDGET +import 'package:notredame/core/managers/settings_manager.dart'; import 'package:notredame/ui/widgets/schedule_settings.dart'; - import '../../helpers.dart'; - -// MOCK import '../../mock/managers/course_repository_mock.dart'; import '../../mock/managers/settings_manager_mock.dart'; import '../../mock/services/remote_config_service_mock.dart'; diff --git a/test/ui/widgets/student_program_test.dart b/test/ui/widgets/student_program_test.dart index 1a77f8767..9e158962e 100644 --- a/test/ui/widgets/student_program_test.dart +++ b/test/ui/widgets/student_program_test.dart @@ -1,14 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// MODEL +// Package imports: import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; -// VIEW +// Project imports: import 'package:notredame/ui/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 aaba00a20..fe7113a01 100644 --- a/test/ui/widgets/web_link_card_test.dart +++ b/test/ui/widgets/web_link_card_test.dart @@ -1,19 +1,17 @@ +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// MODELS +// Project imports: import 'package:notredame/core/models/quick_link.dart'; - -// SERVICES -import 'package:notredame/core/services/navigation_service.dart'; import 'package:notredame/core/services/analytics_service.dart'; import 'package:notredame/core/services/internal_info_service.dart'; import 'package:notredame/core/services/launch_url_service.dart'; - -// WIDGETS +import 'package:notredame/core/services/navigation_service.dart'; import 'package:notredame/ui/widgets/web_link_card.dart'; - import '../../helpers.dart'; final _quickLink = QuickLink( diff --git a/test/viewmodels/choose_language_viewmodel_test.dart b/test/viewmodels/choose_language_viewmodel_test.dart index 4bbfa5d77..8873d58a3 100644 --- a/test/viewmodels/choose_language_viewmodel_test.dart +++ b/test/viewmodels/choose_language_viewmodel_test.dart @@ -1,22 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// ROUTES +// Project imports: +import 'package:notredame/core/constants/preferences_flags.dart'; import 'package:notredame/core/constants/router_paths.dart'; - -// MANAGER import 'package:notredame/core/managers/settings_manager.dart'; import 'package:notredame/core/services/navigation_service.dart'; - -// VIEWMODEL import 'package:notredame/core/viewmodels/choose_language_viewmodel.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; - -// OTHERS import '../helpers.dart'; import '../mock/managers/settings_manager_mock.dart'; diff --git a/test/viewmodels/dashboard_viewmodel_test.dart b/test/viewmodels/dashboard_viewmodel_test.dart index e8cf55e2e..2154d8c57 100644 --- a/test/viewmodels/dashboard_viewmodel_test.dart +++ b/test/viewmodels/dashboard_viewmodel_test.dart @@ -1,30 +1,18 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:ets_api_clients/models.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/preferences_flags.dart'; import 'package:notredame/core/constants/progress_bar_text_options.dart'; - -// MANAGERS import 'package:notredame/core/managers/course_repository.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// MODEL -import 'package:ets_api_clients/models.dart'; - -// SERVICE -import 'package:notredame/core/services/preferences_service.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'; - -// VIEWMODEL import 'package:notredame/core/viewmodels/dashboard_viewmodel.dart'; - -// OTHER import '../helpers.dart'; - -// MOCKS import '../mock/managers/course_repository_mock.dart'; import '../mock/managers/settings_manager_mock.dart'; import '../mock/services/in_app_review_service_mock.dart'; diff --git a/test/viewmodels/faq_viewmodel_test.dart b/test/viewmodels/faq_viewmodel_test.dart index 52519f29a..219fd8df5 100644 --- a/test/viewmodels/faq_viewmodel_test.dart +++ b/test/viewmodels/faq_viewmodel_test.dart @@ -1,18 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// SERVICES / MANAGERS -import 'package:notredame/core/services/launch_url_service.dart'; +// Project imports: import 'package:notredame/core/managers/settings_manager.dart'; -import '../mock/services/launch_url_service_mock.dart'; - -// VIEW MODEL +import 'package:notredame/core/services/launch_url_service.dart'; import 'package:notredame/core/viewmodels/faq_viewmodel.dart'; - -// OTHER import '../helpers.dart'; +import '../mock/services/launch_url_service_mock.dart'; void main() { LaunchUrlServiceMock launchUrlService; diff --git a/test/viewmodels/feedback_viewmodel_test.dart b/test/viewmodels/feedback_viewmodel_test.dart index 77e06a0a4..744d9c732 100644 --- a/test/viewmodels/feedback_viewmodel_test.dart +++ b/test/viewmodels/feedback_viewmodel_test.dart @@ -1,26 +1,24 @@ -// FLUTTER / DART / THIRD-PARTIES +// Dart imports: import 'dart:io'; -import 'package:feedback/feedback.dart'; + +// Flutter imports: import 'package:flutter/services.dart'; + +// Package imports: +import 'package:feedback/feedback.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:github/github.dart'; import 'package:image/image.dart' as image; -import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// SERVICES / MANAGERS +// 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'; - -// VIEW MODEL import 'package:notredame/core/viewmodels/feedback_viewmodel.dart'; -import 'package:notredame/core/models/feedback_issue.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; -import 'package:notredame/core/constants/feedback_type.dart'; - -// OTHER 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 89d7277e3..d90ec987f 100644 --- a/test/viewmodels/grades_details_viewmodel_test.dart +++ b/test/viewmodels/grades_details_viewmodel_test.dart @@ -1,22 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:flutter_test/flutter_test.dart'; +// Package imports: +import 'package:ets_api_clients/models.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// MODELS -import 'package:ets_api_clients/models.dart'; - -// VIEWMODEL -import 'package:notredame/core/viewmodels/grades_details_viewmodel.dart'; - -// MANAGER -import 'package:notredame/core/managers/settings_manager.dart'; +// Project imports: import 'package:notredame/core/managers/course_repository.dart'; -import '../mock/managers/course_repository_mock.dart'; - -// HELPERS -// ignore: directives_ordering +import 'package:notredame/core/managers/settings_manager.dart'; +import 'package:notredame/core/viewmodels/grades_details_viewmodel.dart'; import '../helpers.dart'; +import '../mock/managers/course_repository_mock.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); diff --git a/test/viewmodels/grades_viewmodel_test.dart b/test/viewmodels/grades_viewmodel_test.dart index 9d4f3ad87..d1e5df79f 100644 --- a/test/viewmodels/grades_viewmodel_test.dart +++ b/test/viewmodels/grades_viewmodel_test.dart @@ -1,23 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:flutter_test/flutter_test.dart'; +// Package imports: +import 'package:ets_api_clients/models.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// MANAGER +// Project imports: import 'package:notredame/core/managers/course_repository.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// SERVICES import 'package:notredame/core/services/navigation_service.dart'; - -// MODEL -import 'package:ets_api_clients/models.dart'; import 'package:notredame/core/viewmodels/grades_viewmodel.dart'; - -// OTHER import '../helpers.dart'; - -// MOCKS import '../mock/managers/course_repository_mock.dart'; void main() { diff --git a/test/viewmodels/login_viewmodel_test.dart b/test/viewmodels/login_viewmodel_test.dart index 04a9b619d..e78fba763 100644 --- a/test/viewmodels/login_viewmodel_test.dart +++ b/test/viewmodels/login_viewmodel_test.dart @@ -1,19 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:flutter_test/flutter_test.dart'; +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// SERVICES / MANAGERS +// 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'; - -// VIEW MODEL import 'package:notredame/core/viewmodels/login_viewmodel.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/router_paths.dart'; - -// OTHER import '../helpers.dart'; import '../mock/managers/user_repository_mock.dart'; diff --git a/test/viewmodels/more_viewmodel_test.dart b/test/viewmodels/more_viewmodel_test.dart index c27a466cb..eb391d1cd 100644 --- a/test/viewmodels/more_viewmodel_test.dart +++ b/test/viewmodels/more_viewmodel_test.dart @@ -1,26 +1,18 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:ets_api_clients/models.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// SERVICES / MANAGERS -import 'package:notredame/core/managers/user_repository.dart'; -import 'package:notredame/core/services/navigation_service.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/managers/course_repository.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// VIEW MODEL import 'package:notredame/core/viewmodels/more_viewmodel.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/router_paths.dart'; - -// OTHER 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 f053a93ce..f70b73d14 100644 --- a/test/viewmodels/not_found_viewmodel_test.dart +++ b/test/viewmodels/not_found_viewmodel_test.dart @@ -1,18 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:notredame/core/services/analytics_service.dart'; import 'package:rive/rive.dart'; -// SERVICES / MANAGERS +// 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'; - -// VIEW MODEL import 'package:notredame/core/viewmodels/not_found_viewmodel.dart'; - -// OTHER -import 'package:notredame/core/constants/router_paths.dart'; import '../helpers.dart'; import '../mock/services/rive_animation_service_mock.dart'; diff --git a/test/viewmodels/profile_viewmodel_test.dart b/test/viewmodels/profile_viewmodel_test.dart index 0d5e4a06e..7dd5faaf0 100644 --- a/test/viewmodels/profile_viewmodel_test.dart +++ b/test/viewmodels/profile_viewmodel_test.dart @@ -1,21 +1,14 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:ets_api_clients/models.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:notredame/core/constants/programs_credits.dart'; -// MANAGERS +// Project imports: +import 'package:notredame/core/constants/programs_credits.dart'; import 'package:notredame/core/managers/settings_manager.dart'; import 'package:notredame/core/managers/user_repository.dart'; - -// VIEW-MODEL import 'package:notredame/core/viewmodels/profile_viewmodel.dart'; - -// MODEL -import 'package:ets_api_clients/models.dart'; - import '../helpers.dart'; - -// MOCKS import '../mock/managers/user_repository_mock.dart'; UserRepository userRepository; diff --git a/test/viewmodels/quick_links_viewmodel_test.dart b/test/viewmodels/quick_links_viewmodel_test.dart index 0f075cd17..21ac94f1a 100644 --- a/test/viewmodels/quick_links_viewmodel_test.dart +++ b/test/viewmodels/quick_links_viewmodel_test.dart @@ -1,19 +1,13 @@ -// FLUTTER / DART / THIRD-PARTIES -import 'package:flutter_test/flutter_test.dart'; +// Package imports: import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:notredame/core/constants/quick_links.dart'; +import 'package:flutter_test/flutter_test.dart'; -// MODELS +// 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'; - -// VIEWMODEL import 'package:notredame/core/viewmodels/quick_links_viewmodel.dart'; - -// MANAGER -import 'package:notredame/core/managers/quick_link_repository.dart'; - -// OTHERS import '../helpers.dart'; import '../mock/managers/quick_links_repository_mock.dart'; diff --git a/test/viewmodels/schedule_settings_viewmodel_test.dart b/test/viewmodels/schedule_settings_viewmodel_test.dart index 06c406bc9..f2ef1332d 100644 --- a/test/viewmodels/schedule_settings_viewmodel_test.dart +++ b/test/viewmodels/schedule_settings_viewmodel_test.dart @@ -1,23 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:ets_api_clients/models.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart'; import 'package:mockito/mockito.dart'; import 'package:table_calendar/table_calendar.dart'; -// MANAGER -import 'package:notredame/core/managers/settings_manager.dart'; +// Project imports: +import 'package:notredame/core/constants/preferences_flags.dart'; import 'package:notredame/core/managers/course_repository.dart'; - -// VIEWMODEL +import 'package:notredame/core/managers/settings_manager.dart'; import 'package:notredame/core/viewmodels/schedule_settings_viewmodel.dart'; - -// MODELS -import 'package:ets_api_clients/models.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; - -// OTHER 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 f98ad211c..5e599bf82 100644 --- a/test/viewmodels/schedule_viewmodel_test.dart +++ b/test/viewmodels/schedule_viewmodel_test.dart @@ -1,26 +1,16 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: +import 'package:ets_api_clients/models.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart'; import 'package:mockito/mockito.dart'; import 'package:table_calendar/table_calendar.dart'; -// MANAGERS +// 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'; - -// VIEW-MODEL import 'package:notredame/core/viewmodels/schedule_viewmodel.dart'; - -// MODEL -import 'package:ets_api_clients/models.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; - -// OTHERS import '../helpers.dart'; - -// MOCKS 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 667ee4919..6e9f696fb 100644 --- a/test/viewmodels/settings_viewmodel_test.dart +++ b/test/viewmodels/settings_viewmodel_test.dart @@ -1,19 +1,15 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -// MANAGER +// Project imports: +import 'package:notredame/core/constants/preferences_flags.dart'; import 'package:notredame/core/managers/settings_manager.dart'; - -// VIEWMODEL import 'package:notredame/core/viewmodels/settings_viewmodel.dart'; - -// CONSTANTS -import 'package:notredame/core/constants/preferences_flags.dart'; - -// OTHERS 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 6ac1a4e9c..c2fc6b5f3 100644 --- a/test/viewmodels/startup_viewmodel_test.dart +++ b/test/viewmodels/startup_viewmodel_test.dart @@ -1,24 +1,18 @@ -// FLUTTER / DART / THIRD-PARTIES +// Package imports: import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:pub_semver/pub_semver.dart'; -// CONSTANTS +// 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'; - -// SERVICES / MANAGERS +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/managers/settings_manager.dart'; import 'package:notredame/core/services/preferences_service.dart'; import 'package:notredame/core/services/siren_flutter_service.dart'; - -// VIEW MODEL import 'package:notredame/core/viewmodels/startup_viewmodel.dart'; - -// OTHER 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 e600d9474..cdd207b5c 100644 --- a/test/viewmodels/web_link_card_viewmodel_test.dart +++ b/test/viewmodels/web_link_card_viewmodel_test.dart @@ -1,27 +1,19 @@ -// FLUTTER / DART / THIRD-PARTIES +// Flutter imports: import 'package:flutter/material.dart'; + +// Package imports: import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -// CONSTANTS +// Project imports: import 'package:notredame/core/constants/router_paths.dart'; - -// MANAGERS import 'package:notredame/core/managers/settings_manager.dart'; - -// MODELS import 'package:notredame/core/models/quick_link.dart'; - -// SERVICES import 'package:notredame/core/services/analytics_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'; - -// VIEWMODELS import 'package:notredame/core/viewmodels/web_link_card_viewmodel.dart'; - -// OTHER import '../helpers.dart'; import '../mock/services/internal_info_service_mock.dart';