@@ -31,21 +31,24 @@ void main() async {
3131 // KV migration from the 'is_first_login' key to 'onboarding_completed'
3232 // to correctly handle the completion of the onboarding process
3333 // (To consider to remove in later future)
34- final bool ? isFirstLoginCachedValue =
35- _sharedPreferences.getBool ('is_first_login' );
34+ final bool ? isFirstLoginCachedValue = _sharedPreferences.getBool (
35+ 'is_first_login' ,
36+ );
3637 final bool isOnBoardingCompletedKeyNotSaved =
3738 _sharedPreferences.getBool ('onboarding_completed' ) == null ;
3839 if (isFirstLoginCachedValue != null && isOnBoardingCompletedKeyNotSaved) {
3940 await _sharedPreferences.setBool (
40- 'onboarding_completed' , ! isFirstLoginCachedValue);
41+ 'onboarding_completed' ,
42+ ! isFirstLoginCachedValue,
43+ );
4144 }
4245
4346 // perform recurring transactions checks
44- DateTime ? lastCheckGetPref = _sharedPreferences
45- .getString ('last_recurring_transactions_check' ) !=
46- null
47+ DateTime ? lastCheckGetPref =
48+ _sharedPreferences.getString ('last_recurring_transactions_check' ) != null
4749 ? DateTime .parse (
48- _sharedPreferences.getString ('last_recurring_transactions_check' )! )
50+ _sharedPreferences.getString ('last_recurring_transactions_check' )! ,
51+ )
4952 : null ;
5053 DateTime ? lastRecurringTransactionsCheck = lastCheckGetPref;
5154
@@ -54,20 +57,24 @@ void main() async {
5457 RecurringTransactionMethods ().checkRecurringTransactions ();
5558 // update last recurring transactions runtime
5659 await _sharedPreferences.setString (
57- 'last_recurring_transactions_check' , DateTime .now ().toIso8601String ());
60+ 'last_recurring_transactions_check' ,
61+ DateTime .now ().toIso8601String (),
62+ );
5863 }
5964
6065 final LocalAuthentication auth = LocalAuthentication ();
6166 if (await auth.isDeviceSupported ()) {
6267 // check for authentication if requested by user
63- bool ? requiresAuthentication =
64- _sharedPreferences.getBool ("user_requires_authentication" );
68+ bool ? requiresAuthentication = _sharedPreferences.getBool (
69+ "user_requires_authentication" ,
70+ );
6571
6672 if (requiresAuthentication != null && requiresAuthentication == true ) {
6773 // use use sticky auth to resume auth request when app is going background
6874 bool didAuthenticate = await auth.authenticate (
69- localizedReason: 'Please authenticate to use Sossoldi' ,
70- options: AuthenticationOptions (stickyAuth: true ));
75+ localizedReason: 'Please authenticate to use Sossoldi' ,
76+ persistAcrossBackgrounding: true ,
77+ );
7178 if (! didAuthenticate) return ; // stops app from loading
7279 }
7380 }
@@ -77,7 +84,7 @@ void main() async {
7784 Phoenix (
7885 child: ProviderScope (
7986 overrides: [versionProvider.overrideWithValue (packageInfo.version)],
80- child: Launcher (),
87+ child: const Launcher (),
8188 ),
8289 ),
8390 ),
@@ -98,8 +105,9 @@ class Launcher extends ConsumerWidget {
98105 title: 'Sossoldi' ,
99106 theme: AppTheme .lightTheme,
100107 darkTheme: AppTheme .darkTheme,
101- themeMode:
102- appThemeState.isDarkModeEnabled ? ThemeMode .dark : ThemeMode .light,
108+ themeMode: appThemeState.isDarkModeEnabled
109+ ? ThemeMode .dark
110+ : ThemeMode .light,
103111 onGenerateRoute: makeRoute,
104112 initialRoute: ! isOnboardingCompleted ? '/onboarding' : '/' ,
105113 );
0 commit comments