Skip to content

Commit

Permalink
there we go, good linter :>
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastGimbus committed Feb 23, 2024
1 parent c668b01 commit cb0a245
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ui/pages/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class _HomePageState extends State<HomePage> {
}

void _introCheck() async {
final settings = context.read<AppSettings>();
final ctx = context;
final settings = ctx.read<AppSettings>();
if (!(await settings.seenIntroduction.first)) {
// https://dart-lang.github.io/linter/lints/use_build_context_synchronously.html
if (!context.mounted) return;
if (!ctx.mounted) return;
// true from this route means all success and we can set the flag
// false means user exited otherwise or smth - anyway, don't set the flag
final success =
// ignore: use_build_context_synchronously
await Navigator.of(context).pushNamed('/introduction') as bool?;
await Navigator.of(ctx).pushNamed('/introduction') as bool?;
if (success ?? false) {
await settings.setSeenIntroduction(true);
}
Expand Down

0 comments on commit cb0a245

Please sign in to comment.