From 67a5d61568ec2d68f0b68cc355c9bd986530aa6e Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sat, 1 Jul 2023 14:36:38 +0200 Subject: [PATCH] app,dynamite_runtime,neon,neon_files,neon_news: Cleanup unused ignores --- packages/app/test_driver/integration_test.dart | 4 ++-- .../dynamite_runtime/lib/src/content_string.dart | 2 -- .../neon/neon/lib/src/pages/account_settings.dart | 11 +++++------ packages/neon/neon/lib/src/pages/login.dart | 6 ++++-- .../neon/lib/src/pages/nextcloud_app_settings.dart | 2 -- packages/neon/neon/lib/src/pages/settings.dart | 1 - packages/neon/neon/lib/src/router.dart | 1 - .../neon/neon/lib/src/widgets/text_settings_tile.dart | 3 --- .../neon/neon_files/lib/dialogs/choose_create.dart | 2 -- packages/neon/neon_files/lib/pages/main.dart | 2 -- .../neon/neon_files/lib/widgets/browser_view.dart | 5 ----- packages/neon/neon_news/lib/widgets/feeds_view.dart | 2 -- packages/neon/neon_news/lib/widgets/folders_view.dart | 2 -- 13 files changed, 11 insertions(+), 32 deletions(-) diff --git a/packages/app/test_driver/integration_test.dart b/packages/app/test_driver/integration_test.dart index dfa7edae..02b2879d 100644 --- a/packages/app/test_driver/integration_test.dart +++ b/packages/app/test_driver/integration_test.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:integration_test/integration_test_driver_extended.dart'; Future main() async { @@ -15,7 +16,6 @@ Future main() async { }, ); } catch (e) { - // ignore: avoid_print - print('Error occurred: $e'); + debugPrint('Error occurred: $e'); } } diff --git a/packages/dynamite/dynamite_runtime/lib/src/content_string.dart b/packages/dynamite/dynamite_runtime/lib/src/content_string.dart index ac3063a9..885d7ce9 100644 --- a/packages/dynamite/dynamite_runtime/lib/src/content_string.dart +++ b/packages/dynamite/dynamite_runtime/lib/src/content_string.dart @@ -1,5 +1,3 @@ -// ignore_for_file: avoid_equals_and_hash_code_on_mutable_classes - import 'dart:convert'; import 'package:built_value/built_value.dart'; diff --git a/packages/neon/neon/lib/src/pages/account_settings.dart b/packages/neon/neon/lib/src/pages/account_settings.dart index 134f6105..5084e3c6 100644 --- a/packages/neon/neon/lib/src/pages/account_settings.dart +++ b/packages/neon/neon/lib/src/pages/account_settings.dart @@ -22,21 +22,22 @@ class AccountSettingsPage extends StatelessWidget { actions: [ IconButton( onPressed: () async { - // ignore: use_build_context_synchronously if (await showConfirmationDialog( context, - // ignore: use_build_context_synchronously AppLocalizations.of(context).accountOptionsRemoveConfirm(account.client.humanReadableID), )) { final isActive = bloc.activeAccount.value == account; bloc.removeAccount(account); + // ignore: use_build_context_synchronously + if (!context.mounted) { + return; + } + if (isActive) { - // ignore: use_build_context_synchronously const HomeRoute().go(context); } else { - // ignore: use_build_context_synchronously Navigator.of(context).pop(); } } @@ -46,10 +47,8 @@ class AccountSettingsPage extends StatelessWidget { ), IconButton( onPressed: () async { - // ignore: use_build_context_synchronously if (await showConfirmationDialog( context, - // ignore: use_build_context_synchronously AppLocalizations.of(context).settingsResetForConfirmation(_name), )) { await _options.reset(); diff --git a/packages/neon/neon/lib/src/pages/login.dart b/packages/neon/neon/lib/src/pages/login.dart index 0b0fd7ed..8ca960b9 100644 --- a/packages/neon/neon/lib/src/pages/login.dart +++ b/packages/neon/neon/lib/src/pages/login.dart @@ -84,8 +84,10 @@ class _LoginPageState extends State { ..addAccount(account) ..setActiveAccount(account); } - // ignore: use_build_context_synchronously - const HomeRoute().go(context); + + if (mounted) { + const HomeRoute().go(context); + } } catch (e, s) { debugPrint(e.toString()); debugPrint(s.toString()); diff --git a/packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart b/packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart index e931b028..ac0ec696 100644 --- a/packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart +++ b/packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart @@ -16,10 +16,8 @@ class NextcloudAppSettingsPage extends StatelessWidget { actions: [ IconButton( onPressed: () async { - // ignore: use_build_context_synchronously if (await showConfirmationDialog( context, - // ignore: use_build_context_synchronously AppLocalizations.of(context).settingsResetForConfirmation(appImplementation.name(context)), )) { await appImplementation.options.reset(); diff --git a/packages/neon/neon/lib/src/pages/settings.dart b/packages/neon/neon/lib/src/pages/settings.dart index b2c25118..ac6ede2d 100644 --- a/packages/neon/neon/lib/src/pages/settings.dart +++ b/packages/neon/neon/lib/src/pages/settings.dart @@ -22,7 +22,6 @@ class _SettingsPageState extends State { actions: [ IconButton( onPressed: () async { - // ignore: use_build_context_synchronously if (await showConfirmationDialog(context, AppLocalizations.of(context).settingsResetAllConfirmation)) { await globalOptions.reset(); diff --git a/packages/neon/neon/lib/src/router.dart b/packages/neon/neon/lib/src/router.dart index b37ebb8f..b5adb25a 100644 --- a/packages/neon/neon/lib/src/router.dart +++ b/packages/neon/neon/lib/src/router.dart @@ -1,4 +1,3 @@ -// ignore: prefer_mixin import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:go_router/go_router.dart'; diff --git a/packages/neon/neon/lib/src/widgets/text_settings_tile.dart b/packages/neon/neon/lib/src/widgets/text_settings_tile.dart index e5900bdb..1ee8da23 100644 --- a/packages/neon/neon/lib/src/widgets/text_settings_tile.dart +++ b/packages/neon/neon/lib/src/widgets/text_settings_tile.dart @@ -1,6 +1,3 @@ -// ignore_for_file: use_late_for_private_fields_and_variables -// ^ This is a really strange false positive, it goes of at a very random place without any meaning. Hopefully fixed soon? - part of '../../neon.dart'; class NeonTextSettingsTile extends SettingsTile { diff --git a/packages/neon/neon_files/lib/dialogs/choose_create.dart b/packages/neon/neon_files/lib/dialogs/choose_create.dart index a31e58b0..92332c00 100644 --- a/packages/neon/neon_files/lib/dialogs/choose_create.dart +++ b/packages/neon/neon_files/lib/dialogs/choose_create.dart @@ -32,10 +32,8 @@ class _FilesChooseCreateDialogState extends State { if (sizeWarning != null) { final stat = file.statSync(); if (stat.size > sizeWarning) { - // ignore: use_build_context_synchronously if (!(await showConfirmationDialog( context, - // ignore: use_build_context_synchronously AppLocalizations.of(context).uploadConfirmSizeWarning( filesize(sizeWarning), filesize(stat.size), diff --git a/packages/neon/neon_files/lib/pages/main.dart b/packages/neon/neon_files/lib/pages/main.dart index f3e69f7c..5254b7ba 100644 --- a/packages/neon/neon_files/lib/pages/main.dart +++ b/packages/neon/neon_files/lib/pages/main.dart @@ -30,10 +30,8 @@ class _FilesMainPageState extends State { onPickFile: (final details) async { final sizeWarning = bloc.options.downloadSizeWarning.value; if (sizeWarning != null && details.size != null && details.size! > sizeWarning) { - // ignore: use_build_context_synchronously if (!(await showConfirmationDialog( context, - // ignore: use_build_context_synchronously AppLocalizations.of(context).downloadConfirmSizeWarning( filesize(sizeWarning), filesize(details.size), diff --git a/packages/neon/neon_files/lib/widgets/browser_view.dart b/packages/neon/neon_files/lib/widgets/browser_view.dart index 6bf6a493..5a360487 100644 --- a/packages/neon/neon_files/lib/widgets/browser_view.dart +++ b/packages/neon/neon_files/lib/widgets/browser_view.dart @@ -399,10 +399,8 @@ class _FilesBrowserViewState extends State { case FilesFileAction.sync: final sizeWarning = widget.bloc.options.downloadSizeWarning.value; if (sizeWarning != null && details.size != null && details.size! > sizeWarning) { - // ignore: use_build_context_synchronously if (!(await showConfirmationDialog( context, - // ignore: use_build_context_synchronously AppLocalizations.of(context).downloadConfirmSizeWarning( filesize(sizeWarning), filesize(details.size), @@ -414,13 +412,10 @@ class _FilesBrowserViewState extends State { widget.filesBloc.syncFile(details.path); break; case FilesFileAction.delete: - // ignore: use_build_context_synchronously if (await showConfirmationDialog( context, details.isDirectory - // ignore: use_build_context_synchronously ? AppLocalizations.of(context).folderDeleteConfirm(details.name) - // ignore: use_build_context_synchronously : AppLocalizations.of(context).fileDeleteConfirm(details.name), )) { widget.filesBloc.delete(details.path); diff --git a/packages/neon/neon_news/lib/widgets/feeds_view.dart b/packages/neon/neon_news/lib/widgets/feeds_view.dart index 4717f0b7..79caf501 100644 --- a/packages/neon/neon_news/lib/widgets/feeds_view.dart +++ b/packages/neon/neon_news/lib/widgets/feeds_view.dart @@ -113,10 +113,8 @@ class NewsFeedsView extends StatelessWidget { ); break; case NewsFeedAction.delete: - // ignore: use_build_context_synchronously if (await showConfirmationDialog( context, - // ignore: use_build_context_synchronously AppLocalizations.of(context).feedRemoveConfirm(feed.title), )) { bloc.removeFeed(feed.id); diff --git a/packages/neon/neon_news/lib/widgets/folders_view.dart b/packages/neon/neon_news/lib/widgets/folders_view.dart index 2a9305dc..aa0b0a25 100644 --- a/packages/neon/neon_news/lib/widgets/folders_view.dart +++ b/packages/neon/neon_news/lib/widgets/folders_view.dart @@ -86,10 +86,8 @@ class NewsFoldersView extends StatelessWidget { onSelected: (final action) async { switch (action) { case NewsFolderAction.delete: - // ignore: use_build_context_synchronously if (await showConfirmationDialog( context, - // ignore: use_build_context_synchronously AppLocalizations.of(context).folderDeleteConfirm(folder.name), )) { bloc.deleteFolder(folder.id);