Remove info-level lint issues: avoid_dynamic_calls, use_build_context_synchronously, avoid_print, non_constant_identifier_names
- Type dynamic map accesses properly (avoid_dynamic_calls in genericMap, globalFiresBottomStats) - Capture context before async gaps (use_build_context_synchronously in genericMap, genericMapBottom, globalFiresBottomStats) - Replace print() with debugPrint() (avoid_print in firesApi.dart) - Rename fireMarker function and _LayerSelectorButton to camelCase - Rename variable FireNotifications to fireNotifications - Fix no_default_cases in switch statements (add missing subscriptionConfirm case) - Make FireNotification fields final, remove @immutable from YourLocation (mutable) - Make monitoredAreas field final in _ViewModel - Update subscribeViaApi to use copyWith instead of direct field assignment
This commit is contained in:
parent
82cf8fc7cc
commit
270d9a569e
12 changed files with 72 additions and 61 deletions
|
|
@ -30,13 +30,18 @@ class _GlobalFiresBottomStatsState extends State<GlobalFiresBottomStats> {
|
|||
.then((String result) {
|
||||
try {
|
||||
final Moment now = Moment.now();
|
||||
final DateTime last =
|
||||
DateTime.parse(json.decode(result)['value'] as String);
|
||||
final dynamic decodedResult = json.decode(result);
|
||||
final Map<String, dynamic> resultMap =
|
||||
decodedResult as Map<String, dynamic>;
|
||||
final DateTime last = DateTime.parse(resultMap['value'] as String);
|
||||
http
|
||||
.read(Uri.parse('${firesApiUrl}status/active-fires-count'))
|
||||
.then((String result) {
|
||||
try {
|
||||
final int count = (json.decode(result)['total'] as num).toInt();
|
||||
final dynamic decodedCountResult = json.decode(result);
|
||||
final Map<String, dynamic> countMap =
|
||||
decodedCountResult as Map<String, dynamic>;
|
||||
final int count = (countMap['total'] as num).toInt();
|
||||
setState(() {
|
||||
lastCheck = now.from(context, last);
|
||||
activeFires = count;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue