diff --git a/analysis_options.yaml b/analysis_options.yaml index 6e24b30..abc794e 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -24,7 +24,6 @@ linter: - always_declare_return_types - always_put_control_body_on_new_line - always_put_required_named_parameters_first - - always_specify_types - annotate_overrides - annotate_redeclares - avoid_annotating_with_dynamic @@ -123,6 +122,7 @@ linter: - noop_primitive_operations - null_check_on_nullable_type_parameter - null_closures + - omit_obvious_local_variable_types - one_member_abstracts - only_throw_errors - overridden_fields diff --git a/lib/Pages/Dashboard/dashboard.dart b/lib/Pages/Dashboard/dashboard.dart index aa107c2..1799542 100644 --- a/lib/Pages/Dashboard/dashboard.dart +++ b/lib/Pages/Dashboard/dashboard.dart @@ -14,10 +14,10 @@ class Dashboard extends StatelessWidget { /// [context] ist der Build-Kontext @override Widget build(final BuildContext context) { - const double currentBalance = 4820.75; + const currentBalance = 4820.75; const double previousMonthBalance = 4300; - final Map monthlyBalance = { + final monthlyBalance = { 'Jan': 1200.0, 'Feb': 900.0, 'Mär': 1100.0, @@ -26,7 +26,7 @@ class Dashboard extends StatelessWidget { 'Jun': 1050.0, }; - final List> recentTransactions = >[ + final recentTransactions = >[ {'name': 'Supermarkt', 'amount': -45.50}, {'name': 'Gehalt', 'amount': 2500.00}, {'name': 'Miete', 'amount': -900.00}, diff --git a/lib/Pages/Settings/settings.dart b/lib/Pages/Settings/settings.dart index e48d6bd..2803de0 100644 --- a/lib/Pages/Settings/settings.dart +++ b/lib/Pages/Settings/settings.dart @@ -15,7 +15,7 @@ class _SettingsState extends State { ]; Future _addAccount() async { - final TextEditingController controller = TextEditingController(); + final controller = TextEditingController(); await showDialog( context: context, @@ -49,7 +49,7 @@ class _SettingsState extends State { } Future _renameAccount(final int index) async { - final TextEditingController controller = TextEditingController( + final controller = TextEditingController( text: _accounts[index], ); diff --git a/lib/Pages/Trend/trend.dart b/lib/Pages/Trend/trend.dart index 419a224..7f75424 100644 --- a/lib/Pages/Trend/trend.dart +++ b/lib/Pages/Trend/trend.dart @@ -76,7 +76,7 @@ class _TrendState extends State { } Future _pickDateRange() async { - final DateTime now = DateTime.now(); + final now = DateTime.now(); final DateTimeRange? picked = await showDateRangePicker( context: context, firstDate: DateTime(now.year - 5), @@ -91,7 +91,7 @@ class _TrendState extends State { } void _updateUrl() { - final Map params = { + final params = { if (nameController.text.isNotEmpty) 'name': nameController.text, if (minController.text.isNotEmpty) 'min': minController.text, if (maxController.text.isNotEmpty) 'max': maxController.text, @@ -104,7 +104,7 @@ class _TrendState extends State { } String _monthName(final int month) { - const List names = [ + const names = [ '', 'Januar', 'Februar', @@ -135,9 +135,9 @@ class _TrendState extends State { final List> filteredTransactions = transactions.where((final Map tx) { - final DateTime date = tx['date']! as DateTime; + final date = tx['date']! as DateTime; - bool rangeMatch = true; + var rangeMatch = true; if (selectedRange != null) { rangeMatch = !date.isBefore(selectedRange!.start) && @@ -147,7 +147,7 @@ class _TrendState extends State { final bool nameMatch = searchName.isEmpty || ((tx['name'] ?? '') as String).contains(searchName); - final double amount = (tx['amount'] ?? 0) as double; + final amount = (tx['amount'] ?? 0) as double; final bool amountMatch = (minAmount == null || amount >= minAmount) && (maxAmount == null || amount <= maxAmount); @@ -158,11 +158,10 @@ class _TrendState extends State { (b['date']! as DateTime).compareTo(a['date']! as DateTime), ); - final Map>> transactionsByMonth = - >>{}; - for (final Map tx in filteredTransactions) { - final DateTime date = tx['date']! as DateTime; - final String monthName = '${_monthName(date.month)} ${date.year}'; + final transactionsByMonth = >>{}; + for (final tx in filteredTransactions) { + final date = tx['date']! as DateTime; + final monthName = '${_monthName(date.month)} ${date.year}'; transactionsByMonth .putIfAbsent(monthName, () => >[]) .add(tx); @@ -339,8 +338,8 @@ class _TrendState extends State { final int index, ) { final Map tx = entry.value[index]; - final double amount = (tx['amount'] ?? 0) as double; - final DateTime date = tx['date']! as DateTime; + final amount = (tx['amount'] ?? 0) as double; + final date = tx['date']! as DateTime; return ListTile( contentPadding: EdgeInsets.zero, title: Text((tx['name'] ?? '') as String),