Ref: Passt Linter-Rules an

This commit is contained in:
2025-12-22 03:34:15 +01:00
parent 92fec89333
commit 7a76f0d40e
4 changed files with 18 additions and 19 deletions

View File

@@ -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<String, double> monthlyBalance = <String, double>{
final monthlyBalance = <String, double>{
'Jan': 1200.0,
'Feb': 900.0,
'Mär': 1100.0,
@@ -26,7 +26,7 @@ class Dashboard extends StatelessWidget {
'Jun': 1050.0,
};
final List<Map<String, Object>> recentTransactions = <Map<String, Object>>[
final recentTransactions = <Map<String, Object>>[
<String, Object>{'name': 'Supermarkt', 'amount': -45.50},
<String, Object>{'name': 'Gehalt', 'amount': 2500.00},
<String, Object>{'name': 'Miete', 'amount': -900.00},

View File

@@ -15,7 +15,7 @@ class _SettingsState extends State<Settings> {
];
Future<void> _addAccount() async {
final TextEditingController controller = TextEditingController();
final controller = TextEditingController();
await showDialog(
context: context,
@@ -49,7 +49,7 @@ class _SettingsState extends State<Settings> {
}
Future<void> _renameAccount(final int index) async {
final TextEditingController controller = TextEditingController(
final controller = TextEditingController(
text: _accounts[index],
);

View File

@@ -76,7 +76,7 @@ class _TrendState extends State<Trend> {
}
Future<void> _pickDateRange() async {
final DateTime now = DateTime.now();
final now = DateTime.now();
final DateTimeRange<DateTime>? picked = await showDateRangePicker(
context: context,
firstDate: DateTime(now.year - 5),
@@ -91,7 +91,7 @@ class _TrendState extends State<Trend> {
}
void _updateUrl() {
final Map<String, String> params = <String, String>{
final params = <String, String>{
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<Trend> {
}
String _monthName(final int month) {
const List<String> names = <String>[
const names = <String>[
'',
'Januar',
'Februar',
@@ -135,9 +135,9 @@ class _TrendState extends State<Trend> {
final List<Map<String, Object>> filteredTransactions =
transactions.where((final Map<String, Object> 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<Trend> {
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<Trend> {
(b['date']! as DateTime).compareTo(a['date']! as DateTime),
);
final Map<String, List<Map<String, Object>>> transactionsByMonth =
<String, List<Map<String, Object>>>{};
for (final Map<String, Object> tx in filteredTransactions) {
final DateTime date = tx['date']! as DateTime;
final String monthName = '${_monthName(date.month)} ${date.year}';
final transactionsByMonth = <String, List<Map<String, Object>>>{};
for (final tx in filteredTransactions) {
final date = tx['date']! as DateTime;
final monthName = '${_monthName(date.month)} ${date.year}';
transactionsByMonth
.putIfAbsent(monthName, () => <Map<String, Object>>[])
.add(tx);
@@ -339,8 +338,8 @@ class _TrendState extends State<Trend> {
final int index,
) {
final Map<String, Object> 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),