diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 0000000..f79f9b4 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,4 @@ +{ + "flutter": "3.19.3", + "flavors": {} +} \ No newline at end of file diff --git a/lib/di/injectable.config.dart b/lib/di/injectable.config.dart index dddd1f5..8187547 100644 --- a/lib/di/injectable.config.dart +++ b/lib/di/injectable.config.dart @@ -12,8 +12,7 @@ import 'package:cloud_firestore/cloud_firestore.dart' as _i5; import 'package:firebase_auth/firebase_auth.dart' as _i4; import 'package:firebase_remote_config/firebase_remote_config.dart' as _i6; import 'package:flutter_belgium/di/injectable.dart' as _i31; -import 'package:flutter_belgium/model/data/remote_config/remote_config_data.dart' - as _i16; +import 'package:flutter_belgium/model/data/remote_config/remote_config_data.dart' as _i16; import 'package:flutter_belgium/navigator/main_navigator.dart' as _i12; import 'package:flutter_belgium/repo/event/event_repostitory.dart' as _i26; import 'package:flutter_belgium/repo/locale/locale_repository.dart' as _i10; @@ -22,26 +21,19 @@ import 'package:flutter_belgium/repo/raffle/raffle_repo.dart' as _i13; import 'package:flutter_belgium/repo/remote_config.dart' as _i17; import 'package:flutter_belgium/repo/talk/talk_repostitory.dart' as _i29; import 'package:flutter_belgium/service/airtable_service.dart' as _i22; -import 'package:flutter_belgium/viewmodel/debug/debug_change_language_viewmodel.dart' - as _i23; -import 'package:flutter_belgium/viewmodel/debug/debug_change_target_platform_viewmodel.dart' - as _i24; +import 'package:flutter_belgium/viewmodel/debug/debug_change_language_viewmodel.dart' as _i23; +import 'package:flutter_belgium/viewmodel/debug/debug_change_target_platform_viewmodel.dart' as _i24; import 'package:flutter_belgium/viewmodel/debug/debug_viewmodel.dart' as _i25; import 'package:flutter_belgium/viewmodel/event/events_viewmodel.dart' as _i27; -import 'package:flutter_belgium/viewmodel/force_update/force_update_viewmodel.dart' - as _i7; +import 'package:flutter_belgium/viewmodel/force_update/force_update_viewmodel.dart' as _i7; import 'package:flutter_belgium/viewmodel/global/global_viewmodel.dart' as _i8; -import 'package:flutter_belgium/viewmodel/global/translations_viewmodel.dart' - as _i20; +import 'package:flutter_belgium/viewmodel/global/translations_viewmodel.dart' as _i20; import 'package:flutter_belgium/viewmodel/home/home_viewmodel.dart' as _i9; import 'package:flutter_belgium/viewmodel/login/login_viewmodel.dart' as _i28; -import 'package:flutter_belgium/viewmodel/login/user_name_viewmodel.dart' - as _i21; +import 'package:flutter_belgium/viewmodel/login/user_name_viewmodel.dart' as _i21; import 'package:flutter_belgium/viewmodel/raffle/raffle_viewmodel.dart' as _i14; -import 'package:flutter_belgium/viewmodel/raffle/raffle_winner_picker_viewmodel.dart' - as _i15; -import 'package:flutter_belgium/viewmodel/settings/settings_viewmodel.dart' - as _i18; +import 'package:flutter_belgium/viewmodel/raffle/raffle_winner_picker_viewmodel.dart' as _i15; +import 'package:flutter_belgium/viewmodel/settings/settings_viewmodel.dart' as _i18; import 'package:flutter_belgium/viewmodel/splash/splash_viewmodel.dart' as _i19; import 'package:flutter_belgium/viewmodel/talk/talks_viewmodel.dart' as _i30; import 'package:get_it/get_it.dart' as _i1; @@ -61,17 +53,13 @@ extension GetItInjectableX on _i1.GetIt { ); final registerModule = _$RegisterModule(); gh.lazySingleton<_i3.Dio>(() => registerModule.provideDio()); - gh.lazySingleton<_i4.FirebaseAuth>( - () => registerModule.provideFirebaseAuth()); - gh.lazySingleton<_i5.FirebaseFirestore>( - () => registerModule.provideFirebaseFirestore()); - gh.lazySingleton<_i6.FirebaseRemoteConfig>( - () => registerModule.provideRemoteConfig()); + gh.lazySingleton<_i4.FirebaseAuth>(() => registerModule.provideFirebaseAuth()); + gh.lazySingleton<_i5.FirebaseFirestore>(() => registerModule.provideFirebaseFirestore()); + gh.lazySingleton<_i6.FirebaseRemoteConfig>(() => registerModule.provideRemoteConfig()); gh.factory<_i7.ForceUpdateViewModel>(() => _i7.ForceUpdateViewModel()); gh.lazySingleton<_i8.GlobalViewModel>(() => _i8.GlobalViewModel()); gh.factory<_i9.HomeViewmodel>(() => _i9.HomeViewmodel()); - gh.lazySingleton<_i10.LocaleRepository>( - () => _i10.LocaleRepository(gh<_i3.SharedPrefsStore>())); + gh.lazySingleton<_i10.LocaleRepository>(() => _i10.LocaleRepository(gh<_i3.SharedPrefsStore>())); gh.lazySingleton<_i11.LoginRepository>(() => _i11.LoginRepository( gh<_i4.FirebaseAuth>(), gh<_i3.SharedPrefsStore>(), @@ -86,17 +74,15 @@ extension GetItInjectableX on _i1.GetIt { gh<_i13.RaffleRepository>(), gh<_i12.MainNavigator>(), )); - gh.factory<_i15.RaffleWinnerPickerViewModel>( - () => _i15.RaffleWinnerPickerViewModel( - gh<_i13.RaffleRepository>(), - gh<_i12.MainNavigator>(), - )); - gh.lazySingleton<_i3.RemoteConfigRepository<_i16.RemoteConfigData>>( - () => _i17.AppRemoteConfigRepository( - gh<_i6.FirebaseRemoteConfig>(), - gh<_i3.SharedPrefsStore>(), - gh<_i3.ConnectivityController>(), - )); + gh.factory<_i15.RaffleWinnerPickerViewModel>(() => _i15.RaffleWinnerPickerViewModel( + gh<_i13.RaffleRepository>(), + gh<_i12.MainNavigator>(), + )); + gh.lazySingleton<_i3.RemoteConfigRepository<_i16.RemoteConfigData>>(() => _i17.AppRemoteConfigRepository( + gh<_i6.FirebaseRemoteConfig>(), + gh<_i3.SharedPrefsStore>(), + gh<_i3.ConnectivityController>(), + )); gh.factory<_i18.SettingsViewmodel>(() => _i18.SettingsViewmodel( gh<_i12.MainNavigator>(), gh<_i11.LoginRepository>(), @@ -106,43 +92,34 @@ extension GetItInjectableX on _i1.GetIt { gh<_i3.RemoteConfigRepository<_i16.RemoteConfigData>>(), gh<_i3.VersionCheckRepository>(), )); - gh.lazySingleton<_i20.TranslationsViewmodel>( - () => _i20.TranslationsViewmodel(gh<_i10.LocaleRepository>())); + gh.lazySingleton<_i20.TranslationsViewmodel>(() => _i20.TranslationsViewmodel(gh<_i10.LocaleRepository>())); gh.factory<_i21.UserNameViewModel>(() => _i21.UserNameViewModel( gh<_i11.LoginRepository>(), gh<_i12.MainNavigator>(), )); - gh.lazySingleton<_i3.VersionCheckService>(() => - registerModule.provideVersionCheckService(gh<_i12.MainNavigator>())); - gh.lazySingleton<_i22.AirtableService>( - () => registerModule.providerAirtableService(gh<_i3.Dio>())); - gh.factory<_i23.DebugChangeLanguageViewModel>( - () => _i23.DebugChangeLanguageViewModel( - gh<_i20.TranslationsViewmodel>(), - gh<_i12.MainNavigator>(), - )); - gh.factory<_i24.DebugChangeTargetPlatformViewModel>( - () => _i24.DebugChangeTargetPlatformViewModel( - gh<_i8.GlobalViewModel>(), - gh<_i12.MainNavigator>(), - )); + gh.lazySingleton<_i3.VersionCheckService>(() => registerModule.provideVersionCheckService(gh<_i12.MainNavigator>())); + gh.lazySingleton<_i22.AirtableService>(() => registerModule.providerAirtableService(gh<_i3.Dio>())); + gh.factory<_i23.DebugChangeLanguageViewModel>(() => _i23.DebugChangeLanguageViewModel( + gh<_i20.TranslationsViewmodel>(), + gh<_i12.MainNavigator>(), + )); + gh.factory<_i24.DebugChangeTargetPlatformViewModel>(() => _i24.DebugChangeTargetPlatformViewModel( + gh<_i8.GlobalViewModel>(), + gh<_i12.MainNavigator>(), + )); gh.factory<_i25.DebugViewModel>(() => _i25.DebugViewModel( gh<_i8.GlobalViewModel>(), gh<_i20.TranslationsViewmodel>(), gh<_i12.MainNavigator>(), )); - gh.lazySingleton<_i26.EventRepository>( - () => _i26.EventRepository(gh<_i22.AirtableService>())); - gh.factory<_i27.EventsViewmodel>( - () => _i27.EventsViewmodel(gh<_i26.EventRepository>())); + gh.lazySingleton<_i26.EventRepository>(() => _i26.EventRepository(gh<_i22.AirtableService>())); + gh.factory<_i27.EventsViewmodel>(() => _i27.EventsViewmodel(gh<_i26.EventRepository>())); gh.factory<_i28.LoginViewModel>(() => _i28.LoginViewModel( gh<_i11.LoginRepository>(), gh<_i12.MainNavigator>(), )); - gh.lazySingleton<_i29.TalkRepository>( - () => _i29.TalkRepository(gh<_i22.AirtableService>())); - gh.factory<_i30.TalksViewmodel>( - () => _i30.TalksViewmodel(gh<_i29.TalkRepository>())); + gh.lazySingleton<_i29.TalkRepository>(() => _i29.TalkRepository(gh<_i22.AirtableService>())); + gh.factory<_i30.TalksViewmodel>(() => _i30.TalksViewmodel(gh<_i29.TalkRepository>())); return this; } } diff --git a/lib/model/data/remote_config/remote_config_data.g.dart b/lib/model/data/remote_config/remote_config_data.g.dart index 712b1c3..cffc0e2 100644 --- a/lib/model/data/remote_config/remote_config_data.g.dart +++ b/lib/model/data/remote_config/remote_config_data.g.dart @@ -6,17 +6,14 @@ part of 'remote_config_data.dart'; // JsonSerializableGenerator // ************************************************************************** -RemoteConfigData _$RemoteConfigDataFromJson(Map json) => - RemoteConfigData( - adminIds: - (json['adminIds'] as List).map((e) => e as String).toList(), +RemoteConfigData _$RemoteConfigDataFromJson(Map json) => RemoteConfigData( + adminIds: (json['adminIds'] as List).map((e) => e as String).toList(), latestVersionCode: json['latestVersionCode'] as int, minVersionCode: json['minVersionCode'] as int, updateUrl: json['updateUrl'] as String, ); -Map _$RemoteConfigDataToJson(RemoteConfigData instance) => - { +Map _$RemoteConfigDataToJson(RemoteConfigData instance) => { 'latestVersionCode': instance.latestVersionCode, 'minVersionCode': instance.minVersionCode, 'updateUrl': instance.updateUrl, diff --git a/lib/navigator/main_navigator.navigator.dart b/lib/navigator/main_navigator.navigator.dart index 4a4056d..0c7bc58 100644 --- a/lib/navigator/main_navigator.navigator.dart +++ b/lib/navigator/main_navigator.navigator.dart @@ -8,8 +8,7 @@ import 'package:flutter/foundation.dart' as _i3; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_belgium/util/firebase/github/github_sign_in_result.dart' - as _i1; +import 'package:flutter_belgium/util/firebase/github/github_sign_in_result.dart' as _i1; import 'package:impaktfull_architecture/impaktfull_architecture.dart' as _i2; import 'package:impaktfull_architecture/impaktfull_architecture.dart'; @@ -30,9 +29,7 @@ mixin BaseNavigator { final GlobalKey navigatorKey = GlobalKey(); Route? onGenerateRoute(RouteSettings settings) { - final arguments = settings.arguments is Map - ? (settings.arguments as Map).cast() - : null; + final arguments = settings.arguments is Map ? (settings.arguments as Map).cast() : null; switch (settings.name) { case RouteNames.gitHubSignInWebviewScreen: return MaterialPageRoute( @@ -141,87 +138,66 @@ mixin BaseNavigator { }) async { final dynamic result = await navigatorKey.currentState?.pushNamed( RouteNames.gitHubSignInWebviewScreen, - arguments: { - 'clientId': clientId, - 'clientSecret': clientSecret, - 'allowSignUp': allowSignUp, - 'scope': scope, - 'redirectUrl': redirectUrl, - 'key': key - }, + arguments: {'clientId': clientId, 'clientSecret': clientSecret, 'allowSignUp': allowSignUp, 'scope': scope, 'redirectUrl': redirectUrl, 'key': key}, ); return (result as _i1.GithubSignInPageResult?); } - void goToHomeScreen({_i2.Key? key}) => - navigatorKey.currentState?.pushNamedAndRemoveUntil( + void goToHomeScreen({_i2.Key? key}) => navigatorKey.currentState?.pushNamedAndRemoveUntil( RouteNames.homeScreen, (_) => false, arguments: {'key': key}, ); - void goToSplashScreen({_i2.Key? key}) => - navigatorKey.currentState?.pushNamedAndRemoveUntil( + void goToSplashScreen({_i2.Key? key}) => navigatorKey.currentState?.pushNamedAndRemoveUntil( RouteNames.splashScreen, (_) => false, arguments: {'key': key}, ); - Future goToRaffleWinnerPickerScreen({_i2.Key? key}) async => - navigatorKey.currentState?.pushNamed( + Future goToRaffleWinnerPickerScreen({_i2.Key? key}) async => navigatorKey.currentState?.pushNamed( RouteNames.raffleWinnerPickerScreen, arguments: {'key': key}, ); - void goToRaffleScreen({_i3.Key? key}) => - navigatorKey.currentState?.pushNamedAndRemoveUntil( + void goToRaffleScreen({_i3.Key? key}) => navigatorKey.currentState?.pushNamedAndRemoveUntil( RouteNames.raffleScreen, (_) => false, arguments: {'key': key}, ); - void goToLoginScreen({_i2.Key? key}) => - navigatorKey.currentState?.pushNamedAndRemoveUntil( + void goToLoginScreen({_i2.Key? key}) => navigatorKey.currentState?.pushNamedAndRemoveUntil( RouteNames.loginScreen, (_) => false, arguments: {'key': key}, ); - Future goToDebugChangeTargetPlatformScreen({_i2.Key? key}) async => - navigatorKey.currentState?.pushNamed( + Future goToDebugChangeTargetPlatformScreen({_i2.Key? key}) async => navigatorKey.currentState?.pushNamed( RouteNames.debugChangeTargetPlatformScreen, arguments: {'key': key}, ); - Future goToDebugChangeLanguageScreen({_i2.Key? key}) async => - navigatorKey.currentState?.pushNamed( + Future goToDebugChangeLanguageScreen({_i2.Key? key}) async => navigatorKey.currentState?.pushNamed( RouteNames.debugChangeLanguageScreen, arguments: {'key': key}, ); - Future goToDebugScreen({_i2.Key? key}) async => - navigatorKey.currentState?.pushNamed( + Future goToDebugScreen({_i2.Key? key}) async => navigatorKey.currentState?.pushNamed( RouteNames.debugScreen, arguments: {'key': key}, ); - void goToForceUpdateScreen({_i2.Key? key}) => - navigatorKey.currentState?.pushNamedAndRemoveUntil( + void goToForceUpdateScreen({_i2.Key? key}) => navigatorKey.currentState?.pushNamedAndRemoveUntil( RouteNames.forceUpdateScreen, (_) => false, arguments: {'key': key}, ); - void goToUserNameScreen({_i2.Key? key}) => - navigatorKey.currentState?.pushNamedAndRemoveUntil( + void goToUserNameScreen({_i2.Key? key}) => navigatorKey.currentState?.pushNamedAndRemoveUntil( RouteNames.userNameScreen, (_) => false, arguments: {'key': key}, ); void goBack() => navigatorKey.currentState?.pop(); - void goBackWithResult({T? result}) => - navigatorKey.currentState?.pop(result); - void popUntil(bool Function(Route) predicate) => - navigatorKey.currentState?.popUntil(predicate); - void goBackTo(String routeName) => - popUntil((route) => route.settings.name == routeName); + void goBackWithResult({T? result}) => navigatorKey.currentState?.pop(result); + void popUntil(bool Function(Route) predicate) => navigatorKey.currentState?.popUntil(predicate); + void goBackTo(String routeName) => popUntil((route) => route.settings.name == routeName); Future showCustomDialog({Widget? widget}) async => showDialog( context: navigatorKey.currentContext!, builder: (_) => widget ?? const SizedBox.shrink(), ); - Future showBottomSheet({Widget? widget}) async => - showModalBottomSheet( + Future showBottomSheet({Widget? widget}) async => showModalBottomSheet( context: navigatorKey.currentContext!, builder: (_) => widget ?? const SizedBox.shrink(), ); @@ -240,8 +216,7 @@ class RouteNames { static const loginScreen = '/login'; - static const debugChangeTargetPlatformScreen = - '/debug-change-target-platform'; + static const debugChangeTargetPlatformScreen = '/debug-change-target-platform'; static const debugChangeLanguageScreen = '/debug-change-language'; diff --git a/tools/fix_codebase.dart b/tools/fix_codebase.dart index e03cf15..b9abd6e 100644 --- a/tools/fix_codebase.dart +++ b/tools/fix_codebase.dart @@ -5,6 +5,6 @@ Future main(List arguments) async { final airtableCredentialsFile = File('lib/secrets/airtable_config_empty.dart'); airtableCredentialsFile.copySync('lib/secrets/airtable_config.dart'); // Fix Github credentials - final githubCredentialsFile = File('lib/secrets/github_config_empty.dart'); - githubCredentialsFile.copySync('lib/secrets/github_config.dart'); + final githubCredentialsFile = File('lib/secrets/github_credentials_empty.dart'); + githubCredentialsFile.copySync('lib/secrets/github_credentials.dart'); }