Browse Source

Merge pull request #438 from provokateurin/cleanup/unused-ignores

app,dynamite_runtime,neon,neon_files,neon_news: Cleanup unused ignores
pull/440/head
Kate 1 year ago committed by GitHub
parent
commit
2c71579638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      packages/app/test_driver/integration_test.dart
  2. 2
      packages/dynamite/dynamite_runtime/lib/src/content_string.dart
  3. 11
      packages/neon/neon/lib/src/pages/account_settings.dart
  4. 6
      packages/neon/neon/lib/src/pages/login.dart
  5. 2
      packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart
  6. 1
      packages/neon/neon/lib/src/pages/settings.dart
  7. 1
      packages/neon/neon/lib/src/router.dart
  8. 3
      packages/neon/neon/lib/src/widgets/text_settings_tile.dart
  9. 2
      packages/neon/neon_files/lib/dialogs/choose_create.dart
  10. 2
      packages/neon/neon_files/lib/pages/main.dart
  11. 5
      packages/neon/neon_files/lib/widgets/browser_view.dart
  12. 2
      packages/neon/neon_news/lib/widgets/feeds_view.dart
  13. 2
      packages/neon/neon_news/lib/widgets/folders_view.dart

4
packages/app/test_driver/integration_test.dart

@ -1,5 +1,6 @@
import 'dart:io'; import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:integration_test/integration_test_driver_extended.dart'; import 'package:integration_test/integration_test_driver_extended.dart';
Future<void> main() async { Future<void> main() async {
@ -15,7 +16,6 @@ Future<void> main() async {
}, },
); );
} catch (e) { } catch (e) {
// ignore: avoid_print debugPrint('Error occurred: $e');
print('Error occurred: $e');
} }
} }

2
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 'dart:convert';
import 'package:built_value/built_value.dart'; import 'package:built_value/built_value.dart';

11
packages/neon/neon/lib/src/pages/account_settings.dart

@ -22,21 +22,22 @@ class AccountSettingsPage extends StatelessWidget {
actions: [ actions: [
IconButton( IconButton(
onPressed: () async { onPressed: () async {
// ignore: use_build_context_synchronously
if (await showConfirmationDialog( if (await showConfirmationDialog(
context, context,
// ignore: use_build_context_synchronously
AppLocalizations.of(context).accountOptionsRemoveConfirm(account.client.humanReadableID), AppLocalizations.of(context).accountOptionsRemoveConfirm(account.client.humanReadableID),
)) { )) {
final isActive = bloc.activeAccount.value == account; final isActive = bloc.activeAccount.value == account;
bloc.removeAccount(account); bloc.removeAccount(account);
// ignore: use_build_context_synchronously
if (!context.mounted) {
return;
}
if (isActive) { if (isActive) {
// ignore: use_build_context_synchronously
const HomeRoute().go(context); const HomeRoute().go(context);
} else { } else {
// ignore: use_build_context_synchronously
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} }
@ -46,10 +47,8 @@ class AccountSettingsPage extends StatelessWidget {
), ),
IconButton( IconButton(
onPressed: () async { onPressed: () async {
// ignore: use_build_context_synchronously
if (await showConfirmationDialog( if (await showConfirmationDialog(
context, context,
// ignore: use_build_context_synchronously
AppLocalizations.of(context).settingsResetForConfirmation(_name), AppLocalizations.of(context).settingsResetForConfirmation(_name),
)) { )) {
await _options.reset(); await _options.reset();

6
packages/neon/neon/lib/src/pages/login.dart

@ -84,8 +84,10 @@ class _LoginPageState extends State<LoginPage> {
..addAccount(account) ..addAccount(account)
..setActiveAccount(account); ..setActiveAccount(account);
} }
// ignore: use_build_context_synchronously
const HomeRoute().go(context); if (mounted) {
const HomeRoute().go(context);
}
} catch (e, s) { } catch (e, s) {
debugPrint(e.toString()); debugPrint(e.toString());
debugPrint(s.toString()); debugPrint(s.toString());

2
packages/neon/neon/lib/src/pages/nextcloud_app_settings.dart

@ -16,10 +16,8 @@ class NextcloudAppSettingsPage extends StatelessWidget {
actions: [ actions: [
IconButton( IconButton(
onPressed: () async { onPressed: () async {
// ignore: use_build_context_synchronously
if (await showConfirmationDialog( if (await showConfirmationDialog(
context, context,
// ignore: use_build_context_synchronously
AppLocalizations.of(context).settingsResetForConfirmation(appImplementation.name(context)), AppLocalizations.of(context).settingsResetForConfirmation(appImplementation.name(context)),
)) { )) {
await appImplementation.options.reset(); await appImplementation.options.reset();

1
packages/neon/neon/lib/src/pages/settings.dart

@ -22,7 +22,6 @@ class _SettingsPageState extends State<SettingsPage> {
actions: [ actions: [
IconButton( IconButton(
onPressed: () async { onPressed: () async {
// ignore: use_build_context_synchronously
if (await showConfirmationDialog(context, AppLocalizations.of(context).settingsResetAllConfirmation)) { if (await showConfirmationDialog(context, AppLocalizations.of(context).settingsResetAllConfirmation)) {
await globalOptions.reset(); await globalOptions.reset();

1
packages/neon/neon/lib/src/router.dart

@ -1,4 +1,3 @@
// ignore: prefer_mixin
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';

3
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'; part of '../../neon.dart';
class NeonTextSettingsTile extends SettingsTile { class NeonTextSettingsTile extends SettingsTile {

2
packages/neon/neon_files/lib/dialogs/choose_create.dart

@ -32,10 +32,8 @@ class _FilesChooseCreateDialogState extends State<FilesChooseCreateDialog> {
if (sizeWarning != null) { if (sizeWarning != null) {
final stat = file.statSync(); final stat = file.statSync();
if (stat.size > sizeWarning) { if (stat.size > sizeWarning) {
// ignore: use_build_context_synchronously
if (!(await showConfirmationDialog( if (!(await showConfirmationDialog(
context, context,
// ignore: use_build_context_synchronously
AppLocalizations.of(context).uploadConfirmSizeWarning( AppLocalizations.of(context).uploadConfirmSizeWarning(
filesize(sizeWarning), filesize(sizeWarning),
filesize(stat.size), filesize(stat.size),

2
packages/neon/neon_files/lib/pages/main.dart

@ -30,10 +30,8 @@ class _FilesMainPageState extends State<FilesMainPage> {
onPickFile: (final details) async { onPickFile: (final details) async {
final sizeWarning = bloc.options.downloadSizeWarning.value; final sizeWarning = bloc.options.downloadSizeWarning.value;
if (sizeWarning != null && details.size != null && details.size! > sizeWarning) { if (sizeWarning != null && details.size != null && details.size! > sizeWarning) {
// ignore: use_build_context_synchronously
if (!(await showConfirmationDialog( if (!(await showConfirmationDialog(
context, context,
// ignore: use_build_context_synchronously
AppLocalizations.of(context).downloadConfirmSizeWarning( AppLocalizations.of(context).downloadConfirmSizeWarning(
filesize(sizeWarning), filesize(sizeWarning),
filesize(details.size), filesize(details.size),

5
packages/neon/neon_files/lib/widgets/browser_view.dart

@ -399,10 +399,8 @@ class _FilesBrowserViewState extends State<FilesBrowserView> {
case FilesFileAction.sync: case FilesFileAction.sync:
final sizeWarning = widget.bloc.options.downloadSizeWarning.value; final sizeWarning = widget.bloc.options.downloadSizeWarning.value;
if (sizeWarning != null && details.size != null && details.size! > sizeWarning) { if (sizeWarning != null && details.size != null && details.size! > sizeWarning) {
// ignore: use_build_context_synchronously
if (!(await showConfirmationDialog( if (!(await showConfirmationDialog(
context, context,
// ignore: use_build_context_synchronously
AppLocalizations.of(context).downloadConfirmSizeWarning( AppLocalizations.of(context).downloadConfirmSizeWarning(
filesize(sizeWarning), filesize(sizeWarning),
filesize(details.size), filesize(details.size),
@ -414,13 +412,10 @@ class _FilesBrowserViewState extends State<FilesBrowserView> {
widget.filesBloc.syncFile(details.path); widget.filesBloc.syncFile(details.path);
break; break;
case FilesFileAction.delete: case FilesFileAction.delete:
// ignore: use_build_context_synchronously
if (await showConfirmationDialog( if (await showConfirmationDialog(
context, context,
details.isDirectory details.isDirectory
// ignore: use_build_context_synchronously
? AppLocalizations.of(context).folderDeleteConfirm(details.name) ? AppLocalizations.of(context).folderDeleteConfirm(details.name)
// ignore: use_build_context_synchronously
: AppLocalizations.of(context).fileDeleteConfirm(details.name), : AppLocalizations.of(context).fileDeleteConfirm(details.name),
)) { )) {
widget.filesBloc.delete(details.path); widget.filesBloc.delete(details.path);

2
packages/neon/neon_news/lib/widgets/feeds_view.dart

@ -113,10 +113,8 @@ class NewsFeedsView extends StatelessWidget {
); );
break; break;
case NewsFeedAction.delete: case NewsFeedAction.delete:
// ignore: use_build_context_synchronously
if (await showConfirmationDialog( if (await showConfirmationDialog(
context, context,
// ignore: use_build_context_synchronously
AppLocalizations.of(context).feedRemoveConfirm(feed.title), AppLocalizations.of(context).feedRemoveConfirm(feed.title),
)) { )) {
bloc.removeFeed(feed.id); bloc.removeFeed(feed.id);

2
packages/neon/neon_news/lib/widgets/folders_view.dart

@ -86,10 +86,8 @@ class NewsFoldersView extends StatelessWidget {
onSelected: (final action) async { onSelected: (final action) async {
switch (action) { switch (action) {
case NewsFolderAction.delete: case NewsFolderAction.delete:
// ignore: use_build_context_synchronously
if (await showConfirmationDialog( if (await showConfirmationDialog(
context, context,
// ignore: use_build_context_synchronously
AppLocalizations.of(context).folderDeleteConfirm(folder.name), AppLocalizations.of(context).folderDeleteConfirm(folder.name),
)) { )) {
bloc.deleteFolder(folder.id); bloc.deleteFolder(folder.id);

Loading…
Cancel
Save