diff --git a/lib/pages/receive_history_page.dart b/lib/pages/receive_history_page.dart index 12ad90eb..cdc2cbaa 100644 --- a/lib/pages/receive_history_page.dart +++ b/lib/pages/receive_history_page.dart @@ -146,6 +146,7 @@ class ReceiveHistoryPage extends StatelessWidget { await _openFile(context, entry, ref.notifier(receiveHistoryProvider)); break; case _EntryOption.info: + // ignore: use_build_context_synchronously await showDialog( context: context, builder: (_) => FileInfoDialog(entry: entry), diff --git a/lib/pages/tabs/settings_tab.dart b/lib/pages/tabs/settings_tab.dart index dcaec9e5..b3d8ddc4 100644 --- a/lib/pages/tabs/settings_tab.dart +++ b/lib/pages/tabs/settings_tab.dart @@ -318,6 +318,7 @@ class _SettingsTabState extends State with Riverpie { try { await ref.notifier(serverProvider).startServerFromSettings(); } catch (e) { + // ignore: use_build_context_synchronously context.showSnackBar(e.toString()); } }, @@ -345,6 +346,7 @@ class _SettingsTabState extends State with Riverpie { await ref.notifier(settingsProvider).setPort(newServerState.port); } } catch (e) { + // ignore: use_build_context_synchronously context.showSnackBar(e.toString()); } }, diff --git a/lib/util/native/file_picker.dart b/lib/util/native/file_picker.dart index 92e8bbd0..4c46187e 100644 --- a/lib/util/native/file_picker.dart +++ b/lib/util/native/file_picker.dart @@ -144,7 +144,9 @@ enum FilePickerOption { } break; case FilePickerOption.media: + // ignore: use_build_context_synchronously final oldBrightness = Theme.of(context).brightness; + // ignore: use_build_context_synchronously final List? result = await AssetPicker.pickAssets( context, pickerConfig: const AssetPickerConfig(maxAssets: 999, textDelegate: TranslatedAssetPickerTextDelegate()), @@ -166,6 +168,7 @@ enum FilePickerOption { } break; case FilePickerOption.text: + // ignore: use_build_context_synchronously final result = await showDialog(context: context, builder: (_) => const MessageInputDialog()); if (result != null) { ref.notifier(selectedSendingFilesProvider).addMessage(result); @@ -173,6 +176,7 @@ enum FilePickerOption { break; case FilePickerOption.app: // Currently, only Android APK + // ignore: use_build_context_synchronously await context.push(() => const ApkPickerPage()); break; }