Ref: Passt Linter-Rules an
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -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],
|
||||
);
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user