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,30 +1,12 @@
import 'package:fires_flutter/objectIdUtils.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:objectid/objectid.dart';
import '../objectIdUtils.dart';
part 'yourLocation.g.dart';
@JsonSerializable(nullable: false)
class YourLocation {
@JsonKey(toJson: objectIdToJson, fromJson: objectIdFromJson)
ObjectId id;
final double lat;
final double lon;
String description;
bool subscribed;
int distance;
late int currentNumFires;
factory YourLocation.fromJson(Map<String, dynamic> json) =>
_$YourLocationFromJson(json);
static late final YourLocation noLocation;
static const int? withoutStats = null;
static void _initNoLocation() {
noLocation = new YourLocation(
id: ObjectId(), lat: 0.0, lon: 0.0, description: '', subscribed: false);
}
YourLocation(
{required this.id,
@ -36,6 +18,25 @@ class YourLocation {
this.subscribed = false}) {
this.currentNumFires = currentNumFires ?? 0;
}
factory YourLocation.fromJson(Map<String, dynamic> json) =>
_$YourLocationFromJson(json);
@JsonKey(toJson: objectIdToJson, fromJson: objectIdFromJson)
ObjectId id;
final double lat;
final double lon;
String description;
bool subscribed;
int distance;
late int currentNumFires;
static late final YourLocation noLocation;
static const int? withoutStats = null;
static void _initNoLocation() {
noLocation = YourLocation(
id: ObjectId(), lat: 0.0, lon: 0.0);
}
Map<String, dynamic> toJson() => _$YourLocationToJson(this);
YourLocation copyWith(
@ -46,7 +47,7 @@ class YourLocation {
int? distance,
int? currentNumFires,
bool? subscribed}) {
return new YourLocation(
return YourLocation(
id: id ?? this.id,
lat: lat ?? this.lat,
lon: lon ?? this.lon,