diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ba42cc57..f5eea6c6 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -17,6 +17,9 @@ PODS: - Firebase/RemoteConfig (10.25.0): - Firebase/CoreOnly - FirebaseRemoteConfig (~> 10.25.0) + - Firebase/Storage (10.25.0): + - Firebase/CoreOnly + - FirebaseStorage (~> 10.25.0) - firebase_analytics (10.10.7): - Firebase/Analytics (= 10.25.0) - firebase_core @@ -32,6 +35,10 @@ PODS: - Firebase/RemoteConfig (= 10.25.0) - firebase_core - Flutter + - firebase_storage (11.7.7): + - Firebase/Storage (= 10.25.0) + - firebase_core + - Flutter - FirebaseABTesting (10.29.0): - FirebaseCore (~> 10.0) - FirebaseAnalytics (10.25.0): @@ -52,6 +59,8 @@ PODS: - GoogleUtilities/Network (~> 7.11) - "GoogleUtilities/NSData+zlib (~> 7.11)" - nanopb (< 2.30911.0, >= 2.30908.0) + - FirebaseAppCheckInterop (10.29.0) + - FirebaseAuthInterop (10.29.0) - FirebaseCore (10.25.0): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) @@ -93,7 +102,18 @@ PODS: - nanopb (< 2.30911.0, >= 2.30908.0) - PromisesSwift (~> 2.1) - FirebaseSharedSwift (10.29.0) + - FirebaseStorage (10.25.0): + - FirebaseAppCheckInterop (~> 10.0) + - FirebaseAuthInterop (~> 10.25) + - FirebaseCore (~> 10.0) + - FirebaseCoreExtension (~> 10.0) + - GoogleUtilities/Environment (~> 7.12) + - GTMSessionFetcher/Core (< 4.0, >= 2.1) - Flutter (1.0.0) + - flutter_key_value_file_storage (0.0.1): + - Flutter + - flutter_secure_file_storage (0.0.1): + - Flutter - flutter_secure_storage (6.0.0): - Flutter - GoogleAppMeasurement (10.25.0): @@ -148,6 +168,7 @@ PODS: - GoogleUtilities/UserDefaults (7.13.3): - GoogleUtilities/Logger - GoogleUtilities/Privacy + - GTMSessionFetcher/Core (3.5.0) - nanopb (2.30910.0): - nanopb/decode (= 2.30910.0) - nanopb/encode (= 2.30910.0) @@ -194,7 +215,10 @@ DEPENDENCIES: - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`) - firebase_remote_config (from `.symlinks/plugins/firebase_remote_config/ios`) + - firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) - Flutter (from `Flutter`) + - flutter_key_value_file_storage (from `.symlinks/plugins/flutter_key_value_file_storage/ios`) + - flutter_secure_file_storage (from `.symlinks/plugins/flutter_secure_file_storage/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) @@ -207,6 +231,8 @@ SPEC REPOS: - Firebase - FirebaseABTesting - FirebaseAnalytics + - FirebaseAppCheckInterop + - FirebaseAuthInterop - FirebaseCore - FirebaseCoreExtension - FirebaseCoreInternal @@ -216,9 +242,11 @@ SPEC REPOS: - FirebaseRemoteConfigInterop - FirebaseSessions - FirebaseSharedSwift + - FirebaseStorage - GoogleAppMeasurement - GoogleDataTransport - GoogleUtilities + - GTMSessionFetcher - nanopb - PromisesObjC - PromisesSwift @@ -238,8 +266,14 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/firebase_crashlytics/ios" firebase_remote_config: :path: ".symlinks/plugins/firebase_remote_config/ios" + firebase_storage: + :path: ".symlinks/plugins/firebase_storage/ios" Flutter: :path: Flutter + flutter_key_value_file_storage: + :path: ".symlinks/plugins/flutter_key_value_file_storage/ios" + flutter_secure_file_storage: + :path: ".symlinks/plugins/flutter_secure_file_storage/ios" flutter_secure_storage: :path: ".symlinks/plugins/flutter_secure_storage/ios" path_provider_foundation: @@ -261,8 +295,11 @@ SPEC CHECKSUMS: firebase_core: a626d00494efa398e7c54f25f1454a64c8abf197 firebase_crashlytics: 17e856fabec68d993662abaf2f6fe2413f0abece firebase_remote_config: 7b05c80210ab558c80f7a756681022b4ee98eea0 + firebase_storage: 5c0f552d6b27d621429d7fd16ebab4be94a3c954 FirebaseABTesting: d87f56707159bae64e269757a6e963d490f2eebe FirebaseAnalytics: ec00fe8b93b41dc6fe4a28784b8e51da0647a248 + FirebaseAppCheckInterop: 6a1757cfd4067d8e00fccd14fcc1b8fd78cfac07 + FirebaseAuthInterop: 17db81e9b198afb0f95ce48c133825727eed55d3 FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483 FirebaseCoreExtension: 705ca5b14bf71d2564a0ddc677df1fc86ffa600f FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934 @@ -272,11 +309,15 @@ SPEC CHECKSUMS: FirebaseRemoteConfigInterop: 6efda51fb5e2f15b16585197e26eaa09574e8a4d FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc FirebaseSharedSwift: 20530f495084b8d840f78a100d8c5ee613375f6e + FirebaseStorage: 44f4e25073f6fa0d4d8c09f5bec299ee9e4eb985 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + flutter_key_value_file_storage: b91fb1747ffa3e36810c752a1763655fda0b9f3d + flutter_secure_file_storage: cdf659810f1849916ea5371ed5df339a3aaa802c flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12 GoogleAppMeasurement: 9abf64b682732fed36da827aa2a68f0221fd2356 GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 + GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 nanopb: 438bc412db1928dac798aa6fd75726007be04262 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e857b1b4..d346eed5 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -299,6 +299,8 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${BUILT_PRODUCTS_DIR}/FirebaseABTesting/FirebaseABTesting.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseAppCheckInterop/FirebaseAppCheckInterop.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseAuthInterop/FirebaseAuthInterop.framework", "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", "${BUILT_PRODUCTS_DIR}/FirebaseCoreExtension/FirebaseCoreExtension.framework", "${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework", @@ -308,6 +310,8 @@ "${BUILT_PRODUCTS_DIR}/FirebaseRemoteConfigInterop/FirebaseRemoteConfigInterop.framework", "${BUILT_PRODUCTS_DIR}/FirebaseSessions/FirebaseSessions.framework", "${BUILT_PRODUCTS_DIR}/FirebaseSharedSwift/FirebaseSharedSwift.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseStorage/FirebaseStorage.framework", + "${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework", "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", @@ -315,6 +319,8 @@ "${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework", "${BUILT_PRODUCTS_DIR}/connectivity_plus/connectivity_plus.framework", "${BUILT_PRODUCTS_DIR}/device_info_plus/device_info_plus.framework", + "${BUILT_PRODUCTS_DIR}/flutter_key_value_file_storage/flutter_key_value_file_storage.framework", + "${BUILT_PRODUCTS_DIR}/flutter_secure_file_storage/flutter_secure_file_storage.framework", "${BUILT_PRODUCTS_DIR}/flutter_secure_storage/flutter_secure_storage.framework", "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", "${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework", @@ -327,6 +333,8 @@ name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseABTesting.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseAppCheckInterop.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseAuthInterop.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreExtension.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework", @@ -336,6 +344,8 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseRemoteConfigInterop.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseSessions.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseSharedSwift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseStorage.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", @@ -343,6 +353,8 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity_plus.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info_plus.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_key_value_file_storage.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_secure_file_storage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_secure_storage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework", diff --git a/lib/app.dart b/lib/app.dart index bd18443c..7b36d407 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -3,6 +3,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_template/di/injectable.dart'; import 'package:flutter_template/navigator/main_navigator.dart'; +import 'package:flutter_template/repository/logging/logging_repository.dart'; import 'package:flutter_template/styles/theme_data.dart'; import 'package:flutter_template/util/locale/localization_fallback_cupertino_delegate.dart'; import 'package:flutter_template/viewmodel/global/global_viewmodel.dart'; @@ -23,6 +24,10 @@ class MyApp extends StatelessWidget { systemNavigationBarColor: Colors.transparent, )); SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); + + // init logger + getIt.get().startLogging(); + return const InternalApp(); } } diff --git a/lib/di/injectable.config.dart b/lib/di/injectable.config.dart index 0dee65f4..9799bed0 100644 --- a/lib/di/injectable.config.dart +++ b/lib/di/injectable.config.dart @@ -8,81 +8,88 @@ // coverage:ignore-file // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:dio/dio.dart' as _i47; +import 'package:dio/dio.dart' as _i52; import 'package:drift/drift.dart' as _i6; import 'package:firebase_analytics/firebase_analytics.dart' as _i8; import 'package:firebase_crashlytics/firebase_crashlytics.dart' as _i9; import 'package:firebase_remote_config/firebase_remote_config.dart' as _i10; -import 'package:flutter_secure_storage/flutter_secure_storage.dart' as _i11; +import 'package:firebase_storage/firebase_storage.dart' as _i11; +import 'package:flutter_secure_storage/flutter_secure_storage.dart' as _i12; import 'package:flutter_template/database/flutter_template_database.dart' - as _i12; -import 'package:flutter_template/database/todo/todo_dao_storage.dart' as _i23; -import 'package:flutter_template/di/injectable.dart' as _i49; -import 'package:flutter_template/navigator/main_navigator.dart' as _i15; -import 'package:flutter_template/navigator/onboarding_navigator.dart' as _i36; + as _i13; +import 'package:flutter_template/database/todo/todo_dao_storage.dart' as _i24; +import 'package:flutter_template/di/injectable.dart' as _i54; +import 'package:flutter_template/navigator/main_navigator.dart' as _i16; +import 'package:flutter_template/navigator/onboarding_navigator.dart' as _i40; import 'package:flutter_template/repository/analytics/firebase_analytics_repository.dart' - as _i27; + as _i28; import 'package:flutter_template/repository/debug/debug_repository.dart' - as _i31; -import 'package:flutter_template/repository/locale/locale_repository.dart' as _i33; +import 'package:flutter_template/repository/locale/locale_repository.dart' + as _i35; +import 'package:flutter_template/repository/logging/logging_repository.dart' + as _i36; import 'package:flutter_template/repository/login/login_repository.dart' - as _i34; -import 'package:flutter_template/repository/refresh/refresh_repository.dart' as _i37; +import 'package:flutter_template/repository/refresh/refresh_repository.dart' + as _i41; import 'package:flutter_template/repository/remote_config/remote_config.dart' - as _i18; -import 'package:flutter_template/repository/remote_config/remote_config_repository.dart' as _i19; +import 'package:flutter_template/repository/remote_config/remote_config_repository.dart' + as _i20; import 'package:flutter_template/repository/secure_storage/auth/auth_storage.dart' - as _i30; + as _i32; import 'package:flutter_template/repository/secure_storage/secure_storage.dart' - as _i20; + as _i21; import 'package:flutter_template/repository/shared_prefs/local/local_storage.dart' - as _i32; -import 'package:flutter_template/repository/todo/todo_repository.dart' as _i29; + as _i34; +import 'package:flutter_template/repository/todo/todo_repository.dart' as _i31; import 'package:flutter_template/util/cache/cache_controller.dart' as _i4; import 'package:flutter_template/util/cache/cache_controlling.dart' as _i3; import 'package:flutter_template/util/interceptor/network_auth_interceptor.dart' - as _i35; + as _i39; import 'package:flutter_template/util/interceptor/network_error_interceptor.dart' - as _i16; -import 'package:flutter_template/util/interceptor/network_log_interceptor.dart' as _i17; +import 'package:flutter_template/util/interceptor/network_log_interceptor.dart' + as _i18; import 'package:flutter_template/util/interceptor/network_refresh_interceptor.dart' - as _i45; + as _i50; import 'package:flutter_template/util/locale/localization_overrides.dart' - as _i13; -import 'package:flutter_template/util/locale/localization_overrides_impl.dart' as _i14; +import 'package:flutter_template/util/locale/localization_overrides_impl.dart' + as _i15; import 'package:flutter_template/util/snackbar/error_util.dart' as _i7; -import 'package:flutter_template/util/theme/theme_config.dart' as _i22; +import 'package:flutter_template/util/theme/theme_config.dart' as _i23; import 'package:flutter_template/viewmodel/debug/debug_platform_selector_viewmodel.dart' - as _i26; + as _i27; import 'package:flutter_template/viewmodel/debug/debug_theme_selector_viewmodel.dart' - as _i46; -import 'package:flutter_template/viewmodel/debug/debug_viewmodel.dart' as _i42; + as _i51; +import 'package:flutter_template/viewmodel/debug/debug_viewmodel.dart' as _i46; import 'package:flutter_template/viewmodel/global/global_viewmodel.dart' - as _i43; + as _i47; import 'package:flutter_template/viewmodel/license/license_viewmodel.dart' - as _i28; -import 'package:flutter_template/viewmodel/login/login_viewmodel.dart' as _i44; + as _i29; +import 'package:flutter_template/viewmodel/log_detail/log_detail_viewmodel.dart' + as _i48; +import 'package:flutter_template/viewmodel/login/login_viewmodel.dart' as _i49; +import 'package:flutter_template/viewmodel/logs/logs_viewmodel.dart' as _i38; import 'package:flutter_template/viewmodel/permission/analytics_permission_viewmodel.dart' - as _i41; + as _i45; import 'package:flutter_template/viewmodel/splash/splash_viewmodel.dart' - as _i38; + as _i42; import 'package:flutter_template/viewmodel/todo/todo_add/todo_add_viewmodel.dart' - as _i39; + as _i43; import 'package:flutter_template/viewmodel/todo/todo_list/todo_list_viewmodel.dart' - as _i40; + as _i44; import 'package:flutter_template/webservice/todo/todo_dummy_service.dart' - as _i25; -import 'package:flutter_template/webservice/todo/todo_service.dart' as _i24; -import 'package:flutter_template/webservice/todo/todo_webservice.dart' as _i48; + as _i26; +import 'package:flutter_template/webservice/todo/todo_service.dart' as _i25; +import 'package:flutter_template/webservice/todo/todo_webservice.dart' as _i53; import 'package:get_it/get_it.dart' as _i1; import 'package:icapps_architecture/icapps_architecture.dart' as _i5; import 'package:injectable/injectable.dart' as _i2; -import 'package:shared_preferences/shared_preferences.dart' as _i21; +import 'package:log_to_secure_file/log_to_secure_file.dart' as _i30; +import 'package:shared_preferences/shared_preferences.dart' as _i22; const String _dummy = 'dummy'; const String _dev = 'dev'; @@ -114,128 +121,144 @@ extension GetItInjectableX on _i1.GetIt { () => registerModule.provideFirebaseCrashlytics()); gh.lazySingleton<_i10.FirebaseRemoteConfig>( () => registerModule.provideFirebaseRemoteConfig()); - gh.lazySingleton<_i11.FlutterSecureStorage>(() => registerModule.storage()); - gh.lazySingleton<_i12.FlutterTemplateDatabase>(() => registerModule + gh.lazySingleton<_i11.FirebaseStorage>( + () => registerModule.provideFirebaseStorage()); + gh.lazySingleton<_i12.FlutterSecureStorage>(() => registerModule.storage()); + gh.lazySingleton<_i13.FlutterTemplateDatabase>(() => registerModule .provideFlutterTemplateDatabase(gh<_i6.DatabaseConnection>())); - gh.lazySingleton<_i13.LocalizationOverrides>( - () => _i14.LocalizationOverridesImpl()); - gh.lazySingleton<_i15.MainNavigator>( - () => _i15.MainNavigator(gh<_i7.ErrorUtil>())); - gh.singleton<_i16.NetworkErrorInterceptor>( - () => _i16.NetworkErrorInterceptor(gh<_i5.ConnectivityHelper>())); - gh.singleton<_i17.NetworkLogInterceptor>( - () => _i17.NetworkLogInterceptor()); - gh.lazySingleton<_i18.RemoteConfig>(() => _i18.RemoteConfig()); - gh.lazySingleton<_i19.RemoteConfigRepository>( - () => _i19.RemoteConfigRepository(gh<_i10.FirebaseRemoteConfig>())); - gh.lazySingleton<_i20.SecureStorage>( - () => _i20.SecureStorage(gh<_i11.FlutterSecureStorage>())); - await gh.singletonAsync<_i21.SharedPreferences>( + gh.lazySingleton<_i14.LocalizationOverrides>( + () => _i15.LocalizationOverridesImpl()); + gh.lazySingleton<_i16.MainNavigator>( + () => _i16.MainNavigator(gh<_i7.ErrorUtil>())); + gh.singleton<_i17.NetworkErrorInterceptor>( + () => _i17.NetworkErrorInterceptor(gh<_i5.ConnectivityHelper>())); + gh.singleton<_i18.NetworkLogInterceptor>( + () => _i18.NetworkLogInterceptor()); + gh.lazySingleton<_i19.RemoteConfig>(() => _i19.RemoteConfig()); + gh.lazySingleton<_i20.RemoteConfigRepository>( + () => _i20.RemoteConfigRepository(gh<_i10.FirebaseRemoteConfig>())); + gh.lazySingleton<_i21.SecureStorage>( + () => _i21.SecureStorage(gh<_i12.FlutterSecureStorage>())); + await gh.singletonAsync<_i22.SharedPreferences>( () => registerModule.prefs(), preResolve: true, ); - gh.lazySingleton<_i22.ThemeConfigUtil>(() => _i22.ThemeConfigUtil()); - gh.lazySingleton<_i23.TodoDaoStorage>( - () => _i23.TodoDaoStorage(gh<_i12.FlutterTemplateDatabase>())); - gh.singleton<_i24.TodoService>( - () => _i25.TodoDummyService(), + gh.lazySingleton<_i23.ThemeConfigUtil>(() => _i23.ThemeConfigUtil()); + gh.lazySingleton<_i24.TodoDaoStorage>( + () => _i24.TodoDaoStorage(gh<_i13.FlutterTemplateDatabase>())); + gh.singleton<_i25.TodoService>( + () => _i26.TodoDummyService(), registerFor: {_dummy}, ); - gh.factory<_i26.DebugPlatformSelectorViewModel>( - () => _i26.DebugPlatformSelectorViewModel(gh<_i15.MainNavigator>())); - gh.lazySingleton<_i27.FireBaseAnalyticsRepository>( - () => _i27.FireBaseAnalyticsRepository(gh<_i8.FirebaseAnalytics>())); - gh.factory<_i28.LicenseViewModel>( - () => _i28.LicenseViewModel(gh<_i15.MainNavigator>())); + gh.factory<_i27.DebugPlatformSelectorViewModel>( + () => _i27.DebugPlatformSelectorViewModel(gh<_i16.MainNavigator>())); + gh.lazySingleton<_i28.FireBaseAnalyticsRepository>( + () => _i28.FireBaseAnalyticsRepository(gh<_i8.FirebaseAnalytics>())); + gh.factory<_i29.LicenseViewModel>( + () => _i29.LicenseViewModel(gh<_i16.MainNavigator>())); + gh.lazySingleton<_i30.SecureLogStorage>( + () => registerModule.provideSecureLogStorage(gh<_i21.SecureStorage>())); gh.lazySingleton<_i5.SharedPreferenceStorage>( - () => registerModule.sharedPreferences(gh<_i21.SharedPreferences>())); + () => registerModule.sharedPreferences(gh<_i22.SharedPreferences>())); gh.lazySingleton<_i5.SimpleKeyValueStorage>( () => registerModule.keyValueStorage( gh<_i5.SharedPreferenceStorage>(), - gh<_i20.SecureStorage>(), + gh<_i21.SecureStorage>(), )); - gh.lazySingleton<_i29.TodoRepository>(() => _i29.TodoRepository( - gh<_i24.TodoService>(), - gh<_i23.TodoDaoStorage>(), + gh.lazySingleton<_i31.TodoRepository>(() => _i31.TodoRepository( + gh<_i25.TodoService>(), + gh<_i24.TodoDaoStorage>(), )); - gh.lazySingleton<_i30.AuthStorage>( - () => _i30.AuthStorage(gh<_i5.SimpleKeyValueStorage>())); - gh.lazySingleton<_i31.DebugRepository>( - () => _i31.DebugRepository(gh<_i5.SharedPreferenceStorage>())); - gh.lazySingleton<_i32.LocalStorage>(() => _i32.LocalStorage( - gh<_i30.AuthStorage>(), + gh.lazySingleton<_i32.AuthStorage>( + () => _i32.AuthStorage(gh<_i5.SimpleKeyValueStorage>())); + gh.lazySingleton<_i33.DebugRepository>( + () => _i33.DebugRepository(gh<_i5.SharedPreferenceStorage>())); + gh.lazySingleton<_i34.LocalStorage>(() => _i34.LocalStorage( + gh<_i32.AuthStorage>(), gh<_i5.SharedPreferenceStorage>(), )); - gh.lazySingleton<_i33.LocaleRepository>( - () => _i33.LocaleRepository(gh<_i5.SharedPreferenceStorage>())); - gh.lazySingleton<_i34.LoginRepository>( - () => _i34.LoginRepository(gh<_i30.AuthStorage>())); - gh.singleton<_i35.NetworkAuthInterceptor>( - () => _i35.NetworkAuthInterceptor(gh<_i30.AuthStorage>())); - gh.lazySingleton<_i36.OnboardingNavigator>(() => _i36.OnboardingNavigator( - gh<_i15.MainNavigator>(), - gh<_i32.LocalStorage>(), - gh<_i34.LoginRepository>(), + gh.lazySingleton<_i35.LocaleRepository>( + () => _i35.LocaleRepository(gh<_i5.SharedPreferenceStorage>())); + gh.lazySingleton<_i36.LoggingRepository>(() => _i36.LoggingRepository( + gh<_i11.FirebaseStorage>(), + gh<_i30.SecureLogStorage>(), + )); + gh.lazySingleton<_i37.LoginRepository>( + () => _i37.LoginRepository(gh<_i32.AuthStorage>())); + gh.factory<_i38.LogsViewModel>(() => _i38.LogsViewModel( + gh<_i16.MainNavigator>(), + gh<_i30.SecureLogStorage>(), )); - gh.lazySingleton<_i37.RefreshRepository>( - () => _i37.RefreshRepository(gh<_i30.AuthStorage>())); - gh.factory<_i38.SplashViewModel>(() => _i38.SplashViewModel( - gh<_i32.LocalStorage>(), - gh<_i36.OnboardingNavigator>(), - gh<_i19.RemoteConfigRepository>(), + gh.singleton<_i39.NetworkAuthInterceptor>( + () => _i39.NetworkAuthInterceptor(gh<_i32.AuthStorage>())); + gh.lazySingleton<_i40.OnboardingNavigator>(() => _i40.OnboardingNavigator( + gh<_i16.MainNavigator>(), + gh<_i34.LocalStorage>(), + gh<_i37.LoginRepository>(), )); - gh.factory<_i39.TodoAddViewModel>(() => _i39.TodoAddViewModel( - gh<_i29.TodoRepository>(), - gh<_i15.MainNavigator>(), + gh.lazySingleton<_i41.RefreshRepository>( + () => _i41.RefreshRepository(gh<_i32.AuthStorage>())); + gh.factory<_i42.SplashViewModel>(() => _i42.SplashViewModel( + gh<_i34.LocalStorage>(), + gh<_i40.OnboardingNavigator>(), + gh<_i20.RemoteConfigRepository>(), )); - gh.factory<_i40.TodoListViewModel>(() => _i40.TodoListViewModel( - gh<_i29.TodoRepository>(), - gh<_i15.MainNavigator>(), + gh.factory<_i43.TodoAddViewModel>(() => _i43.TodoAddViewModel( + gh<_i31.TodoRepository>(), + gh<_i16.MainNavigator>(), )); - gh.factory<_i41.AnalyticsPermissionViewModel>( - () => _i41.AnalyticsPermissionViewModel( - gh<_i36.OnboardingNavigator>(), - gh<_i32.LocalStorage>(), + gh.factory<_i44.TodoListViewModel>(() => _i44.TodoListViewModel( + gh<_i31.TodoRepository>(), + gh<_i16.MainNavigator>(), + )); + gh.factory<_i45.AnalyticsPermissionViewModel>( + () => _i45.AnalyticsPermissionViewModel( + gh<_i40.OnboardingNavigator>(), + gh<_i34.LocalStorage>(), )); - gh.factory<_i42.DebugViewModel>(() => _i42.DebugViewModel( - gh<_i31.DebugRepository>(), - gh<_i15.MainNavigator>(), - gh<_i12.FlutterTemplateDatabase>(), - gh<_i32.LocalStorage>(), + gh.factory<_i46.DebugViewModel>(() => _i46.DebugViewModel( + gh<_i33.DebugRepository>(), + gh<_i16.MainNavigator>(), + gh<_i13.FlutterTemplateDatabase>(), + gh<_i34.LocalStorage>(), + )); + gh.lazySingleton<_i47.GlobalViewModel>(() => _i47.GlobalViewModel( + gh<_i35.LocaleRepository>(), + gh<_i33.DebugRepository>(), + gh<_i34.LocalStorage>(), + gh<_i23.ThemeConfigUtil>(), + gh<_i14.LocalizationOverrides>(), )); - gh.lazySingleton<_i43.GlobalViewModel>(() => _i43.GlobalViewModel( - gh<_i33.LocaleRepository>(), - gh<_i31.DebugRepository>(), - gh<_i32.LocalStorage>(), - gh<_i22.ThemeConfigUtil>(), - gh<_i13.LocalizationOverrides>(), + gh.factory<_i48.LogDetailViewModel>(() => _i48.LogDetailViewModel( + gh<_i30.SecureLogStorage>(), + gh<_i36.LoggingRepository>(), )); - gh.factory<_i44.LoginViewModel>(() => _i44.LoginViewModel( - gh<_i34.LoginRepository>(), - gh<_i15.MainNavigator>(), - gh<_i36.OnboardingNavigator>(), + gh.factory<_i49.LoginViewModel>(() => _i49.LoginViewModel( + gh<_i37.LoginRepository>(), + gh<_i16.MainNavigator>(), + gh<_i40.OnboardingNavigator>(), )); - gh.singleton<_i45.NetworkRefreshInterceptor>( - () => _i45.NetworkRefreshInterceptor( - gh<_i30.AuthStorage>(), - gh<_i37.RefreshRepository>(), + gh.singleton<_i50.NetworkRefreshInterceptor>( + () => _i50.NetworkRefreshInterceptor( + gh<_i32.AuthStorage>(), + gh<_i41.RefreshRepository>(), )); gh.lazySingleton<_i5.CombiningSmartInterceptor>( () => registerModule.provideCombiningSmartInterceptor( - gh<_i17.NetworkLogInterceptor>(), - gh<_i35.NetworkAuthInterceptor>(), - gh<_i16.NetworkErrorInterceptor>(), - gh<_i45.NetworkRefreshInterceptor>(), + gh<_i18.NetworkLogInterceptor>(), + gh<_i39.NetworkAuthInterceptor>(), + gh<_i17.NetworkErrorInterceptor>(), + gh<_i50.NetworkRefreshInterceptor>(), )); - gh.factory<_i46.DebugThemeSelectorViewModel>( - () => _i46.DebugThemeSelectorViewModel( - gh<_i15.MainNavigator>(), - gh<_i43.GlobalViewModel>(), + gh.factory<_i51.DebugThemeSelectorViewModel>( + () => _i51.DebugThemeSelectorViewModel( + gh<_i16.MainNavigator>(), + gh<_i47.GlobalViewModel>(), )); - gh.lazySingleton<_i47.Dio>( + gh.lazySingleton<_i52.Dio>( () => registerModule.provideDio(gh<_i5.CombiningSmartInterceptor>())); - gh.singleton<_i24.TodoService>( - () => _i48.TodoWebService(gh<_i47.Dio>()), + gh.singleton<_i25.TodoService>( + () => _i53.TodoWebService(gh<_i52.Dio>()), registerFor: { _dev, _prod, @@ -245,4 +268,4 @@ extension GetItInjectableX on _i1.GetIt { } } -class _$RegisterModule extends _i49.RegisterModule {} +class _$RegisterModule extends _i54.RegisterModule {} diff --git a/lib/di/injectable.dart b/lib/di/injectable.dart index 0c373590..93043573 100644 --- a/lib/di/injectable.dart +++ b/lib/di/injectable.dart @@ -5,6 +5,7 @@ import 'package:drift/drift.dart'; import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:firebase_remote_config/firebase_remote_config.dart'; +import 'package:firebase_storage/firebase_storage.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter_template/database/flutter_template_database.dart'; @@ -21,6 +22,7 @@ import 'package:flutter_template/util/interceptor/network_refresh_interceptor.da import 'package:get_it/get_it.dart'; import 'package:icapps_architecture/icapps_architecture.dart'; import 'package:injectable/injectable.dart'; +import 'package:log_to_secure_file/log_to_secure_file.dart'; import 'package:shared_preferences/shared_preferences.dart'; final getIt = GetIt.asNewInstance(); @@ -60,12 +62,18 @@ abstract class RegisterModule { return createDriftDatabaseConnection('db'); } + @lazySingleton + SecureLogStorage provideSecureLogStorage(SecureStorage secureStorage) => SecureLogStorage(); + @lazySingleton FirebaseAnalytics provideFirebaseAnalytics() => FirebaseAnalytics.instance; @lazySingleton FirebaseCrashlytics provideFirebaseCrashlytics() => FirebaseCrashlytics.instance; + @lazySingleton + FirebaseStorage provideFirebaseStorage() => FirebaseStorage.instance; + @lazySingleton FlutterSecureStorage storage() => const FlutterSecureStorage(); diff --git a/lib/navigator/main_navigator.dart b/lib/navigator/main_navigator.dart index 9af72c80..43ade5e5 100644 --- a/lib/navigator/main_navigator.dart +++ b/lib/navigator/main_navigator.dart @@ -21,6 +21,8 @@ class MainNavigator with BaseNavigator { static String get initialRoute => FlavorConfig.isInTest() ? 'test_route' : RouteNames.splashScreen; + BuildContext get context => navigatorKey.currentContext!; + static List get navigatorObservers => _navigatorObservers; Future goToDatabase(GeneratedDatabase db) async => _navigator.push(MaterialPageRoute(builder: (context) => DriftDbViewer(db))); diff --git a/lib/navigator/main_navigator.navigator.dart b/lib/navigator/main_navigator.navigator.dart index 4329f8ca..870362b7 100644 --- a/lib/navigator/main_navigator.navigator.dart +++ b/lib/navigator/main_navigator.navigator.dart @@ -16,7 +16,9 @@ import '../screen/debug/debug_platform_selector_screen.dart'; import '../screen/debug/debug_screen.dart'; import '../screen/home/home_screen.dart'; import '../screen/license/license_screen.dart'; +import '../screen/log_detail/log_detail_screen.dart'; import '../screen/login/login_screen.dart'; +import '../screen/logs/logs_screen.dart'; import '../screen/permission/analytics_permission_screen.dart'; import '../screen/splash/splash_screen.dart'; import '../screen/theme_mode/theme_mode_selector.dart'; @@ -58,6 +60,31 @@ mixin BaseNavigator { settings: settings, fullscreenDialog: false, ); + case RouteNames.logDetailScreen: + return MaterialPageRoute( + builder: (_) => LogDetailScreen( + date: arguments['date'] as String, + key: arguments['key'] as Key?, + ), + settings: settings, + fullscreenDialog: false, + ); + case RouteNames.todoAddScreen: + return MaterialPageRoute( + builder: (_) => TodoAddScreen( + key: arguments['key'] as Key?, + ), + settings: settings, + fullscreenDialog: false, + ); + case RouteNames.logsScreen: + return MaterialPageRoute( + builder: (_) => LogsScreen( + key: arguments['key'] as Key?, + ), + settings: settings, + fullscreenDialog: false, + ); case RouteNames.analyticsPermissionScreen: return MaterialPageRoute( builder: (_) => AnalyticsPermissionScreen( @@ -98,14 +125,6 @@ mixin BaseNavigator { settings: settings, fullscreenDialog: false, ); - case RouteNames.todoAddScreen: - return MaterialPageRoute( - builder: (_) => TodoAddScreen( - key: arguments['key'] as Key?, - ), - settings: settings, - fullscreenDialog: false, - ); } return null; } @@ -127,6 +146,27 @@ mixin BaseNavigator { RouteNames.licenseScreen, arguments: {'key': key}, ); + Future goToLogDetailScreen({ + required String date, + _i1.Key? key, + }) async => + navigatorKey.currentState?.pushNamed( + Uri( + path: RouteNames.logDetailScreen, + queryParameters: {'date': date}, + ).toString(), + arguments: {'date': date, 'key': key}, + ); + Future goToTodoAddScreen({_i1.Key? key}) async => + navigatorKey.currentState?.pushNamed( + RouteNames.todoAddScreen, + arguments: {'key': key}, + ); + Future goToLogsScreen({_i1.Key? key}) async => + navigatorKey.currentState?.pushNamed( + RouteNames.logsScreen, + arguments: {'key': key}, + ); Future goToAnalyticsPermissionScreen({_i1.Key? key}) async => navigatorKey.currentState?.pushNamed( RouteNames.analyticsPermissionScreen, @@ -153,11 +193,6 @@ mixin BaseNavigator { RouteNames.debugScreen, arguments: {'key': key}, ); - Future goToTodoAddScreen({_i1.Key? key}) async => - navigatorKey.currentState?.pushNamed( - RouteNames.todoAddScreen, - arguments: {'key': key}, - ); void goBack() => navigatorKey.currentState?.pop(); void goBackWithResult({T? result}) => navigatorKey.currentState?.pop(result); @@ -186,6 +221,15 @@ class RouteNames { /// /license static const licenseScreen = '/license'; + /// /log-detail + static const logDetailScreen = '/log-detail'; + + /// /todo-add + static const todoAddScreen = '/todo-add'; + + /// /logs + static const logsScreen = '/logs'; + /// /analytics-permission static const analyticsPermissionScreen = '/analytics-permission'; @@ -200,7 +244,4 @@ class RouteNames { /// /debug static const debugScreen = '/debug'; - - /// /todo-add - static const todoAddScreen = '/todo-add'; } diff --git a/lib/repository/logging/base_logging_repository.dart b/lib/repository/logging/base_logging_repository.dart new file mode 100644 index 00000000..cedbdfb8 --- /dev/null +++ b/lib/repository/logging/base_logging_repository.dart @@ -0,0 +1,40 @@ +import 'dart:io'; + +import 'package:icapps_architecture/icapps_architecture.dart'; +import 'package:log_to_secure_file/log_to_secure_file.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:synchronized/synchronized.dart'; + +abstract class BaseLoggingRepository { + final SecureLogStorage _secureLogStorage; + + BaseLoggingRepository( + this._secureLogStorage, + ); + + final _loggerLock = Lock(); + + String tempLogPath = '/logs'; + + void startLogging() { + _secureLogStorage.init(); + LoggingFactory.configure(LoggingConfiguration(onLog: (value) => storeLogLine(value))); + } + + void storeLogLine(String line) => _loggerLock.synchronized(() => _secureLogStorage.storeLogLine(line)); + + Future uploadLog(DateTime date) async { + final applicationDirectory = await getApplicationCacheDirectory(); + final file = File('${applicationDirectory.path}$tempLogPath'); + if (file.existsSync()) { + file.deleteSync(); + file.createSync(); + } + final log = await _secureLogStorage.getLogFromDate(date); + await file.writeAsString(log.join('\n')); + await uploadFile(file, date); + file.deleteSync(); + } + + Future uploadFile(File file, DateTime date); +} diff --git a/lib/repository/logging/logging_repository.dart b/lib/repository/logging/logging_repository.dart new file mode 100644 index 00000000..0ebf6aa1 --- /dev/null +++ b/lib/repository/logging/logging_repository.dart @@ -0,0 +1,23 @@ +import 'dart:io'; + +import 'package:firebase_storage/firebase_storage.dart'; +import 'package:flutter_template/repository/logging/base_logging_repository.dart'; +import 'package:flutter_template/util/extension/date_time_extension.dart'; +import 'package:injectable/injectable.dart'; + +@lazySingleton +class LoggingRepository extends BaseLoggingRepository { + final FirebaseStorage _firebaseStorage; + + LoggingRepository( + this._firebaseStorage, + super.secureLogStorage, + ); + + @override + Future uploadFile(File file, DateTime date) async { + const userId = 'TestUser'; + final ref = _firebaseStorage.ref('logs/$userId-${date.dottedShortDateFormat}.txt'); + await ref.putFile(file); + } +} diff --git a/lib/screen/debug/debug_screen.dart b/lib/screen/debug/debug_screen.dart index e1059b79..fd5b6990 100644 --- a/lib/screen/debug/debug_screen.dart +++ b/lib/screen/debug/debug_screen.dart @@ -86,6 +86,12 @@ class DebugScreenState extends State { title: localization.debugPermissionResetAnalytics, onClick: viewModel.resetAnalyticsPermission, ), + const DebugRowTitle(title: 'logs'), + DebugRowItem( + key: Keys.debugPermissionAnalyticsReset, + title: 'Show logs', + onClick: viewModel.onLogsTapped, + ), ], ), ); diff --git a/lib/screen/log_detail/log_detail_screen.dart b/lib/screen/log_detail/log_detail_screen.dart new file mode 100644 index 00000000..904270c7 --- /dev/null +++ b/lib/screen/log_detail/log_detail_screen.dart @@ -0,0 +1,52 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_navigation_generator_annotations/flutter_navigation_generator_annotations.dart'; +import 'package:flutter_template/di/injectable.dart'; +import 'package:flutter_template/styles/theme_data.dart'; +import 'package:flutter_template/viewmodel/log_detail/log_detail_viewmodel.dart'; +import 'package:flutter_template/widget/general/simple_screen/base_screen.dart'; +import 'package:flutter_template/widget/general/styled/flutter_template_button.dart'; +import 'package:flutter_template/widget/provider/provider_widget.dart'; + +@flutterRoute +class LogDetailScreen extends StatefulWidget { + final String date; + + const LogDetailScreen({ + required this.date, + super.key, + }); + + @override + LogDetailScreenState createState() => LogDetailScreenState(); +} + +class LogDetailScreenState extends State { + @override + Widget build(BuildContext context) { + return ProviderWidget( + create: () => getIt()..init(widget.date), + childBuilderWithViewModel: (context, viewModel, theme, localization) => BaseScreen( + children: [ + Expanded( + child: ListView.builder( + reverse: true, + itemCount: viewModel.logs.length, + itemBuilder: (context, index) { + final log = viewModel.logs.reversed.toList()[index]; + return Text( + log, + style: theme.text.bodySmall, + ); + }, + ), + ), + FlutterTemplateButton( + isEnabled: !viewModel.isLoading, + text: 'Upload log', + onClick: viewModel.uploadLog, + ) + ], + ), + ); + } +} diff --git a/lib/screen/logs/logs_screen.dart b/lib/screen/logs/logs_screen.dart new file mode 100644 index 00000000..a1ed0381 --- /dev/null +++ b/lib/screen/logs/logs_screen.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_navigation_generator_annotations/flutter_navigation_generator_annotations.dart'; +import 'package:flutter_template/di/injectable.dart'; +import 'package:flutter_template/styles/theme_data.dart'; +import 'package:flutter_template/util/extension/date_time_extension.dart'; +import 'package:flutter_template/viewmodel/logs/logs_viewmodel.dart'; +import 'package:flutter_template/widget/general/simple_screen/base_screen.dart'; +import 'package:flutter_template/widget/general/styled/flutter_template_button.dart'; +import 'package:flutter_template/widget/provider/provider_widget.dart'; +import 'package:icapps_architecture/icapps_architecture.dart'; + +@flutterRoute +class LogsScreen extends StatefulWidget { + const LogsScreen({super.key}); + + @override + LogsScreenState createState() => LogsScreenState(); +} + +class LogsScreenState extends State { + @override + Widget build(BuildContext context) { + return ProviderWidget( + create: () => getIt()..init(), + childBuilderWithViewModel: (context, viewModel, theme, localization) => BaseScreen.child( + title: 'Logs', + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + Expanded( + child: ListView.builder( + padding: const EdgeInsets.symmetric(vertical: 16), + itemCount: viewModel.availableDates.length, + itemBuilder: (context, index) { + final item = viewModel.availableDates[index]; + return TouchFeedBack( + onTapped: () => viewModel.onLogTapped(item), + child: Text( + item.shortDateWeekdayFormat, + style: theme.text.bodyBig, + ), + ); + }, + ), + ), + FlutterTemplateButton( + text: 'Trigger crash', + onClick: viewModel.triggerError, + ), + ], + ), + ), + ); + } +} diff --git a/lib/util/extension/date_time_extension.dart b/lib/util/extension/date_time_extension.dart new file mode 100644 index 00000000..9e20239b --- /dev/null +++ b/lib/util/extension/date_time_extension.dart @@ -0,0 +1,21 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_template/di/injectable.dart'; +import 'package:flutter_template/navigator/main_navigator.dart'; +import 'package:flutter_template/util/locale/localization.dart'; +import 'package:intl/intl.dart'; + +extension DateTimeExtentions on DateTime { + BuildContext get _context => getIt().context; + + String get shortDateFormat => _formatDateWithFormatString(formatString: 'dd/MM/yyyy'); + + String get dottedShortDateFormat => _formatDateWithFormatString(formatString: 'dd.MM.yyyy'); + + String get shortDateWeekdayFormat => _formatDateWithFormatString(formatString: 'EEEE dd/MM/yyyy'); + + String _formatDateWithFormatString({required String formatString}) { + final languageTag = Localization.of(_context).locale?.languageCode; + final dateFormat = DateFormat(formatString, languageTag); + return dateFormat.format(toLocal()); + } +} diff --git a/lib/viewmodel/debug/debug_viewmodel.dart b/lib/viewmodel/debug/debug_viewmodel.dart index d1c22086..c6a8716a 100644 --- a/lib/viewmodel/debug/debug_viewmodel.dart +++ b/lib/viewmodel/debug/debug_viewmodel.dart @@ -50,4 +50,6 @@ class DebugViewModel with ChangeNotifierEx { void goToAnalyticsPermissionScreen() => _navigator.goToAnalyticsPermissionScreen(); void resetAnalyticsPermission() => _localStorage.updateHasAnalyticsPermission(null); + + void onLogsTapped() => _navigator.goToLogsScreen(); } diff --git a/lib/viewmodel/log_detail/log_detail_viewmodel.dart b/lib/viewmodel/log_detail/log_detail_viewmodel.dart new file mode 100644 index 00000000..6be8b4ac --- /dev/null +++ b/lib/viewmodel/log_detail/log_detail_viewmodel.dart @@ -0,0 +1,40 @@ +import 'package:flutter_template/repository/logging/logging_repository.dart'; +import 'package:icapps_architecture/icapps_architecture.dart'; +import 'package:injectable/injectable.dart'; +import 'package:log_to_secure_file/log_to_secure_file.dart'; + +@injectable +class LogDetailViewModel with ChangeNotifierEx { + late final DateTime _date; + final SecureLogStorage _secureLogStorage; + final LoggingRepository _loggingRepository; + + final List _logs = []; + + bool _isLoading = false; + + List get logs => _logs; + + bool get isLoading => _isLoading; + + LogDetailViewModel( + this._secureLogStorage, + this._loggingRepository, + ); + + Future init(String date) async { + _date = DateTime.parse(date); + _logs.replaceAll(await _secureLogStorage.getLogFromDate(_date)); + if (disposed) return; + notifyListeners(); + } + + Future uploadLog() async { + _isLoading = true; + notifyListeners(); + await _loggingRepository.uploadLog(_date); + _isLoading = false; + if (disposed) return; + notifyListeners(); + } +} diff --git a/lib/viewmodel/logs/logs_viewmodel.dart b/lib/viewmodel/logs/logs_viewmodel.dart new file mode 100644 index 00000000..5ae32cc7 --- /dev/null +++ b/lib/viewmodel/logs/logs_viewmodel.dart @@ -0,0 +1,41 @@ +import 'package:flutter_template/navigator/main_navigator.dart'; +import 'package:flutter_template/util/logging/flutter_template_logger.dart'; +import 'package:icapps_architecture/icapps_architecture.dart'; +import 'package:injectable/injectable.dart'; +import 'package:log_to_secure_file/log_to_secure_file.dart'; + +@injectable +class LogsViewModel with ChangeNotifierEx { + final MainNavigator _navigator; + final SecureLogStorage _secureLogStorage; + + final List _dates = []; + + List get availableDates => _dates; + + LogsViewModel( + this._navigator, + this._secureLogStorage, + ); + + Future init() async { + _dates.replaceAll(await _secureLogStorage.availableDates()); + if (disposed) return; + notifyListeners(); + } + + void triggerError() { + try { + throw Exception('This is a test error'); + } catch (e, trace) { + FlutterTemplateLogger.logError( + 'Error', + error: e, + stackTrace: trace, + sendToFirebase: false, + ); + } + } + + void onLogTapped(DateTime date) => _navigator.goToLogDetailScreen(date: date.toIso8601String()); +} diff --git a/lib/widget/general/simple_screen/base_screen.dart b/lib/widget/general/simple_screen/base_screen.dart index 9759f572..9204f837 100644 --- a/lib/widget/general/simple_screen/base_screen.dart +++ b/lib/widget/general/simple_screen/base_screen.dart @@ -12,6 +12,7 @@ class BaseScreen extends StatelessWidget { final bool showHeader; final bool isLoading; final bool hasBottomSafeSpace; + final bool reversed; final int? itemCount; final Color? background; final String? title; @@ -25,6 +26,7 @@ class BaseScreen extends StatelessWidget { const BaseScreen({ required this.children, + this.reversed = false, this.actions, this.onRefresh, this.isLoading = false, @@ -44,6 +46,7 @@ class BaseScreen extends StatelessWidget { const BaseScreen.builder({ required this.itemBuilder, required this.itemCount, + this.reversed = false, this.actions, this.onRefresh, this.isLoading = false, @@ -61,6 +64,7 @@ class BaseScreen extends StatelessWidget { const BaseScreen.slivers({ required this.children, + this.reversed = false, this.actions, this.onRefresh, this.hasBottomSafeSpace = true, @@ -93,7 +97,8 @@ class BaseScreen extends StatelessWidget { isScrollable = false, useSlivers = false, itemBuilder = null, - itemCount = null; + itemCount = null, + reversed = false; @override Widget build(BuildContext context) { @@ -132,6 +137,7 @@ class BaseScreen extends StatelessWidget { child: child, itemBuilder: itemBuilder, itemCount: itemCount, + reversed: reversed, ); if (onRefresh == null) return content; diff --git a/lib/widget/general/simple_screen/base_screen_content.dart b/lib/widget/general/simple_screen/base_screen_content.dart index b6d556eb..4032825b 100644 --- a/lib/widget/general/simple_screen/base_screen_content.dart +++ b/lib/widget/general/simple_screen/base_screen_content.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; class BaseScreenContent extends StatelessWidget { final bool useSlivers; final bool isScrollable; + final bool reversed; final int? itemCount; final Widget? child; final EdgeInsets padding; @@ -16,6 +17,7 @@ class BaseScreenContent extends StatelessWidget { required this.children, required this.itemBuilder, required this.itemCount, + required this.reversed, this.child, super.key, }); @@ -28,16 +30,21 @@ class BaseScreenContent extends StatelessWidget { if (useSlivers) { content = CustomScrollView( slivers: children, + reverse: reversed, ); } else if (isScrollable) { content = ListView( padding: padding, + reverse: reversed, children: children, ); } else { content = Padding( padding: padding, - child: Column(children: children), + child: Column( + verticalDirection: reversed ? VerticalDirection.up : VerticalDirection.down, + children: children, + ), ); } } else if (itemBuilder != null) { @@ -45,6 +52,7 @@ class BaseScreenContent extends StatelessWidget { padding: padding, itemBuilder: itemBuilder!, itemCount: itemCount, + reverse: reversed, ); } else { content = Padding( diff --git a/pubspec.lock b/pubspec.lock index d09ff617..60cbff4d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -457,6 +457,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.6.7" + firebase_storage: + dependency: "direct main" + description: + name: firebase_storage + sha256: "2ae478ceec9f458c1bcbf0ee3e0100e4e909708979e83f16d5d9fba35a5b42c1" + url: "https://pub.dev" + source: hosted + version: "11.7.7" + firebase_storage_platform_interface: + dependency: transitive + description: + name: firebase_storage_platform_interface + sha256: "4e18662e6a66e2e0e181c06f94707de06d5097d70cfe2b5141bf64660c5b5da9" + url: "https://pub.dev" + source: hosted + version: "5.1.22" + firebase_storage_web: + dependency: transitive + description: + name: firebase_storage_web + sha256: "3a44aacd38a372efb159f6fe36bb4a7d79823949383816457fd43d3d47602a53" + url: "https://pub.dev" + source: hosted + version: "3.9.7" fixnum: dependency: transitive description: @@ -478,6 +502,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.4.1" + flutter_key_value_file_storage: + dependency: transitive + description: + name: flutter_key_value_file_storage + sha256: a39cb3814eae20aa58747c874235d94411955df4bb287afb3aab12f1f2bbdfe6 + url: "https://pub.dev" + source: hosted + version: "0.0.8" flutter_launcher_icons: dependency: "direct dev" description: @@ -515,6 +547,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" + flutter_secure_file_storage: + dependency: transitive + description: + name: flutter_secure_file_storage + sha256: ea582e959c9ab8916041bf39c93ce0e5ccbd9e93c38d8424ef48b4cb4dd6a0c6 + url: "https://pub.dev" + source: hosted + version: "1.1.0" flutter_secure_storage: dependency: "direct main" description: @@ -678,7 +718,7 @@ packages: source: hosted version: "2.4.2" intl: - dependency: transitive + dependency: "direct main" description: name: intl sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf @@ -765,6 +805,15 @@ packages: url: "https://pub.dev" source: hosted version: "12.1.3" + log_to_secure_file: + dependency: "direct main" + description: + path: "." + ref: main + resolved-ref: "44e7f61a7c31e474274f613fcdd15bdd758e8a50" + url: "https://github.com/icapps/log_to_secure_file.git" + source: git + version: "1.0.0" logger: dependency: transitive description: @@ -949,6 +998,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" + url: "https://pub.dev" + source: hosted + version: "3.9.1" pool: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b7c96448..6734efd4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,6 +2,8 @@ name: flutter_template description: A Flutter Template to get started quickly version: 1.0.0+1 +publish_to: none + environment: sdk: ">=3.0.0 <4.0.0" @@ -21,6 +23,7 @@ dependencies: firebase_core_web: ^2.1.0 firebase_crashlytics: ^3.0.10 firebase_remote_config: ^4.4.7 + firebase_storage: ^11.7.7 flutter: sdk: flutter flutter_cache_manager: ^3.3.0 @@ -35,7 +38,12 @@ dependencies: get_it: ^7.2.0 icapps_architecture: ^2.1.0 injectable: ^2.1.0 + intl: ^0.19.0 json_annotation: ^4.7.0 + log_to_secure_file: + git: + url: https://github.com/icapps/log_to_secure_file.git + ref: main niddler_dart: ^1.6.0 path: ^1.8.2 path_provider: ^2.0.11 @@ -49,7 +57,7 @@ dependencies: sprintf: ^7.0.0 sqlite3_flutter_libs: ^0.5.12 storage_inspector: ^0.4.0 - synchronized: ^3.0.1 + synchronized: ^3.3.0+3 url_launcher: ^6.3.1 dev_dependencies: diff --git a/test/screen/debug/debug_screen_test.mocks.dart b/test/screen/debug/debug_screen_test.mocks.dart index c6382915..19845d3f 100644 --- a/test/screen/debug/debug_screen_test.mocks.dart +++ b/test/screen/debug/debug_screen_test.mocks.dart @@ -146,6 +146,15 @@ class MockDebugViewModel extends _i1.Mock implements _i2.DebugViewModel { returnValueForMissingStub: null, ); + @override + void onLogsTapped() => super.noSuchMethod( + Invocation.method( + #onLogsTapped, + [], + ), + returnValueForMissingStub: null, + ); + @override void dispose() => super.noSuchMethod( Invocation.method( diff --git a/test/screen/debug/img/debug_screen_inital_state_ipad_pro.png b/test/screen/debug/img/debug_screen_inital_state_ipad_pro.png index 5a64f728..9a244978 100644 Binary files a/test/screen/debug/img/debug_screen_inital_state_ipad_pro.png and b/test/screen/debug/img/debug_screen_inital_state_ipad_pro.png differ diff --git a/test/screen/debug/img/debug_screen_show_locale_key_disabled_ipad_pro.png b/test/screen/debug/img/debug_screen_show_locale_key_disabled_ipad_pro.png index 5a64f728..9a244978 100644 Binary files a/test/screen/debug/img/debug_screen_show_locale_key_disabled_ipad_pro.png and b/test/screen/debug/img/debug_screen_show_locale_key_disabled_ipad_pro.png differ diff --git a/test/screen/debug/img/debug_screen_show_locale_key_enabled_ipad_pro.png b/test/screen/debug/img/debug_screen_show_locale_key_enabled_ipad_pro.png index 9eef3f37..9396d35e 100644 Binary files a/test/screen/debug/img/debug_screen_show_locale_key_enabled_ipad_pro.png and b/test/screen/debug/img/debug_screen_show_locale_key_enabled_ipad_pro.png differ diff --git a/test/screen/debug/img/debug_screen_slow_animations_disabled_ipad_pro.png b/test/screen/debug/img/debug_screen_slow_animations_disabled_ipad_pro.png index 5a64f728..9a244978 100644 Binary files a/test/screen/debug/img/debug_screen_slow_animations_disabled_ipad_pro.png and b/test/screen/debug/img/debug_screen_slow_animations_disabled_ipad_pro.png differ diff --git a/test/screen/debug/img/debug_screen_slow_animations_enabled_ipad_pro.png b/test/screen/debug/img/debug_screen_slow_animations_enabled_ipad_pro.png index cd465c97..5e305aed 100644 Binary files a/test/screen/debug/img/debug_screen_slow_animations_enabled_ipad_pro.png and b/test/screen/debug/img/debug_screen_slow_animations_enabled_ipad_pro.png differ diff --git a/test/screen/home/home_screen_test.mocks.dart b/test/screen/home/home_screen_test.mocks.dart index ec37842e..48830a0f 100644 --- a/test/screen/home/home_screen_test.mocks.dart +++ b/test/screen/home/home_screen_test.mocks.dart @@ -534,6 +534,15 @@ class MockDebugViewModel extends _i1.Mock implements _i11.DebugViewModel { returnValueForMissingStub: null, ); + @override + void onLogsTapped() => super.noSuchMethod( + Invocation.method( + #onLogsTapped, + [], + ), + returnValueForMissingStub: null, + ); + @override void dispose() => super.noSuchMethod( Invocation.method( diff --git a/test/util/test_util.mocks.dart b/test/util/test_util.mocks.dart index 88147638..71672f00 100644 --- a/test/util/test_util.mocks.dart +++ b/test/util/test_util.mocks.dart @@ -7,14 +7,14 @@ import 'dart:async' as _i5; import 'dart:ui' as _i4; import 'package:drift/drift.dart' as _i11; -import 'package:flutter/material.dart' as _i1; +import 'package:flutter/material.dart' as _i2; import 'package:flutter_template/model/snackbar/snackbar_data.dart' as _i12; import 'package:flutter_template/navigator/main_navigator.dart' as _i10; import 'package:flutter_template/util/locale/localization.dart' as _i7; import 'package:flutter_template/util/snackbar/error_util.dart' as _i9; import 'package:flutter_template/viewmodel/global/global_viewmodel.dart' as _i3; import 'package:icapps_architecture/icapps_architecture.dart' as _i8; -import 'package:mockito/mockito.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/src/dummies.dart' as _i6; // ignore_for_file: type=lint @@ -30,9 +30,19 @@ import 'package:mockito/src/dummies.dart' as _i6; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeGlobalKey_0> - extends _i2.SmartFake implements _i1.GlobalKey { - _FakeGlobalKey_0( +class _FakeBuildContext_0 extends _i1.SmartFake implements _i2.BuildContext { + _FakeBuildContext_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeGlobalKey_1> + extends _i1.SmartFake implements _i2.GlobalKey { + _FakeGlobalKey_1( Object parent, Invocation parentInvocation, ) : super( @@ -44,9 +54,9 @@ class _FakeGlobalKey_0> /// A class which mocks [GlobalViewModel]. /// /// See the documentation for Mockito's code generation for more information. -class MockGlobalViewModel extends _i2.Mock implements _i3.GlobalViewModel { +class MockGlobalViewModel extends _i1.Mock implements _i3.GlobalViewModel { MockGlobalViewModel() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override @@ -56,10 +66,10 @@ class MockGlobalViewModel extends _i2.Mock implements _i3.GlobalViewModel { ) as List<_i4.Locale>); @override - _i1.ThemeMode get themeMode => (super.noSuchMethod( + _i2.ThemeMode get themeMode => (super.noSuchMethod( Invocation.getter(#themeMode), - returnValue: _i1.ThemeMode.system, - ) as _i1.ThemeMode); + returnValue: _i2.ThemeMode.system, + ) as _i2.ThemeMode); @override bool get showsTranslationKeys => (super.noSuchMethod( @@ -90,7 +100,7 @@ class MockGlobalViewModel extends _i2.Mock implements _i3.GlobalViewModel { ) as _i5.Future); @override - _i5.Future updateThemeMode(_i1.ThemeMode? themeMode) => + _i5.Future updateThemeMode(_i2.ThemeMode? themeMode) => (super.noSuchMethod( Invocation.method( #updateThemeMode, @@ -292,15 +302,15 @@ class MockGlobalViewModel extends _i2.Mock implements _i3.GlobalViewModel { /// A class which mocks [ErrorUtil]. /// /// See the documentation for Mockito's code generation for more information. -class MockErrorUtil extends _i2.Mock implements _i9.ErrorUtil { +class MockErrorUtil extends _i1.Mock implements _i9.ErrorUtil { MockErrorUtil() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override String? showError({ required dynamic error, - required _i1.BuildContext? context, + required _i2.BuildContext? context, }) => (super.noSuchMethod(Invocation.method( #showError, @@ -314,7 +324,7 @@ class MockErrorUtil extends _i2.Mock implements _i9.ErrorUtil { @override void showErrorWithLocaleKey({ required String? messageKey, - required _i1.BuildContext? context, + required _i2.BuildContext? context, String? titleKey, List? args, }) => @@ -336,19 +346,28 @@ class MockErrorUtil extends _i2.Mock implements _i9.ErrorUtil { /// A class which mocks [MainNavigator]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { +class MockMainNavigator extends _i1.Mock implements _i10.MainNavigator { MockMainNavigator() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override - _i1.GlobalKey<_i1.NavigatorState> get navigatorKey => (super.noSuchMethod( + _i2.BuildContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeBuildContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.BuildContext); + + @override + _i2.GlobalKey<_i2.NavigatorState> get navigatorKey => (super.noSuchMethod( Invocation.getter(#navigatorKey), - returnValue: _FakeGlobalKey_0<_i1.NavigatorState>( + returnValue: _FakeGlobalKey_1<_i2.NavigatorState>( this, Invocation.getter(#navigatorKey), ), - ) as _i1.GlobalKey<_i1.NavigatorState>); + ) as _i2.GlobalKey<_i2.NavigatorState>); @override _i5.Future goToDatabase(_i11.GeneratedDatabase? db) => @@ -410,14 +429,14 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ) as _i5.Future); @override - _i1.Route? onGenerateRoute(_i1.RouteSettings? settings) => + _i2.Route? onGenerateRoute(_i2.RouteSettings? settings) => (super.noSuchMethod(Invocation.method( #onGenerateRoute, [settings], - )) as _i1.Route?); + )) as _i2.Route?); @override - void goToHomeScreen({_i1.Key? key}) => super.noSuchMethod( + void goToHomeScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToHomeScreen, [], @@ -427,7 +446,7 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ); @override - void goToSplashScreen({_i1.Key? key}) => super.noSuchMethod( + void goToSplashScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToSplashScreen, [], @@ -437,7 +456,7 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ); @override - _i5.Future goToLicenseScreen({_i1.Key? key}) => (super.noSuchMethod( + _i5.Future goToLicenseScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( #goToLicenseScreen, [], @@ -448,10 +467,27 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ) as _i5.Future); @override - _i5.Future goToAnalyticsPermissionScreen({_i1.Key? key}) => + _i5.Future goToLogDetailScreen({ + required String? date, + _i2.Key? key, + }) => (super.noSuchMethod( Invocation.method( - #goToAnalyticsPermissionScreen, + #goToLogDetailScreen, + [], + { + #date: date, + #key: key, + }, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future goToTodoAddScreen({_i2.Key? key}) => (super.noSuchMethod( + Invocation.method( + #goToTodoAddScreen, [], {#key: key}, ), @@ -460,20 +496,21 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ) as _i5.Future); @override - void goToLoginScreen({_i1.Key? key}) => super.noSuchMethod( + _i5.Future goToLogsScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToLoginScreen, + #goToLogsScreen, [], {#key: key}, ), - returnValueForMissingStub: null, - ); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future goToThemeModeSelectorScreen({_i1.Key? key}) => + _i5.Future goToAnalyticsPermissionScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToThemeModeSelectorScreen, + #goToAnalyticsPermissionScreen, [], {#key: key}, ), @@ -482,10 +519,20 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ) as _i5.Future); @override - _i5.Future goToDebugPlatformSelectorScreen({_i1.Key? key}) => + void goToLoginScreen({_i2.Key? key}) => super.noSuchMethod( + Invocation.method( + #goToLoginScreen, + [], + {#key: key}, + ), + returnValueForMissingStub: null, + ); + + @override + _i5.Future goToThemeModeSelectorScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToDebugPlatformSelectorScreen, + #goToThemeModeSelectorScreen, [], {#key: key}, ), @@ -494,9 +541,10 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ) as _i5.Future); @override - _i5.Future goToDebugScreen({_i1.Key? key}) => (super.noSuchMethod( + _i5.Future goToDebugPlatformSelectorScreen({_i2.Key? key}) => + (super.noSuchMethod( Invocation.method( - #goToDebugScreen, + #goToDebugPlatformSelectorScreen, [], {#key: key}, ), @@ -505,9 +553,9 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ) as _i5.Future); @override - _i5.Future goToTodoAddScreen({_i1.Key? key}) => (super.noSuchMethod( + _i5.Future goToDebugScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToTodoAddScreen, + #goToDebugScreen, [], {#key: key}, ), @@ -535,7 +583,7 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ); @override - void popUntil(bool Function(_i1.Route)? predicate) => + void popUntil(bool Function(_i2.Route)? predicate) => super.noSuchMethod( Invocation.method( #popUntil, @@ -554,7 +602,7 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ); @override - _i5.Future showCustomDialog({_i1.Widget? widget}) => + _i5.Future showCustomDialog({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showCustomDialog, @@ -565,7 +613,7 @@ class MockMainNavigator extends _i2.Mock implements _i10.MainNavigator { ) as _i5.Future); @override - _i5.Future showBottomSheet({_i1.Widget? widget}) => + _i5.Future showBottomSheet({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showBottomSheet, diff --git a/test/viewmodel/debug/debug_platform_selector_viewmodel_test.mocks.dart b/test/viewmodel/debug/debug_platform_selector_viewmodel_test.mocks.dart index a97e98eb..cd900f9f 100644 --- a/test/viewmodel/debug/debug_platform_selector_viewmodel_test.mocks.dart +++ b/test/viewmodel/debug/debug_platform_selector_viewmodel_test.mocks.dart @@ -6,10 +6,10 @@ import 'dart:async' as _i4; import 'package:drift/drift.dart' as _i5; -import 'package:flutter/material.dart' as _i1; +import 'package:flutter/material.dart' as _i2; import 'package:flutter_template/model/snackbar/snackbar_data.dart' as _i6; import 'package:flutter_template/navigator/main_navigator.dart' as _i3; -import 'package:mockito/mockito.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -24,9 +24,19 @@ import 'package:mockito/mockito.dart' as _i2; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeGlobalKey_0> - extends _i2.SmartFake implements _i1.GlobalKey { - _FakeGlobalKey_0( +class _FakeBuildContext_0 extends _i1.SmartFake implements _i2.BuildContext { + _FakeBuildContext_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeGlobalKey_1> + extends _i1.SmartFake implements _i2.GlobalKey { + _FakeGlobalKey_1( Object parent, Invocation parentInvocation, ) : super( @@ -38,19 +48,28 @@ class _FakeGlobalKey_0> /// A class which mocks [MainNavigator]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { +class MockMainNavigator extends _i1.Mock implements _i3.MainNavigator { MockMainNavigator() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override - _i1.GlobalKey<_i1.NavigatorState> get navigatorKey => (super.noSuchMethod( + _i2.BuildContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeBuildContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.BuildContext); + + @override + _i2.GlobalKey<_i2.NavigatorState> get navigatorKey => (super.noSuchMethod( Invocation.getter(#navigatorKey), - returnValue: _FakeGlobalKey_0<_i1.NavigatorState>( + returnValue: _FakeGlobalKey_1<_i2.NavigatorState>( this, Invocation.getter(#navigatorKey), ), - ) as _i1.GlobalKey<_i1.NavigatorState>); + ) as _i2.GlobalKey<_i2.NavigatorState>); @override _i4.Future goToDatabase(_i5.GeneratedDatabase? db) => @@ -112,14 +131,14 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i1.Route? onGenerateRoute(_i1.RouteSettings? settings) => + _i2.Route? onGenerateRoute(_i2.RouteSettings? settings) => (super.noSuchMethod(Invocation.method( #onGenerateRoute, [settings], - )) as _i1.Route?); + )) as _i2.Route?); @override - void goToHomeScreen({_i1.Key? key}) => super.noSuchMethod( + void goToHomeScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToHomeScreen, [], @@ -129,7 +148,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ); @override - void goToSplashScreen({_i1.Key? key}) => super.noSuchMethod( + void goToSplashScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToSplashScreen, [], @@ -139,7 +158,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ); @override - _i4.Future goToLicenseScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToLicenseScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( #goToLicenseScreen, [], @@ -150,10 +169,27 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future goToAnalyticsPermissionScreen({_i1.Key? key}) => + _i4.Future goToLogDetailScreen({ + required String? date, + _i2.Key? key, + }) => (super.noSuchMethod( Invocation.method( - #goToAnalyticsPermissionScreen, + #goToLogDetailScreen, + [], + { + #date: date, + #key: key, + }, + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future goToTodoAddScreen({_i2.Key? key}) => (super.noSuchMethod( + Invocation.method( + #goToTodoAddScreen, [], {#key: key}, ), @@ -162,20 +198,21 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - void goToLoginScreen({_i1.Key? key}) => super.noSuchMethod( + _i4.Future goToLogsScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToLoginScreen, + #goToLogsScreen, [], {#key: key}, ), - returnValueForMissingStub: null, - ); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future goToThemeModeSelectorScreen({_i1.Key? key}) => + _i4.Future goToAnalyticsPermissionScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToThemeModeSelectorScreen, + #goToAnalyticsPermissionScreen, [], {#key: key}, ), @@ -184,10 +221,20 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugPlatformSelectorScreen({_i1.Key? key}) => + void goToLoginScreen({_i2.Key? key}) => super.noSuchMethod( + Invocation.method( + #goToLoginScreen, + [], + {#key: key}, + ), + returnValueForMissingStub: null, + ); + + @override + _i4.Future goToThemeModeSelectorScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToDebugPlatformSelectorScreen, + #goToThemeModeSelectorScreen, [], {#key: key}, ), @@ -196,9 +243,10 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugPlatformSelectorScreen({_i2.Key? key}) => + (super.noSuchMethod( Invocation.method( - #goToDebugScreen, + #goToDebugPlatformSelectorScreen, [], {#key: key}, ), @@ -207,9 +255,9 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future goToTodoAddScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToTodoAddScreen, + #goToDebugScreen, [], {#key: key}, ), @@ -237,7 +285,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ); @override - void popUntil(bool Function(_i1.Route)? predicate) => + void popUntil(bool Function(_i2.Route)? predicate) => super.noSuchMethod( Invocation.method( #popUntil, @@ -256,7 +304,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ); @override - _i4.Future showCustomDialog({_i1.Widget? widget}) => + _i4.Future showCustomDialog({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showCustomDialog, @@ -267,7 +315,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future showBottomSheet({_i1.Widget? widget}) => + _i4.Future showBottomSheet({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showBottomSheet, diff --git a/test/viewmodel/debug/debug_viewmodel_test.mocks.dart b/test/viewmodel/debug/debug_viewmodel_test.mocks.dart index 323d68e6..ecd068eb 100644 --- a/test/viewmodel/debug/debug_viewmodel_test.mocks.dart +++ b/test/viewmodel/debug/debug_viewmodel_test.mocks.dart @@ -7,7 +7,7 @@ import 'dart:async' as _i6; import 'package:drift/drift.dart' as _i4; import 'package:drift/src/runtime/executor/stream_queries.dart' as _i5; -import 'package:flutter/material.dart' as _i1; +import 'package:flutter/material.dart' as _i2; import 'package:flutter_template/database/flutter_template_database.dart' as _i3; import 'package:flutter_template/model/snackbar/snackbar_data.dart' as _i8; @@ -15,7 +15,7 @@ import 'package:flutter_template/navigator/main_navigator.dart' as _i7; import 'package:flutter_template/repository/debug/debug_repository.dart' as _i9; import 'package:flutter_template/repository/shared_prefs/local/local_storage.dart' as _i10; -import 'package:mockito/mockito.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/src/dummies.dart' as _i11; // ignore_for_file: type=lint @@ -31,9 +31,8 @@ import 'package:mockito/src/dummies.dart' as _i11; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeGlobalKey_0> - extends _i2.SmartFake implements _i1.GlobalKey { - _FakeGlobalKey_0( +class _FakeBuildContext_0 extends _i1.SmartFake implements _i2.BuildContext { + _FakeBuildContext_0( Object parent, Invocation parentInvocation, ) : super( @@ -42,9 +41,20 @@ class _FakeGlobalKey_0> ); } -class _Fake$DbTodoTableTable_1 extends _i2.SmartFake +class _FakeGlobalKey_1> + extends _i1.SmartFake implements _i2.GlobalKey { + _FakeGlobalKey_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _Fake$DbTodoTableTable_2 extends _i1.SmartFake implements _i3.$DbTodoTableTable { - _Fake$DbTodoTableTable_1( + _Fake$DbTodoTableTable_2( Object parent, Invocation parentInvocation, ) : super( @@ -53,9 +63,9 @@ class _Fake$DbTodoTableTable_1 extends _i2.SmartFake ); } -class _FakeGeneratedDatabase_2 extends _i2.SmartFake +class _FakeGeneratedDatabase_3 extends _i1.SmartFake implements _i4.GeneratedDatabase { - _FakeGeneratedDatabase_2( + _FakeGeneratedDatabase_3( Object parent, Invocation parentInvocation, ) : super( @@ -64,9 +74,9 @@ class _FakeGeneratedDatabase_2 extends _i2.SmartFake ); } -class _FakeDriftDatabaseOptions_3 extends _i2.SmartFake +class _FakeDriftDatabaseOptions_4 extends _i1.SmartFake implements _i4.DriftDatabaseOptions { - _FakeDriftDatabaseOptions_3( + _FakeDriftDatabaseOptions_4( Object parent, Invocation parentInvocation, ) : super( @@ -75,9 +85,9 @@ class _FakeDriftDatabaseOptions_3 extends _i2.SmartFake ); } -class _FakeMigrationStrategy_4 extends _i2.SmartFake +class _FakeMigrationStrategy_5 extends _i1.SmartFake implements _i4.MigrationStrategy { - _FakeMigrationStrategy_4( + _FakeMigrationStrategy_5( Object parent, Invocation parentInvocation, ) : super( @@ -86,9 +96,9 @@ class _FakeMigrationStrategy_4 extends _i2.SmartFake ); } -class _FakeStreamQueryUpdateRules_5 extends _i2.SmartFake +class _FakeStreamQueryUpdateRules_6 extends _i1.SmartFake implements _i4.StreamQueryUpdateRules { - _FakeStreamQueryUpdateRules_5( + _FakeStreamQueryUpdateRules_6( Object parent, Invocation parentInvocation, ) : super( @@ -97,9 +107,9 @@ class _FakeStreamQueryUpdateRules_5 extends _i2.SmartFake ); } -class _FakeDatabaseConnection_6 extends _i2.SmartFake +class _FakeDatabaseConnection_7 extends _i1.SmartFake implements _i4.DatabaseConnection { - _FakeDatabaseConnection_6( + _FakeDatabaseConnection_7( Object parent, Invocation parentInvocation, ) : super( @@ -108,8 +118,8 @@ class _FakeDatabaseConnection_6 extends _i2.SmartFake ); } -class _FakeQueryExecutor_7 extends _i2.SmartFake implements _i4.QueryExecutor { - _FakeQueryExecutor_7( +class _FakeQueryExecutor_8 extends _i1.SmartFake implements _i4.QueryExecutor { + _FakeQueryExecutor_8( Object parent, Invocation parentInvocation, ) : super( @@ -118,9 +128,9 @@ class _FakeQueryExecutor_7 extends _i2.SmartFake implements _i4.QueryExecutor { ); } -class _FakeStreamQueryStore_8 extends _i2.SmartFake +class _FakeStreamQueryStore_9 extends _i1.SmartFake implements _i5.StreamQueryStore { - _FakeStreamQueryStore_8( + _FakeStreamQueryStore_9( Object parent, Invocation parentInvocation, ) : super( @@ -129,9 +139,9 @@ class _FakeStreamQueryStore_8 extends _i2.SmartFake ); } -class _FakeDatabaseConnectionUser_9 extends _i2.SmartFake +class _FakeDatabaseConnectionUser_10 extends _i1.SmartFake implements _i4.DatabaseConnectionUser { - _FakeDatabaseConnectionUser_9( + _FakeDatabaseConnectionUser_10( Object parent, Invocation parentInvocation, ) : super( @@ -140,8 +150,8 @@ class _FakeDatabaseConnectionUser_9 extends _i2.SmartFake ); } -class _FakeMigrator_10 extends _i2.SmartFake implements _i4.Migrator { - _FakeMigrator_10( +class _FakeMigrator_11 extends _i1.SmartFake implements _i4.Migrator { + _FakeMigrator_11( Object parent, Invocation parentInvocation, ) : super( @@ -150,8 +160,8 @@ class _FakeMigrator_10 extends _i2.SmartFake implements _i4.Migrator { ); } -class _FakeFuture_11 extends _i2.SmartFake implements _i6.Future { - _FakeFuture_11( +class _FakeFuture_12 extends _i1.SmartFake implements _i6.Future { + _FakeFuture_12( Object parent, Invocation parentInvocation, ) : super( @@ -160,9 +170,9 @@ class _FakeFuture_11 extends _i2.SmartFake implements _i6.Future { ); } -class _FakeInsertStatement_12 extends _i2.SmartFake +class _FakeInsertStatement_13 extends _i1.SmartFake implements _i4.InsertStatement { - _FakeInsertStatement_12( + _FakeInsertStatement_13( Object parent, Invocation parentInvocation, ) : super( @@ -171,9 +181,9 @@ class _FakeInsertStatement_12 extends _i2.SmartFake ); } -class _FakeUpdateStatement_13 extends _i2.SmartFake +class _FakeUpdateStatement_14 extends _i1.SmartFake implements _i4.UpdateStatement { - _FakeUpdateStatement_13( + _FakeUpdateStatement_14( Object parent, Invocation parentInvocation, ) : super( @@ -182,9 +192,9 @@ class _FakeUpdateStatement_13 extends _i2.SmartFake ); } -class _FakeSimpleSelectStatement_14 - extends _i2.SmartFake implements _i4.SimpleSelectStatement { - _FakeSimpleSelectStatement_14( +class _FakeSimpleSelectStatement_15 + extends _i1.SmartFake implements _i4.SimpleSelectStatement { + _FakeSimpleSelectStatement_15( Object parent, Invocation parentInvocation, ) : super( @@ -193,9 +203,9 @@ class _FakeSimpleSelectStatement_14 ); } -class _FakeJoinedSelectStatement_15 - extends _i2.SmartFake implements _i4.JoinedSelectStatement { - _FakeJoinedSelectStatement_15( +class _FakeJoinedSelectStatement_16 + extends _i1.SmartFake implements _i4.JoinedSelectStatement { + _FakeJoinedSelectStatement_16( Object parent, Invocation parentInvocation, ) : super( @@ -204,9 +214,9 @@ class _FakeJoinedSelectStatement_15 ); } -class _FakeDeleteStatement_16 extends _i2.SmartFake +class _FakeDeleteStatement_17 extends _i1.SmartFake implements _i4.DeleteStatement { - _FakeDeleteStatement_16( + _FakeDeleteStatement_17( Object parent, Invocation parentInvocation, ) : super( @@ -215,8 +225,8 @@ class _FakeDeleteStatement_16 extends _i2.SmartFake ); } -class _FakeSelectable_17 extends _i2.SmartFake implements _i4.Selectable { - _FakeSelectable_17( +class _FakeSelectable_18 extends _i1.SmartFake implements _i4.Selectable { + _FakeSelectable_18( Object parent, Invocation parentInvocation, ) : super( @@ -225,9 +235,9 @@ class _FakeSelectable_17 extends _i2.SmartFake implements _i4.Selectable { ); } -class _FakeGenerationContext_18 extends _i2.SmartFake +class _FakeGenerationContext_19 extends _i1.SmartFake implements _i4.GenerationContext { - _FakeGenerationContext_18( + _FakeGenerationContext_19( Object parent, Invocation parentInvocation, ) : super( @@ -239,19 +249,28 @@ class _FakeGenerationContext_18 extends _i2.SmartFake /// A class which mocks [MainNavigator]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { +class MockMainNavigator extends _i1.Mock implements _i7.MainNavigator { MockMainNavigator() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override - _i1.GlobalKey<_i1.NavigatorState> get navigatorKey => (super.noSuchMethod( + _i2.BuildContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeBuildContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.BuildContext); + + @override + _i2.GlobalKey<_i2.NavigatorState> get navigatorKey => (super.noSuchMethod( Invocation.getter(#navigatorKey), - returnValue: _FakeGlobalKey_0<_i1.NavigatorState>( + returnValue: _FakeGlobalKey_1<_i2.NavigatorState>( this, Invocation.getter(#navigatorKey), ), - ) as _i1.GlobalKey<_i1.NavigatorState>); + ) as _i2.GlobalKey<_i2.NavigatorState>); @override _i6.Future goToDatabase(_i4.GeneratedDatabase? db) => @@ -313,14 +332,14 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ) as _i6.Future); @override - _i1.Route? onGenerateRoute(_i1.RouteSettings? settings) => + _i2.Route? onGenerateRoute(_i2.RouteSettings? settings) => (super.noSuchMethod(Invocation.method( #onGenerateRoute, [settings], - )) as _i1.Route?); + )) as _i2.Route?); @override - void goToHomeScreen({_i1.Key? key}) => super.noSuchMethod( + void goToHomeScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToHomeScreen, [], @@ -330,7 +349,7 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ); @override - void goToSplashScreen({_i1.Key? key}) => super.noSuchMethod( + void goToSplashScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToSplashScreen, [], @@ -340,7 +359,7 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ); @override - _i6.Future goToLicenseScreen({_i1.Key? key}) => (super.noSuchMethod( + _i6.Future goToLicenseScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( #goToLicenseScreen, [], @@ -351,10 +370,27 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ) as _i6.Future); @override - _i6.Future goToAnalyticsPermissionScreen({_i1.Key? key}) => + _i6.Future goToLogDetailScreen({ + required String? date, + _i2.Key? key, + }) => (super.noSuchMethod( Invocation.method( - #goToAnalyticsPermissionScreen, + #goToLogDetailScreen, + [], + { + #date: date, + #key: key, + }, + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future goToTodoAddScreen({_i2.Key? key}) => (super.noSuchMethod( + Invocation.method( + #goToTodoAddScreen, [], {#key: key}, ), @@ -363,20 +399,21 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ) as _i6.Future); @override - void goToLoginScreen({_i1.Key? key}) => super.noSuchMethod( + _i6.Future goToLogsScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToLoginScreen, + #goToLogsScreen, [], {#key: key}, ), - returnValueForMissingStub: null, - ); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i6.Future goToThemeModeSelectorScreen({_i1.Key? key}) => + _i6.Future goToAnalyticsPermissionScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToThemeModeSelectorScreen, + #goToAnalyticsPermissionScreen, [], {#key: key}, ), @@ -385,10 +422,20 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ) as _i6.Future); @override - _i6.Future goToDebugPlatformSelectorScreen({_i1.Key? key}) => + void goToLoginScreen({_i2.Key? key}) => super.noSuchMethod( + Invocation.method( + #goToLoginScreen, + [], + {#key: key}, + ), + returnValueForMissingStub: null, + ); + + @override + _i6.Future goToThemeModeSelectorScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToDebugPlatformSelectorScreen, + #goToThemeModeSelectorScreen, [], {#key: key}, ), @@ -397,9 +444,10 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ) as _i6.Future); @override - _i6.Future goToDebugScreen({_i1.Key? key}) => (super.noSuchMethod( + _i6.Future goToDebugPlatformSelectorScreen({_i2.Key? key}) => + (super.noSuchMethod( Invocation.method( - #goToDebugScreen, + #goToDebugPlatformSelectorScreen, [], {#key: key}, ), @@ -408,9 +456,9 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ) as _i6.Future); @override - _i6.Future goToTodoAddScreen({_i1.Key? key}) => (super.noSuchMethod( + _i6.Future goToDebugScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToTodoAddScreen, + #goToDebugScreen, [], {#key: key}, ), @@ -438,7 +486,7 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ); @override - void popUntil(bool Function(_i1.Route)? predicate) => + void popUntil(bool Function(_i2.Route)? predicate) => super.noSuchMethod( Invocation.method( #popUntil, @@ -457,7 +505,7 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ); @override - _i6.Future showCustomDialog({_i1.Widget? widget}) => + _i6.Future showCustomDialog({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showCustomDialog, @@ -468,7 +516,7 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { ) as _i6.Future); @override - _i6.Future showBottomSheet({_i1.Widget? widget}) => + _i6.Future showBottomSheet({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showBottomSheet, @@ -482,9 +530,9 @@ class MockMainNavigator extends _i2.Mock implements _i7.MainNavigator { /// A class which mocks [DebugRepository]. /// /// See the documentation for Mockito's code generation for more information. -class MockDebugRepository extends _i2.Mock implements _i9.DebugRepository { +class MockDebugRepository extends _i1.Mock implements _i9.DebugRepository { MockDebugRepository() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override @@ -523,9 +571,9 @@ class MockDebugRepository extends _i2.Mock implements _i9.DebugRepository { /// A class which mocks [LocalStorage]. /// /// See the documentation for Mockito's code generation for more information. -class MockLocalStorage extends _i2.Mock implements _i10.LocalStorage { +class MockLocalStorage extends _i1.Mock implements _i10.LocalStorage { MockLocalStorage() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override @@ -539,7 +587,7 @@ class MockLocalStorage extends _i2.Mock implements _i10.LocalStorage { ) as _i6.Future); @override - _i6.Future updateThemeMode(_i1.ThemeMode? themeMode) => + _i6.Future updateThemeMode(_i2.ThemeMode? themeMode) => (super.noSuchMethod( Invocation.method( #updateThemeMode, @@ -564,10 +612,10 @@ class MockLocalStorage extends _i2.Mock implements _i10.LocalStorage { /// A class which mocks [FlutterTemplateDatabase]. /// /// See the documentation for Mockito's code generation for more information. -class MockFlutterTemplateDatabase extends _i2.Mock +class MockFlutterTemplateDatabase extends _i1.Mock implements _i3.FlutterTemplateDatabase { MockFlutterTemplateDatabase() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override @@ -579,7 +627,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock @override _i3.$DbTodoTableTable get dbTodoTable => (super.noSuchMethod( Invocation.getter(#dbTodoTable), - returnValue: _Fake$DbTodoTableTable_1( + returnValue: _Fake$DbTodoTableTable_2( this, Invocation.getter(#dbTodoTable), ), @@ -605,7 +653,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock @override _i4.GeneratedDatabase get attachedDatabase => (super.noSuchMethod( Invocation.getter(#attachedDatabase), - returnValue: _FakeGeneratedDatabase_2( + returnValue: _FakeGeneratedDatabase_3( this, Invocation.getter(#attachedDatabase), ), @@ -614,7 +662,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock @override _i4.DriftDatabaseOptions get options => (super.noSuchMethod( Invocation.getter(#options), - returnValue: _FakeDriftDatabaseOptions_3( + returnValue: _FakeDriftDatabaseOptions_4( this, Invocation.getter(#options), ), @@ -623,7 +671,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock @override _i4.MigrationStrategy get migration => (super.noSuchMethod( Invocation.getter(#migration), - returnValue: _FakeMigrationStrategy_4( + returnValue: _FakeMigrationStrategy_5( this, Invocation.getter(#migration), ), @@ -632,7 +680,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock @override _i4.StreamQueryUpdateRules get streamUpdateRules => (super.noSuchMethod( Invocation.getter(#streamUpdateRules), - returnValue: _FakeStreamQueryUpdateRules_5( + returnValue: _FakeStreamQueryUpdateRules_6( this, Invocation.getter(#streamUpdateRules), ), @@ -641,7 +689,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock @override _i4.DatabaseConnection get connection => (super.noSuchMethod( Invocation.getter(#connection), - returnValue: _FakeDatabaseConnection_6( + returnValue: _FakeDatabaseConnection_7( this, Invocation.getter(#connection), ), @@ -659,7 +707,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock @override _i4.QueryExecutor get executor => (super.noSuchMethod( Invocation.getter(#executor), - returnValue: _FakeQueryExecutor_7( + returnValue: _FakeQueryExecutor_8( this, Invocation.getter(#executor), ), @@ -668,7 +716,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock @override _i5.StreamQueryStore get streamQueries => (super.noSuchMethod( Invocation.getter(#streamQueries), - returnValue: _FakeStreamQueryStore_8( + returnValue: _FakeStreamQueryStore_9( this, Invocation.getter(#streamQueries), ), @@ -677,7 +725,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock @override _i4.DatabaseConnectionUser get resolvedEngine => (super.noSuchMethod( Invocation.getter(#resolvedEngine), - returnValue: _FakeDatabaseConnectionUser_9( + returnValue: _FakeDatabaseConnectionUser_10( this, Invocation.getter(#resolvedEngine), ), @@ -699,7 +747,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock #createMigrator, [], ), - returnValue: _FakeMigrator_10( + returnValue: _FakeMigrator_11( this, Invocation.method( #createMigrator, @@ -819,7 +867,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock ), (T v) => _i6.Future.value(v), ) ?? - _FakeFuture_11( + _FakeFuture_12( this, Invocation.method( #doWhenOpened, @@ -836,7 +884,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock #into, [table], ), - returnValue: _FakeInsertStatement_12( + returnValue: _FakeInsertStatement_13( this, Invocation.method( #into, @@ -853,7 +901,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock #update, [table], ), - returnValue: _FakeUpdateStatement_13( + returnValue: _FakeUpdateStatement_14( this, Invocation.method( #update, @@ -873,7 +921,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock [table], {#distinct: distinct}, ), - returnValue: _FakeSimpleSelectStatement_14( + returnValue: _FakeSimpleSelectStatement_15( this, Invocation.method( #select, @@ -894,7 +942,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock [table], {#distinct: distinct}, ), - returnValue: _FakeJoinedSelectStatement_15( + returnValue: _FakeJoinedSelectStatement_16( this, Invocation.method( #selectOnly, @@ -912,7 +960,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock #delete, [table], ), - returnValue: _FakeDeleteStatement_16( + returnValue: _FakeDeleteStatement_17( this, Invocation.method( #delete, @@ -994,7 +1042,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock #readsFrom: readsFrom, }, ), - returnValue: _FakeSelectable_17<_i4.QueryRow>( + returnValue: _FakeSelectable_18<_i4.QueryRow>( this, Invocation.method( #customSelect, @@ -1022,7 +1070,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock #readsFrom: readsFrom, }, ), - returnValue: _FakeSelectable_17<_i4.QueryRow>( + returnValue: _FakeSelectable_18<_i4.QueryRow>( this, Invocation.method( #customSelectQuery, @@ -1074,7 +1122,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock ), (T v) => _i6.Future.value(v), ) ?? - _FakeFuture_11( + _FakeFuture_12( this, Invocation.method( #transaction, @@ -1110,7 +1158,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock #startIndex: startIndex, }, ), - returnValue: _FakeGenerationContext_18( + returnValue: _FakeGenerationContext_19( this, Invocation.method( #$write, @@ -1138,7 +1186,7 @@ class MockFlutterTemplateDatabase extends _i2.Mock ], {#startIndex: startIndex}, ), - returnValue: _FakeGenerationContext_18( + returnValue: _FakeGenerationContext_19( this, Invocation.method( #$writeInsertable, diff --git a/test/viewmodel/license/license_viewmodel_test.mocks.dart b/test/viewmodel/license/license_viewmodel_test.mocks.dart index 2ab90be7..1aef81c2 100644 --- a/test/viewmodel/license/license_viewmodel_test.mocks.dart +++ b/test/viewmodel/license/license_viewmodel_test.mocks.dart @@ -6,10 +6,10 @@ import 'dart:async' as _i4; import 'package:drift/drift.dart' as _i5; -import 'package:flutter/material.dart' as _i1; +import 'package:flutter/material.dart' as _i2; import 'package:flutter_template/model/snackbar/snackbar_data.dart' as _i6; import 'package:flutter_template/navigator/main_navigator.dart' as _i3; -import 'package:mockito/mockito.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -24,9 +24,19 @@ import 'package:mockito/mockito.dart' as _i2; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeGlobalKey_0> - extends _i2.SmartFake implements _i1.GlobalKey { - _FakeGlobalKey_0( +class _FakeBuildContext_0 extends _i1.SmartFake implements _i2.BuildContext { + _FakeBuildContext_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeGlobalKey_1> + extends _i1.SmartFake implements _i2.GlobalKey { + _FakeGlobalKey_1( Object parent, Invocation parentInvocation, ) : super( @@ -38,19 +48,28 @@ class _FakeGlobalKey_0> /// A class which mocks [MainNavigator]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { +class MockMainNavigator extends _i1.Mock implements _i3.MainNavigator { MockMainNavigator() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override - _i1.GlobalKey<_i1.NavigatorState> get navigatorKey => (super.noSuchMethod( + _i2.BuildContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeBuildContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.BuildContext); + + @override + _i2.GlobalKey<_i2.NavigatorState> get navigatorKey => (super.noSuchMethod( Invocation.getter(#navigatorKey), - returnValue: _FakeGlobalKey_0<_i1.NavigatorState>( + returnValue: _FakeGlobalKey_1<_i2.NavigatorState>( this, Invocation.getter(#navigatorKey), ), - ) as _i1.GlobalKey<_i1.NavigatorState>); + ) as _i2.GlobalKey<_i2.NavigatorState>); @override _i4.Future goToDatabase(_i5.GeneratedDatabase? db) => @@ -112,14 +131,14 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i1.Route? onGenerateRoute(_i1.RouteSettings? settings) => + _i2.Route? onGenerateRoute(_i2.RouteSettings? settings) => (super.noSuchMethod(Invocation.method( #onGenerateRoute, [settings], - )) as _i1.Route?); + )) as _i2.Route?); @override - void goToHomeScreen({_i1.Key? key}) => super.noSuchMethod( + void goToHomeScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToHomeScreen, [], @@ -129,7 +148,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ); @override - void goToSplashScreen({_i1.Key? key}) => super.noSuchMethod( + void goToSplashScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToSplashScreen, [], @@ -139,7 +158,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ); @override - _i4.Future goToLicenseScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToLicenseScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( #goToLicenseScreen, [], @@ -150,10 +169,27 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future goToAnalyticsPermissionScreen({_i1.Key? key}) => + _i4.Future goToLogDetailScreen({ + required String? date, + _i2.Key? key, + }) => (super.noSuchMethod( Invocation.method( - #goToAnalyticsPermissionScreen, + #goToLogDetailScreen, + [], + { + #date: date, + #key: key, + }, + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future goToTodoAddScreen({_i2.Key? key}) => (super.noSuchMethod( + Invocation.method( + #goToTodoAddScreen, [], {#key: key}, ), @@ -162,20 +198,21 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - void goToLoginScreen({_i1.Key? key}) => super.noSuchMethod( + _i4.Future goToLogsScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToLoginScreen, + #goToLogsScreen, [], {#key: key}, ), - returnValueForMissingStub: null, - ); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future goToThemeModeSelectorScreen({_i1.Key? key}) => + _i4.Future goToAnalyticsPermissionScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToThemeModeSelectorScreen, + #goToAnalyticsPermissionScreen, [], {#key: key}, ), @@ -184,10 +221,20 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugPlatformSelectorScreen({_i1.Key? key}) => + void goToLoginScreen({_i2.Key? key}) => super.noSuchMethod( + Invocation.method( + #goToLoginScreen, + [], + {#key: key}, + ), + returnValueForMissingStub: null, + ); + + @override + _i4.Future goToThemeModeSelectorScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToDebugPlatformSelectorScreen, + #goToThemeModeSelectorScreen, [], {#key: key}, ), @@ -196,9 +243,10 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugPlatformSelectorScreen({_i2.Key? key}) => + (super.noSuchMethod( Invocation.method( - #goToDebugScreen, + #goToDebugPlatformSelectorScreen, [], {#key: key}, ), @@ -207,9 +255,9 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future goToTodoAddScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToTodoAddScreen, + #goToDebugScreen, [], {#key: key}, ), @@ -237,7 +285,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ); @override - void popUntil(bool Function(_i1.Route)? predicate) => + void popUntil(bool Function(_i2.Route)? predicate) => super.noSuchMethod( Invocation.method( #popUntil, @@ -256,7 +304,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ); @override - _i4.Future showCustomDialog({_i1.Widget? widget}) => + _i4.Future showCustomDialog({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showCustomDialog, @@ -267,7 +315,7 @@ class MockMainNavigator extends _i2.Mock implements _i3.MainNavigator { ) as _i4.Future); @override - _i4.Future showBottomSheet({_i1.Widget? widget}) => + _i4.Future showBottomSheet({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showBottomSheet, diff --git a/test/viewmodel/login/login_viewmodel_test.mocks.dart b/test/viewmodel/login/login_viewmodel_test.mocks.dart index dfce6adb..aa3ddd62 100644 --- a/test/viewmodel/login/login_viewmodel_test.mocks.dart +++ b/test/viewmodel/login/login_viewmodel_test.mocks.dart @@ -6,12 +6,12 @@ import 'dart:async' as _i4; import 'package:drift/drift.dart' as _i6; -import 'package:flutter/material.dart' as _i1; +import 'package:flutter/material.dart' as _i2; import 'package:flutter_template/model/snackbar/snackbar_data.dart' as _i7; import 'package:flutter_template/navigator/main_navigator.dart' as _i5; import 'package:flutter_template/navigator/onboarding_navigator.dart' as _i8; import 'package:flutter_template/repository/login/login_repository.dart' as _i3; -import 'package:mockito/mockito.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -26,9 +26,19 @@ import 'package:mockito/mockito.dart' as _i2; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeGlobalKey_0> - extends _i2.SmartFake implements _i1.GlobalKey { - _FakeGlobalKey_0( +class _FakeBuildContext_0 extends _i1.SmartFake implements _i2.BuildContext { + _FakeBuildContext_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeGlobalKey_1> + extends _i1.SmartFake implements _i2.GlobalKey { + _FakeGlobalKey_1( Object parent, Invocation parentInvocation, ) : super( @@ -40,9 +50,9 @@ class _FakeGlobalKey_0> /// A class which mocks [LoginRepository]. /// /// See the documentation for Mockito's code generation for more information. -class MockLoginRepository extends _i2.Mock implements _i3.LoginRepository { +class MockLoginRepository extends _i1.Mock implements _i3.LoginRepository { MockLoginRepository() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override @@ -79,19 +89,28 @@ class MockLoginRepository extends _i2.Mock implements _i3.LoginRepository { /// A class which mocks [MainNavigator]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { +class MockMainNavigator extends _i1.Mock implements _i5.MainNavigator { MockMainNavigator() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override - _i1.GlobalKey<_i1.NavigatorState> get navigatorKey => (super.noSuchMethod( + _i2.BuildContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeBuildContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.BuildContext); + + @override + _i2.GlobalKey<_i2.NavigatorState> get navigatorKey => (super.noSuchMethod( Invocation.getter(#navigatorKey), - returnValue: _FakeGlobalKey_0<_i1.NavigatorState>( + returnValue: _FakeGlobalKey_1<_i2.NavigatorState>( this, Invocation.getter(#navigatorKey), ), - ) as _i1.GlobalKey<_i1.NavigatorState>); + ) as _i2.GlobalKey<_i2.NavigatorState>); @override _i4.Future goToDatabase(_i6.GeneratedDatabase? db) => @@ -153,14 +172,14 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ) as _i4.Future); @override - _i1.Route? onGenerateRoute(_i1.RouteSettings? settings) => + _i2.Route? onGenerateRoute(_i2.RouteSettings? settings) => (super.noSuchMethod(Invocation.method( #onGenerateRoute, [settings], - )) as _i1.Route?); + )) as _i2.Route?); @override - void goToHomeScreen({_i1.Key? key}) => super.noSuchMethod( + void goToHomeScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToHomeScreen, [], @@ -170,7 +189,7 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ); @override - void goToSplashScreen({_i1.Key? key}) => super.noSuchMethod( + void goToSplashScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToSplashScreen, [], @@ -180,7 +199,7 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ); @override - _i4.Future goToLicenseScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToLicenseScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( #goToLicenseScreen, [], @@ -191,10 +210,27 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ) as _i4.Future); @override - _i4.Future goToAnalyticsPermissionScreen({_i1.Key? key}) => + _i4.Future goToLogDetailScreen({ + required String? date, + _i2.Key? key, + }) => (super.noSuchMethod( Invocation.method( - #goToAnalyticsPermissionScreen, + #goToLogDetailScreen, + [], + { + #date: date, + #key: key, + }, + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future goToTodoAddScreen({_i2.Key? key}) => (super.noSuchMethod( + Invocation.method( + #goToTodoAddScreen, [], {#key: key}, ), @@ -203,20 +239,21 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ) as _i4.Future); @override - void goToLoginScreen({_i1.Key? key}) => super.noSuchMethod( + _i4.Future goToLogsScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToLoginScreen, + #goToLogsScreen, [], {#key: key}, ), - returnValueForMissingStub: null, - ); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future goToThemeModeSelectorScreen({_i1.Key? key}) => + _i4.Future goToAnalyticsPermissionScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToThemeModeSelectorScreen, + #goToAnalyticsPermissionScreen, [], {#key: key}, ), @@ -225,10 +262,20 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugPlatformSelectorScreen({_i1.Key? key}) => + void goToLoginScreen({_i2.Key? key}) => super.noSuchMethod( + Invocation.method( + #goToLoginScreen, + [], + {#key: key}, + ), + returnValueForMissingStub: null, + ); + + @override + _i4.Future goToThemeModeSelectorScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToDebugPlatformSelectorScreen, + #goToThemeModeSelectorScreen, [], {#key: key}, ), @@ -237,9 +284,10 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugPlatformSelectorScreen({_i2.Key? key}) => + (super.noSuchMethod( Invocation.method( - #goToDebugScreen, + #goToDebugPlatformSelectorScreen, [], {#key: key}, ), @@ -248,9 +296,9 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ) as _i4.Future); @override - _i4.Future goToTodoAddScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToTodoAddScreen, + #goToDebugScreen, [], {#key: key}, ), @@ -278,7 +326,7 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ); @override - void popUntil(bool Function(_i1.Route)? predicate) => + void popUntil(bool Function(_i2.Route)? predicate) => super.noSuchMethod( Invocation.method( #popUntil, @@ -297,7 +345,7 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ); @override - _i4.Future showCustomDialog({_i1.Widget? widget}) => + _i4.Future showCustomDialog({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showCustomDialog, @@ -308,7 +356,7 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { ) as _i4.Future); @override - _i4.Future showBottomSheet({_i1.Widget? widget}) => + _i4.Future showBottomSheet({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showBottomSheet, @@ -322,10 +370,10 @@ class MockMainNavigator extends _i2.Mock implements _i5.MainNavigator { /// A class which mocks [OnboardingNavigator]. /// /// See the documentation for Mockito's code generation for more information. -class MockOnboardingNavigator extends _i2.Mock +class MockOnboardingNavigator extends _i1.Mock implements _i8.OnboardingNavigator { MockOnboardingNavigator() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override diff --git a/test/viewmodel/theme_selector/theme_selector_viewmodel_test.mocks.dart b/test/viewmodel/theme_selector/theme_selector_viewmodel_test.mocks.dart index 79995e93..f6d9506c 100644 --- a/test/viewmodel/theme_selector/theme_selector_viewmodel_test.mocks.dart +++ b/test/viewmodel/theme_selector/theme_selector_viewmodel_test.mocks.dart @@ -7,13 +7,13 @@ import 'dart:async' as _i5; import 'dart:ui' as _i4; import 'package:drift/drift.dart' as _i10; -import 'package:flutter/material.dart' as _i1; +import 'package:flutter/material.dart' as _i2; import 'package:flutter_template/model/snackbar/snackbar_data.dart' as _i11; import 'package:flutter_template/navigator/main_navigator.dart' as _i9; import 'package:flutter_template/util/locale/localization.dart' as _i7; import 'package:flutter_template/viewmodel/global/global_viewmodel.dart' as _i3; import 'package:icapps_architecture/icapps_architecture.dart' as _i8; -import 'package:mockito/mockito.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/src/dummies.dart' as _i6; // ignore_for_file: type=lint @@ -29,9 +29,19 @@ import 'package:mockito/src/dummies.dart' as _i6; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeGlobalKey_0> - extends _i2.SmartFake implements _i1.GlobalKey { - _FakeGlobalKey_0( +class _FakeBuildContext_0 extends _i1.SmartFake implements _i2.BuildContext { + _FakeBuildContext_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeGlobalKey_1> + extends _i1.SmartFake implements _i2.GlobalKey { + _FakeGlobalKey_1( Object parent, Invocation parentInvocation, ) : super( @@ -43,9 +53,9 @@ class _FakeGlobalKey_0> /// A class which mocks [GlobalViewModel]. /// /// See the documentation for Mockito's code generation for more information. -class MockGlobalViewModel extends _i2.Mock implements _i3.GlobalViewModel { +class MockGlobalViewModel extends _i1.Mock implements _i3.GlobalViewModel { MockGlobalViewModel() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override @@ -55,10 +65,10 @@ class MockGlobalViewModel extends _i2.Mock implements _i3.GlobalViewModel { ) as List<_i4.Locale>); @override - _i1.ThemeMode get themeMode => (super.noSuchMethod( + _i2.ThemeMode get themeMode => (super.noSuchMethod( Invocation.getter(#themeMode), - returnValue: _i1.ThemeMode.system, - ) as _i1.ThemeMode); + returnValue: _i2.ThemeMode.system, + ) as _i2.ThemeMode); @override bool get showsTranslationKeys => (super.noSuchMethod( @@ -89,7 +99,7 @@ class MockGlobalViewModel extends _i2.Mock implements _i3.GlobalViewModel { ) as _i5.Future); @override - _i5.Future updateThemeMode(_i1.ThemeMode? themeMode) => + _i5.Future updateThemeMode(_i2.ThemeMode? themeMode) => (super.noSuchMethod( Invocation.method( #updateThemeMode, @@ -291,19 +301,28 @@ class MockGlobalViewModel extends _i2.Mock implements _i3.GlobalViewModel { /// A class which mocks [MainNavigator]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { +class MockMainNavigator extends _i1.Mock implements _i9.MainNavigator { MockMainNavigator() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override - _i1.GlobalKey<_i1.NavigatorState> get navigatorKey => (super.noSuchMethod( + _i2.BuildContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeBuildContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.BuildContext); + + @override + _i2.GlobalKey<_i2.NavigatorState> get navigatorKey => (super.noSuchMethod( Invocation.getter(#navigatorKey), - returnValue: _FakeGlobalKey_0<_i1.NavigatorState>( + returnValue: _FakeGlobalKey_1<_i2.NavigatorState>( this, Invocation.getter(#navigatorKey), ), - ) as _i1.GlobalKey<_i1.NavigatorState>); + ) as _i2.GlobalKey<_i2.NavigatorState>); @override _i5.Future goToDatabase(_i10.GeneratedDatabase? db) => @@ -365,14 +384,14 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ) as _i5.Future); @override - _i1.Route? onGenerateRoute(_i1.RouteSettings? settings) => + _i2.Route? onGenerateRoute(_i2.RouteSettings? settings) => (super.noSuchMethod(Invocation.method( #onGenerateRoute, [settings], - )) as _i1.Route?); + )) as _i2.Route?); @override - void goToHomeScreen({_i1.Key? key}) => super.noSuchMethod( + void goToHomeScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToHomeScreen, [], @@ -382,7 +401,7 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ); @override - void goToSplashScreen({_i1.Key? key}) => super.noSuchMethod( + void goToSplashScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToSplashScreen, [], @@ -392,7 +411,7 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ); @override - _i5.Future goToLicenseScreen({_i1.Key? key}) => (super.noSuchMethod( + _i5.Future goToLicenseScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( #goToLicenseScreen, [], @@ -403,10 +422,27 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ) as _i5.Future); @override - _i5.Future goToAnalyticsPermissionScreen({_i1.Key? key}) => + _i5.Future goToLogDetailScreen({ + required String? date, + _i2.Key? key, + }) => (super.noSuchMethod( Invocation.method( - #goToAnalyticsPermissionScreen, + #goToLogDetailScreen, + [], + { + #date: date, + #key: key, + }, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future goToTodoAddScreen({_i2.Key? key}) => (super.noSuchMethod( + Invocation.method( + #goToTodoAddScreen, [], {#key: key}, ), @@ -415,20 +451,21 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ) as _i5.Future); @override - void goToLoginScreen({_i1.Key? key}) => super.noSuchMethod( + _i5.Future goToLogsScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToLoginScreen, + #goToLogsScreen, [], {#key: key}, ), - returnValueForMissingStub: null, - ); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i5.Future goToThemeModeSelectorScreen({_i1.Key? key}) => + _i5.Future goToAnalyticsPermissionScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToThemeModeSelectorScreen, + #goToAnalyticsPermissionScreen, [], {#key: key}, ), @@ -437,10 +474,20 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ) as _i5.Future); @override - _i5.Future goToDebugPlatformSelectorScreen({_i1.Key? key}) => + void goToLoginScreen({_i2.Key? key}) => super.noSuchMethod( + Invocation.method( + #goToLoginScreen, + [], + {#key: key}, + ), + returnValueForMissingStub: null, + ); + + @override + _i5.Future goToThemeModeSelectorScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToDebugPlatformSelectorScreen, + #goToThemeModeSelectorScreen, [], {#key: key}, ), @@ -449,9 +496,10 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ) as _i5.Future); @override - _i5.Future goToDebugScreen({_i1.Key? key}) => (super.noSuchMethod( + _i5.Future goToDebugPlatformSelectorScreen({_i2.Key? key}) => + (super.noSuchMethod( Invocation.method( - #goToDebugScreen, + #goToDebugPlatformSelectorScreen, [], {#key: key}, ), @@ -460,9 +508,9 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ) as _i5.Future); @override - _i5.Future goToTodoAddScreen({_i1.Key? key}) => (super.noSuchMethod( + _i5.Future goToDebugScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToTodoAddScreen, + #goToDebugScreen, [], {#key: key}, ), @@ -490,7 +538,7 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ); @override - void popUntil(bool Function(_i1.Route)? predicate) => + void popUntil(bool Function(_i2.Route)? predicate) => super.noSuchMethod( Invocation.method( #popUntil, @@ -509,7 +557,7 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ); @override - _i5.Future showCustomDialog({_i1.Widget? widget}) => + _i5.Future showCustomDialog({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showCustomDialog, @@ -520,7 +568,7 @@ class MockMainNavigator extends _i2.Mock implements _i9.MainNavigator { ) as _i5.Future); @override - _i5.Future showBottomSheet({_i1.Widget? widget}) => + _i5.Future showBottomSheet({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showBottomSheet, diff --git a/test/viewmodel/todo/todo_add/todo_add_viewmodel_test.mocks.dart b/test/viewmodel/todo/todo_add/todo_add_viewmodel_test.mocks.dart index 72230630..ff1a0bb2 100644 --- a/test/viewmodel/todo/todo_add/todo_add_viewmodel_test.mocks.dart +++ b/test/viewmodel/todo/todo_add/todo_add_viewmodel_test.mocks.dart @@ -6,12 +6,12 @@ import 'dart:async' as _i4; import 'package:drift/drift.dart' as _i7; -import 'package:flutter/material.dart' as _i1; +import 'package:flutter/material.dart' as _i2; import 'package:flutter_template/model/snackbar/snackbar_data.dart' as _i8; import 'package:flutter_template/model/webservice/todo/todo.dart' as _i5; import 'package:flutter_template/navigator/main_navigator.dart' as _i6; import 'package:flutter_template/repository/todo/todo_repository.dart' as _i3; -import 'package:mockito/mockito.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -26,9 +26,19 @@ import 'package:mockito/mockito.dart' as _i2; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeGlobalKey_0> - extends _i2.SmartFake implements _i1.GlobalKey { - _FakeGlobalKey_0( +class _FakeBuildContext_0 extends _i1.SmartFake implements _i2.BuildContext { + _FakeBuildContext_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeGlobalKey_1> + extends _i1.SmartFake implements _i2.GlobalKey { + _FakeGlobalKey_1( Object parent, Invocation parentInvocation, ) : super( @@ -40,9 +50,9 @@ class _FakeGlobalKey_0> /// A class which mocks [TodoRepository]. /// /// See the documentation for Mockito's code generation for more information. -class MockTodoRepository extends _i2.Mock implements _i3.TodoRepository { +class MockTodoRepository extends _i1.Mock implements _i3.TodoRepository { MockTodoRepository() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override @@ -95,19 +105,28 @@ class MockTodoRepository extends _i2.Mock implements _i3.TodoRepository { /// A class which mocks [MainNavigator]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { +class MockMainNavigator extends _i1.Mock implements _i6.MainNavigator { MockMainNavigator() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override - _i1.GlobalKey<_i1.NavigatorState> get navigatorKey => (super.noSuchMethod( + _i2.BuildContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeBuildContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.BuildContext); + + @override + _i2.GlobalKey<_i2.NavigatorState> get navigatorKey => (super.noSuchMethod( Invocation.getter(#navigatorKey), - returnValue: _FakeGlobalKey_0<_i1.NavigatorState>( + returnValue: _FakeGlobalKey_1<_i2.NavigatorState>( this, Invocation.getter(#navigatorKey), ), - ) as _i1.GlobalKey<_i1.NavigatorState>); + ) as _i2.GlobalKey<_i2.NavigatorState>); @override _i4.Future goToDatabase(_i7.GeneratedDatabase? db) => @@ -169,14 +188,14 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i1.Route? onGenerateRoute(_i1.RouteSettings? settings) => + _i2.Route? onGenerateRoute(_i2.RouteSettings? settings) => (super.noSuchMethod(Invocation.method( #onGenerateRoute, [settings], - )) as _i1.Route?); + )) as _i2.Route?); @override - void goToHomeScreen({_i1.Key? key}) => super.noSuchMethod( + void goToHomeScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToHomeScreen, [], @@ -186,7 +205,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ); @override - void goToSplashScreen({_i1.Key? key}) => super.noSuchMethod( + void goToSplashScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToSplashScreen, [], @@ -196,7 +215,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ); @override - _i4.Future goToLicenseScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToLicenseScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( #goToLicenseScreen, [], @@ -207,10 +226,27 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future goToAnalyticsPermissionScreen({_i1.Key? key}) => + _i4.Future goToLogDetailScreen({ + required String? date, + _i2.Key? key, + }) => (super.noSuchMethod( Invocation.method( - #goToAnalyticsPermissionScreen, + #goToLogDetailScreen, + [], + { + #date: date, + #key: key, + }, + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future goToTodoAddScreen({_i2.Key? key}) => (super.noSuchMethod( + Invocation.method( + #goToTodoAddScreen, [], {#key: key}, ), @@ -219,20 +255,21 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - void goToLoginScreen({_i1.Key? key}) => super.noSuchMethod( + _i4.Future goToLogsScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToLoginScreen, + #goToLogsScreen, [], {#key: key}, ), - returnValueForMissingStub: null, - ); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future goToThemeModeSelectorScreen({_i1.Key? key}) => + _i4.Future goToAnalyticsPermissionScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToThemeModeSelectorScreen, + #goToAnalyticsPermissionScreen, [], {#key: key}, ), @@ -241,10 +278,20 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugPlatformSelectorScreen({_i1.Key? key}) => + void goToLoginScreen({_i2.Key? key}) => super.noSuchMethod( + Invocation.method( + #goToLoginScreen, + [], + {#key: key}, + ), + returnValueForMissingStub: null, + ); + + @override + _i4.Future goToThemeModeSelectorScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToDebugPlatformSelectorScreen, + #goToThemeModeSelectorScreen, [], {#key: key}, ), @@ -253,9 +300,10 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugPlatformSelectorScreen({_i2.Key? key}) => + (super.noSuchMethod( Invocation.method( - #goToDebugScreen, + #goToDebugPlatformSelectorScreen, [], {#key: key}, ), @@ -264,9 +312,9 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future goToTodoAddScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToTodoAddScreen, + #goToDebugScreen, [], {#key: key}, ), @@ -294,7 +342,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ); @override - void popUntil(bool Function(_i1.Route)? predicate) => + void popUntil(bool Function(_i2.Route)? predicate) => super.noSuchMethod( Invocation.method( #popUntil, @@ -313,7 +361,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ); @override - _i4.Future showCustomDialog({_i1.Widget? widget}) => + _i4.Future showCustomDialog({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showCustomDialog, @@ -324,7 +372,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future showBottomSheet({_i1.Widget? widget}) => + _i4.Future showBottomSheet({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showBottomSheet, diff --git a/test/viewmodel/todo/todo_list/todo_list_viewmodel_test.mocks.dart b/test/viewmodel/todo/todo_list/todo_list_viewmodel_test.mocks.dart index 4fa12d62..52e169ce 100644 --- a/test/viewmodel/todo/todo_list/todo_list_viewmodel_test.mocks.dart +++ b/test/viewmodel/todo/todo_list/todo_list_viewmodel_test.mocks.dart @@ -6,12 +6,12 @@ import 'dart:async' as _i4; import 'package:drift/drift.dart' as _i7; -import 'package:flutter/material.dart' as _i1; +import 'package:flutter/material.dart' as _i2; import 'package:flutter_template/model/snackbar/snackbar_data.dart' as _i8; import 'package:flutter_template/model/webservice/todo/todo.dart' as _i5; import 'package:flutter_template/navigator/main_navigator.dart' as _i6; import 'package:flutter_template/repository/todo/todo_repository.dart' as _i3; -import 'package:mockito/mockito.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -26,9 +26,19 @@ import 'package:mockito/mockito.dart' as _i2; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeGlobalKey_0> - extends _i2.SmartFake implements _i1.GlobalKey { - _FakeGlobalKey_0( +class _FakeBuildContext_0 extends _i1.SmartFake implements _i2.BuildContext { + _FakeBuildContext_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeGlobalKey_1> + extends _i1.SmartFake implements _i2.GlobalKey { + _FakeGlobalKey_1( Object parent, Invocation parentInvocation, ) : super( @@ -40,9 +50,9 @@ class _FakeGlobalKey_0> /// A class which mocks [TodoRepository]. /// /// See the documentation for Mockito's code generation for more information. -class MockTodoRepository extends _i2.Mock implements _i3.TodoRepository { +class MockTodoRepository extends _i1.Mock implements _i3.TodoRepository { MockTodoRepository() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override @@ -95,19 +105,28 @@ class MockTodoRepository extends _i2.Mock implements _i3.TodoRepository { /// A class which mocks [MainNavigator]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { +class MockMainNavigator extends _i1.Mock implements _i6.MainNavigator { MockMainNavigator() { - _i2.throwOnMissingStub(this); + _i1.throwOnMissingStub(this); } @override - _i1.GlobalKey<_i1.NavigatorState> get navigatorKey => (super.noSuchMethod( + _i2.BuildContext get context => (super.noSuchMethod( + Invocation.getter(#context), + returnValue: _FakeBuildContext_0( + this, + Invocation.getter(#context), + ), + ) as _i2.BuildContext); + + @override + _i2.GlobalKey<_i2.NavigatorState> get navigatorKey => (super.noSuchMethod( Invocation.getter(#navigatorKey), - returnValue: _FakeGlobalKey_0<_i1.NavigatorState>( + returnValue: _FakeGlobalKey_1<_i2.NavigatorState>( this, Invocation.getter(#navigatorKey), ), - ) as _i1.GlobalKey<_i1.NavigatorState>); + ) as _i2.GlobalKey<_i2.NavigatorState>); @override _i4.Future goToDatabase(_i7.GeneratedDatabase? db) => @@ -169,14 +188,14 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i1.Route? onGenerateRoute(_i1.RouteSettings? settings) => + _i2.Route? onGenerateRoute(_i2.RouteSettings? settings) => (super.noSuchMethod(Invocation.method( #onGenerateRoute, [settings], - )) as _i1.Route?); + )) as _i2.Route?); @override - void goToHomeScreen({_i1.Key? key}) => super.noSuchMethod( + void goToHomeScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToHomeScreen, [], @@ -186,7 +205,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ); @override - void goToSplashScreen({_i1.Key? key}) => super.noSuchMethod( + void goToSplashScreen({_i2.Key? key}) => super.noSuchMethod( Invocation.method( #goToSplashScreen, [], @@ -196,7 +215,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ); @override - _i4.Future goToLicenseScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToLicenseScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( #goToLicenseScreen, [], @@ -207,10 +226,27 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future goToAnalyticsPermissionScreen({_i1.Key? key}) => + _i4.Future goToLogDetailScreen({ + required String? date, + _i2.Key? key, + }) => (super.noSuchMethod( Invocation.method( - #goToAnalyticsPermissionScreen, + #goToLogDetailScreen, + [], + { + #date: date, + #key: key, + }, + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future goToTodoAddScreen({_i2.Key? key}) => (super.noSuchMethod( + Invocation.method( + #goToTodoAddScreen, [], {#key: key}, ), @@ -219,20 +255,21 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - void goToLoginScreen({_i1.Key? key}) => super.noSuchMethod( + _i4.Future goToLogsScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToLoginScreen, + #goToLogsScreen, [], {#key: key}, ), - returnValueForMissingStub: null, - ); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i4.Future goToThemeModeSelectorScreen({_i1.Key? key}) => + _i4.Future goToAnalyticsPermissionScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToThemeModeSelectorScreen, + #goToAnalyticsPermissionScreen, [], {#key: key}, ), @@ -241,10 +278,20 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugPlatformSelectorScreen({_i1.Key? key}) => + void goToLoginScreen({_i2.Key? key}) => super.noSuchMethod( + Invocation.method( + #goToLoginScreen, + [], + {#key: key}, + ), + returnValueForMissingStub: null, + ); + + @override + _i4.Future goToThemeModeSelectorScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToDebugPlatformSelectorScreen, + #goToThemeModeSelectorScreen, [], {#key: key}, ), @@ -253,9 +300,10 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future goToDebugScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugPlatformSelectorScreen({_i2.Key? key}) => + (super.noSuchMethod( Invocation.method( - #goToDebugScreen, + #goToDebugPlatformSelectorScreen, [], {#key: key}, ), @@ -264,9 +312,9 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future goToTodoAddScreen({_i1.Key? key}) => (super.noSuchMethod( + _i4.Future goToDebugScreen({_i2.Key? key}) => (super.noSuchMethod( Invocation.method( - #goToTodoAddScreen, + #goToDebugScreen, [], {#key: key}, ), @@ -294,7 +342,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ); @override - void popUntil(bool Function(_i1.Route)? predicate) => + void popUntil(bool Function(_i2.Route)? predicate) => super.noSuchMethod( Invocation.method( #popUntil, @@ -313,7 +361,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ); @override - _i4.Future showCustomDialog({_i1.Widget? widget}) => + _i4.Future showCustomDialog({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showCustomDialog, @@ -324,7 +372,7 @@ class MockMainNavigator extends _i2.Mock implements _i6.MainNavigator { ) as _i4.Future); @override - _i4.Future showBottomSheet({_i1.Widget? widget}) => + _i4.Future showBottomSheet({_i2.Widget? widget}) => (super.noSuchMethod( Invocation.method( #showBottomSheet,