@@ -195,53 +195,52 @@ class _LoginScreen extends State<LoginScreen> {
195
195
}
196
196
data.info.value.lastUsername = _username;
197
197
Navigator .pushNamed (context, SplashScreen .routeName);
198
- data.info.save ().whenComplete (() async {
199
- try {
200
- enc.Key key = _derivedPassword == null
201
- ? enc.Key .fromUtf8 (
202
- _password + (' ' * (32 - utf8.encode (_password).length)))
203
- : enc.Key (Uint8List .fromList (_derivedPassword));
204
- LoadedAccount _account = await data.loadAccount (
205
- data.info.value.lastUsername,
206
- _derivedPassword == null
207
- ? getPassyEncrypter (_password)
208
- : getPassyEncrypterFromBytes (
209
- Uint8List .fromList (_derivedPassword)),
210
- key,
211
- encryptedPassword:
212
- encrypt (_password, encrypter: enc.Encrypter (enc.AES (key))));
213
- Navigator .pop (context);
214
- if (isAutofill) {
215
- Navigator .pushNamed (
216
- context,
217
- SearchScreen .routeName,
218
- arguments: SearchScreenArgs (
219
- entryType: null ,
220
- builder: _buildPasswords,
221
- isAutofill: true ,
222
- ),
223
- );
224
- return ;
225
- }
226
- _account.startAutoSync ();
227
- if (Platform .isAndroid) {
228
- FlutterSecureScreen .singleton
229
- .setAndroidScreenSecure (_account.protectScreen);
230
- }
231
- Navigator .pushReplacementNamed (context, MainScreen .routeName);
232
- } catch (e, s) {
233
- showSnackBar (
234
- message: localizations.couldNotLogin,
235
- icon: const Icon (Icons .lock_rounded,
236
- color: PassyTheme .darkContentColor),
237
- action: SnackBarAction (
238
- label: localizations.details,
239
- onPressed: () => Navigator .pushNamed (context, LogScreen .routeName,
240
- arguments: e.toString () + '\n ' + s.toString ()),
198
+ await data.info.save ();
199
+ try {
200
+ enc.Key key = _derivedPassword == null
201
+ ? enc.Key .fromUtf8 (
202
+ _password + (' ' * (32 - utf8.encode (_password).length)))
203
+ : enc.Key (Uint8List .fromList (_derivedPassword));
204
+ LoadedAccount _account = await data.loadAccount (
205
+ data.info.value.lastUsername,
206
+ _derivedPassword == null
207
+ ? getPassyEncrypter (_password)
208
+ : getPassyEncrypterFromBytes (
209
+ Uint8List .fromList (_derivedPassword)),
210
+ key,
211
+ encryptedPassword:
212
+ encrypt (_password, encrypter: enc.Encrypter (enc.AES (key))));
213
+ Navigator .pop (context);
214
+ if (isAutofill) {
215
+ Navigator .pushNamed (
216
+ context,
217
+ SearchScreen .routeName,
218
+ arguments: SearchScreenArgs (
219
+ entryType: null ,
220
+ builder: _buildPasswords,
221
+ isAutofill: true ,
241
222
),
242
223
);
224
+ return ;
225
+ }
226
+ _account.startAutoSync ();
227
+ if (Platform .isAndroid) {
228
+ FlutterSecureScreen .singleton
229
+ .setAndroidScreenSecure (_account.protectScreen);
243
230
}
244
- });
231
+ Navigator .pushReplacementNamed (context, MainScreen .routeName);
232
+ } catch (e, s) {
233
+ showSnackBar (
234
+ message: localizations.couldNotLogin,
235
+ icon:
236
+ const Icon (Icons .lock_rounded, color: PassyTheme .darkContentColor),
237
+ action: SnackBarAction (
238
+ label: localizations.details,
239
+ onPressed: () => Navigator .pushNamed (context, LogScreen .routeName,
240
+ arguments: e.toString () + '\n ' + s.toString ()),
241
+ ),
242
+ );
243
+ }
245
244
}
246
245
247
246
void updateBioAuthButton () {
0 commit comments