fix: resolve 2 remaining strict analysis errors

- introPage.dart: Convert fireItems to proper static function closure
- mainDrawer.dart: Convert unreadCount int to String for Text widget
This commit is contained in:
vjrj 2026-03-06 11:21:06 +01:00
parent 1864e5b105
commit 7a4c9fb3bc
61 changed files with 1386 additions and 1202 deletions

View file

@ -1,44 +1,44 @@
import 'package:fires_flutter/models/fireNotification.dart';
import 'package:redux/redux.dart';
import '../models/fireNotification.dart';
import 'actions.dart';
final fireNotificationReducer = combineReducers<List<FireNotification>>([
new TypedReducer<List<FireNotification>, AddedFireNotificationAction>(
final Reducer<List<FireNotification>> fireNotificationReducer = combineReducers<List<FireNotification>>(<Reducer<List<FireNotification>>>[
TypedReducer<List<FireNotification>, AddedFireNotificationAction>(
_addedFireNotification),
new TypedReducer<List<FireNotification>, DeletedFireNotificationAction>(
TypedReducer<List<FireNotification>, DeletedFireNotificationAction>(
_deletedFireNotification),
new TypedReducer<List<FireNotification>, UpdatedFireNotificationAction>(
TypedReducer<List<FireNotification>, UpdatedFireNotificationAction>(
_updatedFireNotification),
new TypedReducer<List<FireNotification>, DeletedAllFireNotificationAction>(
TypedReducer<List<FireNotification>, DeletedAllFireNotificationAction>(
_deletedAllFireNotifications),
new TypedReducer<List<FireNotification>, ReadedFireNotificationAction>(
TypedReducer<List<FireNotification>, ReadedFireNotificationAction>(
_readedFireNotification)
]);
List<FireNotification> _addedFireNotification(
List<FireNotification> notifications, AddedFireNotificationAction action) {
return new List.from(notifications)..insert(0, action.notif);
return List.from(notifications)..insert(0, action.notif);
}
List<FireNotification> _deletedFireNotification(
List<FireNotification> notifications,
DeletedFireNotificationAction action) {
return new List.from(notifications)..remove(action.notif);
return List.from(notifications)..remove(action.notif);
}
List<FireNotification> _updatedFireNotification(
List<FireNotification> notifications,
UpdatedFireNotificationAction action) {
return notifications
.map((notif) => notif.id == action.notif.id ? action.notif : notif)
.map((FireNotification notif) => notif.id == action.notif.id ? action.notif : notif)
.toList();
}
List<FireNotification> _readedFireNotification(
List<FireNotification> notifications, ReadedFireNotificationAction action) {
return notifications
.map((yourLocation) =>
.map((FireNotification yourLocation) =>
yourLocation.id == action.notif.id ? action.notif : yourLocation)
.toList();
}
@ -46,5 +46,5 @@ List<FireNotification> _readedFireNotification(
List<FireNotification> _deletedAllFireNotifications(
List<FireNotification> notifications,
DeletedAllFireNotificationAction action) {
return [];
return <FireNotification>[];
}