diff --git a/packages/neon/neon_news/lib/pages/article.dart b/packages/neon/neon_news/lib/pages/article.dart index 1aaf4766..d6413630 100644 --- a/packages/neon/neon_news/lib/pages/article.dart +++ b/packages/neon/neon_news/lib/pages/article.dart @@ -33,9 +33,9 @@ class _NewsArticlePageState extends State { NeonException.showSnackbar(context, error); }); - WidgetsBinding.instance.addPostFrameCallback((final _) async { + WidgetsBinding.instance.addPostFrameCallback((final _) { if (Provider.of(context, listen: false).canUseWakelock) { - await WakelockPlus.enable(); + unawaited(WakelockPlus.enable()); } }); @@ -103,7 +103,7 @@ class _NewsArticlePageState extends State { } if (mounted && Provider.of(context, listen: false).canUseWakelock) { - await WakelockPlus.disable(); + unawaited(WakelockPlus.disable()); } return false; }, diff --git a/packages/neon/neon_notes/lib/pages/note.dart b/packages/neon/neon_notes/lib/pages/note.dart index 06e40bdc..9a247d50 100644 --- a/packages/neon/neon_notes/lib/pages/note.dart +++ b/packages/neon/neon_notes/lib/pages/note.dart @@ -41,9 +41,9 @@ class _NotesNotePageState extends State { _contentController.addListener(() => _contentStreamController.add(_contentController.text)); _titleController.addListener(() => _titleStreamController.add(_titleController.text)); - WidgetsBinding.instance.addPostFrameCallback((final _) async { + WidgetsBinding.instance.addPostFrameCallback((final _) { if (Provider.of(context, listen: false).canUseWakelock) { - await WakelockPlus.enable(); + unawaited(WakelockPlus.enable()); } if (widget.bloc.options.defaultNoteViewTypeOption.value == DefaultNoteViewType.edit || widget.bloc.initialContent.isEmpty) { @@ -66,7 +66,7 @@ class _NotesNotePageState extends State { Widget build(final BuildContext context) => BackButtonListener( onBackButtonPressed: () async { if (Provider.of(context, listen: false).canUseWakelock) { - await WakelockPlus.disable(); + unawaited(WakelockPlus.disable()); } return false; },