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,8 +1,6 @@
import 'dart:async';
import 'package:comunes_flutter/comunes_flutter.dart';
import 'package:fires_flutter/models/fireNotification.dart';
import 'package:fires_flutter/models/yourLocation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:json_annotation/json_annotation.dart';
@ -10,7 +8,9 @@ import 'package:latlong2/latlong.dart';
import 'package:meta/meta.dart';
import 'fireMapState.dart';
import 'fireNotification.dart';
import 'user.dart';
import 'yourLocation.dart';
export 'fireMapState.dart';
@ -19,6 +19,25 @@ part 'appState.g.dart';
@immutable
@JsonSerializable(nullable: false)
class AppState {
const AppState(
{this.yourLocations = const <YourLocation>[],
this.fireNotifications = const <FireNotification>[],
this.fireNotificationsUnread = 0,
this.user = const User.initial(),
this.isLoading = false,
this.isLoaded = false,
this.error = '',
this.gmapKey = '',
this.firesApiKey = '',
this.firesApiUrl = '',
this.serverUrl = '',
this.monitoredAreas = const <Polyline>[],
this.fireMapState = const FireMapState.initial()});
@JsonKey(ignore: true)
factory AppState.fromJson(Map<String, dynamic> json) =>
_$AppStateFromJson(json);
@JsonKey(ignore: true)
final bool isLoading;
@JsonKey(ignore: true)
@ -44,25 +63,6 @@ class AppState {
@JsonKey(ignore: true)
final FireMapState fireMapState;
@JsonKey(ignore: true)
factory AppState.fromJson(Map<String, dynamic> json) =>
_$AppStateFromJson(json);
AppState(
{this.yourLocations = const <YourLocation>[],
this.fireNotifications = const <FireNotification>[],
this.fireNotificationsUnread = 0,
this.user = const User.initial(),
this.isLoading = false,
this.isLoaded = false,
this.error = '',
this.gmapKey = '',
this.firesApiKey = '',
this.firesApiUrl = '',
this.serverUrl = '',
this.monitoredAreas = const <Polyline>[],
this.fireMapState = const FireMapState.initial()});
AppState copyWith(
{bool? isLoading,
bool? isLoaded,
@ -77,7 +77,7 @@ class AppState {
int? fireNotificationsUnread,
FireMapState? fireMapState,
List<Polyline>? monitoredAreas}) {
return new AppState(
return AppState(
isLoading: isLoading ?? this.isLoading,
isLoaded: isLoaded ?? this.isLoaded,
user: user ?? this.user,
@ -100,24 +100,24 @@ class AppState {
}
}
typedef void AddYourLocationFunction(YourLocation loc);
typedef void DeleteYourLocationFunction(YourLocation loc);
typedef void OnRefreshYourLocationsFunction(Completer<Null> callback);
typedef void ToggleSubscriptionFunction(YourLocation loc);
typedef void OnLocationTapFunction(YourLocation loc);
typedef void OnSubscribeFunction(YourLocation loc);
typedef void OnSubscribeDistanceChangeFunction(YourLocation loc);
typedef void OnUnSubscribeFunction(YourLocation loc);
typedef void OnSubscribeConfirmedFunction(YourLocation loc);
typedef void OnLocationEdit(YourLocation loc);
typedef void OnLocationEditing(YourLocation loc);
typedef void OnLocationEditConfirm(YourLocation loc);
typedef void OnLocationEditCancel(YourLocation loc);
typedef void TapFireNotificationFunction(FireNotification notif);
typedef void OnFirePressedInMap(LatLng latLng, DateTime when, String source);
typedef AddYourLocationFunction = void Function(YourLocation loc);
typedef DeleteYourLocationFunction = void Function(YourLocation loc);
typedef OnRefreshYourLocationsFunction = void Function(Completer<void> callback);
typedef ToggleSubscriptionFunction = void Function(YourLocation loc);
typedef OnLocationTapFunction = void Function(YourLocation loc);
typedef OnSubscribeFunction = void Function(YourLocation loc);
typedef OnSubscribeDistanceChangeFunction = void Function(YourLocation loc);
typedef OnUnSubscribeFunction = void Function(YourLocation loc);
typedef OnSubscribeConfirmedFunction = void Function(YourLocation loc);
typedef OnLocationEdit = void Function(YourLocation loc);
typedef OnLocationEditing = void Function(YourLocation loc);
typedef OnLocationEditConfirm = void Function(YourLocation loc);
typedef OnLocationEditCancel = void Function(YourLocation loc);
typedef TapFireNotificationFunction = void Function(FireNotification notif);
typedef OnFirePressedInMap = void Function(LatLng latLng, DateTime when, String source);
// typedef void OnReceivedFireNotificationFunction(FireNotification notif);
typedef void DeleteFireNotificationFunction(FireNotification notif);
typedef void DeleteAllFireNotificationFunction();
typedef DeleteFireNotificationFunction = void Function(FireNotification notif);
typedef DeleteAllFireNotificationFunction = void Function();
// unused
// typedef void UpdateYourLocationFunction(ObjectId id, YourLocation loc);