refactor: Enable lint use_build_context_synchronously
This commit is contained in:
parent
a3fc1bff01
commit
3296c0d92d
50 changed files with 490 additions and 293 deletions
|
|
@ -4,6 +4,7 @@ import 'package:fluffychat/widgets/matrix.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
Future<void> restoreBackupFlow(BuildContext context) async {
|
||||
final matrix = Matrix.of(context);
|
||||
final picked = await selectFiles(context);
|
||||
final file = picked.firstOrNull;
|
||||
if (file == null) return;
|
||||
|
|
@ -12,9 +13,9 @@ Future<void> restoreBackupFlow(BuildContext context) async {
|
|||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () async {
|
||||
final client = await Matrix.of(context).getLoginClient();
|
||||
final client = await matrix.getLoginClient();
|
||||
await client.importDump(String.fromCharCodes(await file.readAsBytes()));
|
||||
Matrix.of(context).initMatrix();
|
||||
matrix.initMatrix();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@ class IntroPage extends StatelessWidget {
|
|||
final client = await Matrix.of(
|
||||
context,
|
||||
).getLoginClient();
|
||||
if (!context.mounted) return;
|
||||
context.go(
|
||||
'${GoRouterState.of(context).uri.path}/login',
|
||||
extra: client,
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ class _IntroPagePresenterState extends State<IntroPagePresenter> {
|
|||
final client = await Matrix.of(context).getLoginClient();
|
||||
await client.checkHomeserver(homeserverUrl);
|
||||
await client.oidcLogin(session: session, code: code, state: state);
|
||||
if (context.mounted) context.go('/backup');
|
||||
if (!mounted) return;
|
||||
context.go('/backup');
|
||||
} catch (e, s) {
|
||||
Logs().w('Unable to login via OIDC', e, s);
|
||||
if (mounted) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue