From ba3b4e556bba2d7865d83db48a2cc2088d06bc2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Sat, 10 Feb 2024 15:14:58 +0100 Subject: [PATCH] fix: adhere to lints without ignore --- lib/views/home.dart | 8 +++----- lib/views/recurring_view.dart | 4 +--- lib/views/settings/edit_categories.dart | 6 ++---- lib/views/settings/graph_type.dart | 6 ++---- lib/views/settings/tessdata_list.dart | 10 +++++----- lib/views/setup.dart | 6 ++---- 6 files changed, 15 insertions(+), 25 deletions(-) diff --git a/lib/views/home.dart b/lib/views/home.dart index 6e43614..aafcd5f 100644 --- a/lib/views/home.dart +++ b/lib/views/home.dart @@ -1,5 +1,3 @@ -// ignore_for_file: inference_failure_on_function_invocation - import 'dart:async'; import 'package:dynamic_color/dynamic_color.dart'; @@ -464,7 +462,7 @@ class _HomeViewState extends State { .onError, icon: Icons.delete, onPressed: (c) { - showAdaptiveDialog( + showAdaptiveDialog( context: context, builder: (cx) => AlertDialog.adaptive( @@ -615,7 +613,7 @@ class _HomeViewState extends State { final availableLanguages = await TessdataApi.getDownloadedData(); if (availableLanguages.isEmpty) { if (!mounted) return; - await showAdaptiveDialog( + await showAdaptiveDialog( context: context, builder: (c) => AlertDialog.adaptive( title: Text(AppLocalizations.of(context).missingOcr), @@ -648,7 +646,7 @@ class _HomeViewState extends State { List.filled(availableLanguages.length, false); selectedLanguages[0] = true; - await showAdaptiveDialog( + await showAdaptiveDialog( context: context, builder: (c) => StatefulBuilder( builder: (ctx, setState) => AlertDialog.adaptive( diff --git a/lib/views/recurring_view.dart b/lib/views/recurring_view.dart index c98ef8d..64f1203 100644 --- a/lib/views/recurring_view.dart +++ b/lib/views/recurring_view.dart @@ -1,5 +1,3 @@ -// ignore_for_file: inference_failure_on_function_invocation - import 'dart:async'; import 'package:flutter/material.dart'; @@ -208,7 +206,7 @@ class _RecurringEntriesViewState extends State { Theme.of(context).colorScheme.onError, icon: Icons.delete, onPressed: (c) { - showDialog( + showDialog( context: context, builder: (cx) => AlertDialog.adaptive( title: Text( diff --git a/lib/views/settings/edit_categories.dart b/lib/views/settings/edit_categories.dart index 2e004b4..b1ec924 100644 --- a/lib/views/settings/edit_categories.dart +++ b/lib/views/settings/edit_categories.dart @@ -1,5 +1,3 @@ -// ignore_for_file: inference_failure_on_function_invocation - import 'dart:async'; import 'package:dynamic_color/dynamic_color.dart'; @@ -142,7 +140,7 @@ class _EditCategoriesViewState extends State { .getBool("useMaterialYou") ?? false; if (!context.mounted) return; - await showAdaptiveDialog( + await showAdaptiveDialog( context: context, builder: (c) => AlertDialog.adaptive( actions: [ @@ -211,7 +209,7 @@ class _EditCategoriesViewState extends State { final controller = TextEditingController( text: selectedWallet!.categories[i].name, ); - showAdaptiveDialog( + showAdaptiveDialog( context: context, builder: (c) => AlertDialog.adaptive( actions: [ diff --git a/lib/views/settings/graph_type.dart b/lib/views/settings/graph_type.dart index 404f055..332b84d 100644 --- a/lib/views/settings/graph_type.dart +++ b/lib/views/settings/graph_type.dart @@ -1,5 +1,3 @@ -// ignore_for_file: inference_failure_on_function_invocation - import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:settings_ui/settings_ui.dart'; @@ -49,7 +47,7 @@ class _GraphTypeSettingsViewState extends State { ? AppLocalizations.of(context).barChart : AppLocalizations.of(context).lineChart, ), - onPressed: (c) => showAdaptiveDialog( + onPressed: (c) => showAdaptiveDialog( context: c, builder: (ctx) => AlertDialog.adaptive( title: Text(AppLocalizations.of(context).selectType), @@ -107,7 +105,7 @@ class _GraphTypeSettingsViewState extends State { ? AppLocalizations.of(context).barChart : AppLocalizations.of(context).lineChart, ), - onPressed: (c) => showDialog( + onPressed: (c) => showAdaptiveDialog( context: c, builder: (ctx) => AlertDialog.adaptive( title: Text(AppLocalizations.of(context).selectType), diff --git a/lib/views/settings/tessdata_list.dart b/lib/views/settings/tessdata_list.dart index 45443b4..890738f 100644 --- a/lib/views/settings/tessdata_list.dart +++ b/lib/views/settings/tessdata_list.dart @@ -1,5 +1,3 @@ -// ignore_for_file: inference_failure_on_function_invocation - import 'dart:async'; import 'dart:io'; @@ -61,7 +59,7 @@ class _TessdataListViewState extends State { final lang = _tessdata[i].keys.first; if (_tessdata[i][lang]!) { // deleting data - await showAdaptiveDialog( + await showAdaptiveDialog( context: context, builder: (context) => AlertDialog.adaptive( title: @@ -101,8 +99,10 @@ class _TessdataListViewState extends State { showAdaptiveDialog( context: context, builder: (c) => AlertDialog.adaptive( - title: Text(AppLocalizations.of(context) - .langDownloadDialog(lang),), + title: Text( + AppLocalizations.of(context) + .langDownloadDialog(lang), + ), content: StreamBuilder( builder: (context, snapshot) { if (snapshot.connectionState == diff --git a/lib/views/setup.dart b/lib/views/setup.dart index b1d1ef1..155b91e 100644 --- a/lib/views/setup.dart +++ b/lib/views/setup.dart @@ -1,5 +1,3 @@ -// ignore_for_file: inference_failure_on_function_invocation - import 'dart:async'; import 'package:currency_picker/currency_picker.dart'; @@ -321,7 +319,7 @@ class _SetupViewState extends State { .getBool("useMaterialYou") ?? false; if (!context.mounted) return; - await showAdaptiveDialog( + await showAdaptiveDialog( context: context, builder: (c) => AlertDialog.adaptive( actions: [ @@ -388,7 +386,7 @@ class _SetupViewState extends State { final controller = TextEditingController( text: categories[i].name, ); - showAdaptiveDialog( + showAdaptiveDialog( context: context, builder: (c) => AlertDialog.adaptive( actions: [