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:
parent
1864e5b105
commit
7a4c9fb3bc
61 changed files with 1386 additions and 1202 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import 'dart:core';
|
||||
|
||||
import 'package:comunes_flutter/comunes_flutter.dart';
|
||||
import 'package:fires_flutter/models/yourLocation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:redux/src/store.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import 'attributionMapPlugin.dart';
|
||||
|
|
@ -21,6 +21,9 @@ import 'globals.dart' as globals;
|
|||
import 'layerSelectorMapPlugin.dart';
|
||||
import 'locationUtils.dart';
|
||||
import 'models/appState.dart';
|
||||
import 'models/falsePositiveTypes.dart';
|
||||
import 'models/fireNotification.dart';
|
||||
import 'models/yourLocation.dart';
|
||||
import 'redux/actions.dart';
|
||||
import 'sentryReport.dart';
|
||||
import 'slider.dart';
|
||||
|
|
@ -28,21 +31,8 @@ import 'zoomMapPlugin.dart';
|
|||
|
||||
@immutable
|
||||
class _ViewModel {
|
||||
final String serverUrl;
|
||||
final String lang;
|
||||
final FireMapState mapState;
|
||||
final OnSubscribeFunction onSubs;
|
||||
final OnSubscribeConfirmedFunction onSubsConfirmed;
|
||||
final OnUnSubscribeFunction onUnSubs;
|
||||
final OnSubscribeDistanceChangeFunction onSlide;
|
||||
final OnLocationEdit onEdit;
|
||||
final OnLocationEditConfirm onEditConfirm;
|
||||
final OnLocationEditCancel onEditCancel;
|
||||
final OnLocationEditing onEditing;
|
||||
final OnFalsePositive onFalsePositive;
|
||||
final OnFirePressedInMap onFirePressed;
|
||||
|
||||
_ViewModel(
|
||||
const _ViewModel(
|
||||
{required this.mapState,
|
||||
required this.serverUrl,
|
||||
required this.lang,
|
||||
|
|
@ -56,6 +46,19 @@ class _ViewModel {
|
|||
required this.onFalsePositive,
|
||||
required this.onFirePressed,
|
||||
required this.onEditCancel});
|
||||
final String serverUrl;
|
||||
final String lang;
|
||||
final FireMapState mapState;
|
||||
final OnSubscribeFunction onSubs;
|
||||
final OnSubscribeConfirmedFunction onSubsConfirmed;
|
||||
final OnUnSubscribeFunction onUnSubs;
|
||||
final OnSubscribeDistanceChangeFunction onSlide;
|
||||
final OnLocationEdit onEdit;
|
||||
final OnLocationEditConfirm onEditConfirm;
|
||||
final OnLocationEditCancel onEditCancel;
|
||||
final OnLocationEditing onEditing;
|
||||
final OnFalsePositive onFalsePositive;
|
||||
final OnFirePressedInMap onFirePressed;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
|
|
@ -71,6 +74,8 @@ class _ViewModel {
|
|||
}
|
||||
|
||||
class genericMap extends StatefulWidget {
|
||||
const genericMap({super.key});
|
||||
|
||||
@override
|
||||
_genericMapState createState() => _genericMapState();
|
||||
}
|
||||
|
|
@ -78,49 +83,49 @@ class genericMap extends StatefulWidget {
|
|||
class _genericMapState extends State<genericMap> {
|
||||
// This needs to be stateful so when resizes don't get a new globalkey
|
||||
// https://github.com/flutter/flutter/issues/1632#issuecomment-180478202
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
YourLocation? _location;
|
||||
YourLocation? _initialLocation;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new StoreConnector<AppState, _ViewModel>(
|
||||
return StoreConnector<AppState, _ViewModel>(
|
||||
distinct: true,
|
||||
onInitialBuild: (store) {
|
||||
onInitialBuild: (_ViewModel store) {
|
||||
_initialLocation = _location?.copyWith();
|
||||
},
|
||||
converter: (store) {
|
||||
converter: (Store<AppState> store) {
|
||||
print('New map viewer');
|
||||
return new _ViewModel(
|
||||
onSubs: (loc) {
|
||||
store.dispatch(new SubscribeAction());
|
||||
return _ViewModel(
|
||||
onSubs: (YourLocation loc) {
|
||||
store.dispatch(SubscribeAction());
|
||||
},
|
||||
onSubsConfirmed: (loc) {
|
||||
onSubsConfirmed: (YourLocation loc) {
|
||||
loc.subscribed = true;
|
||||
store.dispatch(new SubscribeConfirmAction(loc));
|
||||
store.dispatch(SubscribeConfirmAction(loc));
|
||||
},
|
||||
onUnSubs: (loc) {
|
||||
onUnSubs: (YourLocation loc) {
|
||||
loc.subscribed = false;
|
||||
store.dispatch(new UnSubscribeAction(loc));
|
||||
store.dispatch(UnSubscribeAction(loc));
|
||||
},
|
||||
onSlide: (loc) {
|
||||
store.dispatch(new UpdateYourLocationMapAction(loc));
|
||||
onSlide: (YourLocation loc) {
|
||||
store.dispatch(UpdateYourLocationMapAction(loc));
|
||||
},
|
||||
onEdit: (loc) => store.dispatch(new EditYourLocationAction(loc)),
|
||||
onEditing: (loc) {
|
||||
store.dispatch(new UpdateYourLocationMapAction(loc));
|
||||
onEdit: (YourLocation loc) => store.dispatch(EditYourLocationAction(loc)),
|
||||
onEditing: (YourLocation loc) {
|
||||
store.dispatch(UpdateYourLocationMapAction(loc));
|
||||
},
|
||||
onEditCancel: (loc) =>
|
||||
store.dispatch(new EditCancelYourLocationAction(loc)),
|
||||
onEditConfirm: (loc) {
|
||||
store.dispatch(new UpdateYourLocationAction(loc));
|
||||
store.dispatch(new UpdateYourLocationMapAction(loc));
|
||||
store.dispatch(new EditConfirmYourLocationAction(loc));
|
||||
onEditCancel: (YourLocation loc) =>
|
||||
store.dispatch(EditCancelYourLocationAction(loc)),
|
||||
onEditConfirm: (YourLocation loc) {
|
||||
store.dispatch(UpdateYourLocationAction(loc));
|
||||
store.dispatch(UpdateYourLocationMapAction(loc));
|
||||
store.dispatch(EditConfirmYourLocationAction(loc));
|
||||
},
|
||||
onFalsePositive: (notif, type) => store
|
||||
.dispatch(new MarkFireAsFalsePositiveAction(notif, type)),
|
||||
onFirePressed: (LatLng latLng, DateTime when, type) {
|
||||
onFalsePositive: (FireNotification notif, FalsePositiveType type) => store
|
||||
.dispatch(MarkFireAsFalsePositiveAction(notif, type)),
|
||||
onFirePressed: (LatLng latLng, DateTime when, String type) {
|
||||
_showFireDialog(latLng, when, type);
|
||||
},
|
||||
serverUrl: store.state.serverUrl,
|
||||
|
|
@ -128,24 +133,23 @@ class _genericMapState extends State<genericMap> {
|
|||
lang: store.state.user.lang,
|
||||
mapState: store.state.fireMapState);
|
||||
},
|
||||
builder: (context, view) {
|
||||
YourLocation? location = view.mapState.yourLocation;
|
||||
builder: (BuildContext context, _ViewModel view) {
|
||||
final YourLocation? location = view.mapState.yourLocation;
|
||||
_location = location?.copyWith();
|
||||
print('New map builder with ${_location?.description}');
|
||||
|
||||
FireMapState mapState = view.mapState;
|
||||
FireMapStatus status = mapState.status;
|
||||
FireMapLayer layer = mapState.layer;
|
||||
final FireMapState mapState = view.mapState;
|
||||
final FireMapStatus status = mapState.status;
|
||||
final FireMapLayer layer = mapState.layer;
|
||||
print('Build map with status: $status and layer $layer');
|
||||
|
||||
double maxZoom = 18.0; // works?
|
||||
const double maxZoom = 18.0; // works?
|
||||
|
||||
MapOptions mapOptions = new MapOptions(
|
||||
final MapOptions mapOptions = MapOptions(
|
||||
initialCenter:
|
||||
new LatLng(_location?.lat ?? 0.0, _location?.lon ?? 0.0),
|
||||
initialZoom: 13.0,
|
||||
LatLng(_location?.lat ?? 0.0, _location?.lon ?? 0.0),
|
||||
maxZoom: maxZoom,
|
||||
onTap: (tapPosition, latLng) {
|
||||
onTap: (TapPosition tapPosition, LatLng latLng) {
|
||||
if (status == FireMapStatus.edit && _location != null) {
|
||||
_location = _location!
|
||||
.copyWith(lat: latLng.latitude, lon: latLng.longitude);
|
||||
|
|
@ -161,19 +165,19 @@ class _genericMapState extends State<genericMap> {
|
|||
// mapController.fitBounds(bounds);
|
||||
// mapController.center
|
||||
|
||||
final btnText = status == FireMapStatus.view
|
||||
final String btnText = status == FireMapStatus.view
|
||||
? S.of(context).toFiresNotifications
|
||||
: status == FireMapStatus.subscriptionConfirm
|
||||
? S.of(context).confirm
|
||||
: S.of(context).unsubscribe;
|
||||
final btnIcon = status == FireMapStatus.view
|
||||
final IconData btnIcon = status == FireMapStatus.view
|
||||
? Icons.notifications_active
|
||||
: status == FireMapStatus.subscriptionConfirm
|
||||
? Icons.check
|
||||
: Icons.notifications_off;
|
||||
|
||||
String baseLayer;
|
||||
List<String> subdomains = [];
|
||||
List<String> subdomains = <String>[];
|
||||
String attribution;
|
||||
switch (layer) {
|
||||
case FireMapLayer.osmc:
|
||||
|
|
@ -188,14 +192,14 @@ class _genericMapState extends State<genericMap> {
|
|||
/* tiles from: https://github.com/dceejay/RedMap/blob/1914ed3b9ce4e8a496049849a93282730b4fff02/worldmap/index.html */
|
||||
switch (layer) {
|
||||
case FireMapLayer.osmc:
|
||||
subdomains = ['a', 'b', 'c'];
|
||||
subdomains = <String>['a', 'b', 'c'];
|
||||
baseLayer =
|
||||
'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png';
|
||||
break;
|
||||
case FireMapLayer.osmcGrey:
|
||||
baseLayer =
|
||||
'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png';
|
||||
subdomains = ['a', 'b', 'c', 'd'];
|
||||
subdomains = <String>['a', 'b', 'c', 'd'];
|
||||
break;
|
||||
case FireMapLayer.esri:
|
||||
baseLayer =
|
||||
|
|
@ -209,29 +213,27 @@ class _genericMapState extends State<genericMap> {
|
|||
baseLayer =
|
||||
'https://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}';
|
||||
}
|
||||
FlutterMap map = new FlutterMap(
|
||||
final FlutterMap map = FlutterMap(
|
||||
options: mapOptions,
|
||||
children: [
|
||||
new TileLayer(
|
||||
children: <Widget>[
|
||||
TileLayer(
|
||||
maxZoom: maxZoom,
|
||||
urlTemplate: baseLayer,
|
||||
subdomains: subdomains,
|
||||
userAgentPackageName: 'com.example.fires_flutter',
|
||||
additionalOptions: {
|
||||
additionalOptions: const <String, String> {
|
||||
// 'opacity': '0.1',
|
||||
},
|
||||
),
|
||||
globals.isDevelopment
|
||||
? new ZoomMapPluginWidget()
|
||||
: new DummyMapPluginWidget(),
|
||||
new CompassMapPluginWidget(),
|
||||
new MarkerLayer(
|
||||
if (globals.isDevelopment) const ZoomMapPluginWidget() else const DummyMapPluginWidget(),
|
||||
const CompassMapPluginWidget(),
|
||||
MarkerLayer(
|
||||
markers: buildMarkers(
|
||||
mapState.status == FireMapStatus.viewFireNotification &&
|
||||
mapState.fireNotification != null
|
||||
? new LatLng(mapState.fireNotification!.lat,
|
||||
? LatLng(mapState.fireNotification!.lat,
|
||||
mapState.fireNotification!.lon)
|
||||
: new LatLng(_location!.lat, _location!.lon),
|
||||
: LatLng(_location!.lat, _location!.lon),
|
||||
mapState.fires,
|
||||
mapState.industries,
|
||||
mapState.falsePos,
|
||||
|
|
@ -239,8 +241,8 @@ class _genericMapState extends State<genericMap> {
|
|||
view.onFirePressed),
|
||||
),
|
||||
// new AttributionPluginWidget(text: "© OpenStreetMap contributors"),
|
||||
new LayerSelectorMapPluginWidget(),
|
||||
new AttributionPluginWidget(text: attribution),
|
||||
const LayerSelectorMapPluginWidget(),
|
||||
AttributionPluginWidget(text: attribution),
|
||||
],
|
||||
);
|
||||
// mapController.
|
||||
|
|
@ -250,35 +252,33 @@ class _genericMapState extends State<genericMap> {
|
|||
;
|
||||
}); */
|
||||
// Do something with it
|
||||
return new Scaffold(
|
||||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: new AppBar(
|
||||
appBar: AppBar(
|
||||
title: status == FireMapStatus.edit
|
||||
? new TextField(
|
||||
? TextField(
|
||||
// autofocus: true,
|
||||
key: new Key('LocationDescField'),
|
||||
key: const Key('LocationDescField'),
|
||||
keyboardType: TextInputType.text,
|
||||
|
||||
decoration: new InputDecoration(),
|
||||
controller: new TextEditingController.fromValue(
|
||||
new TextEditingValue(
|
||||
controller: TextEditingController.fromValue(
|
||||
TextEditingValue(
|
||||
text: _location!.description,
|
||||
selection: new TextSelection.collapsed(
|
||||
selection: TextSelection.collapsed(
|
||||
offset: _location!.description.length))),
|
||||
onChanged: (newDesc) {
|
||||
debugPrint("OnChanged");
|
||||
onChanged: (String newDesc) {
|
||||
debugPrint('OnChanged');
|
||||
_location = _location!.copyWith(description: newDesc);
|
||||
},
|
||||
onSubmitted: (newDesc) {
|
||||
debugPrint("OnSubmitted");
|
||||
onSubmitted: (String newDesc) {
|
||||
debugPrint('OnSubmitted');
|
||||
_location = _location!.copyWith(description: newDesc);
|
||||
view.onEditConfirm(_location!);
|
||||
},
|
||||
)
|
||||
: status == FireMapStatus.viewFireNotification
|
||||
? new Text(S.of(context).fireNotificationTitle)
|
||||
: new Text(_location!.description),
|
||||
? Text(S.of(context).fireNotificationTitle)
|
||||
: Text(_location!.description),
|
||||
actions: buildAppBarActions(status, view, _location!),
|
||||
),
|
||||
floatingActionButton: status == FireMapStatus.edit ||
|
||||
|
|
@ -302,9 +302,9 @@ class _genericMapState extends State<genericMap> {
|
|||
}
|
||||
},
|
||||
// https://github.com/flutter/flutter/issues/17583
|
||||
heroTag: "firesmap" + _location!.id.hexString,
|
||||
icon: new Icon(btnIcon, color: fires600),
|
||||
label: new Text(
|
||||
heroTag: 'firesmap${_location!.id.hexString}',
|
||||
icon: Icon(btnIcon, color: fires600),
|
||||
label: Text(
|
||||
btnText,
|
||||
style: const TextStyle(color: fires600),
|
||||
),
|
||||
|
|
@ -312,20 +312,20 @@ class _genericMapState extends State<genericMap> {
|
|||
),
|
||||
floatingActionButtonLocation:
|
||||
FloatingActionButtonLocation.centerFloat,
|
||||
bottomNavigationBar: new GenericMapBottom(
|
||||
bottomNavigationBar: GenericMapBottom(
|
||||
onSave: () => view.onEditConfirm(_location!),
|
||||
onCancel: () =>
|
||||
view.onEditCancel(_initialLocation ?? _location!),
|
||||
onFalsePositive: (sealed, type) =>
|
||||
onFalsePositive: (FireNotification sealed, FalsePositiveType type) =>
|
||||
view.onFalsePositive(sealed, type),
|
||||
state: view.mapState,
|
||||
scaffoldKey: _scaffoldKey,
|
||||
),
|
||||
body: LayoutBuilder(
|
||||
builder: (context, constraints) =>
|
||||
builder: (BuildContext context, BoxConstraints constraints) =>
|
||||
Stack(fit: StackFit.expand, children: <Widget>[
|
||||
// Material(color: Colors.yellowAccent),
|
||||
new Opacity(
|
||||
Opacity(
|
||||
opacity:
|
||||
status == FireMapStatus.subscriptionConfirm ||
|
||||
status == FireMapStatus.edit
|
||||
|
|
@ -336,7 +336,7 @@ class _genericMapState extends State<genericMap> {
|
|||
top: constraints.maxHeight - 200,
|
||||
right: 10.0,
|
||||
left: 10.0,
|
||||
child: new CenteredRow(
|
||||
child: CenteredRow(
|
||||
// Fit sample:
|
||||
// https://github.com/apptreesoftware/flutter_map/blob/master/flutter_map_example/lib/pages/map_controller.dart
|
||||
children: status ==
|
||||
|
|
@ -345,18 +345,18 @@ class _genericMapState extends State<genericMap> {
|
|||
_location != null &&
|
||||
_location!.subscribed)
|
||||
? <Widget>[
|
||||
new FireDistanceSlider(
|
||||
FireDistanceSlider(
|
||||
initialValue:
|
||||
(_location?.distance ?? 0)
|
||||
.round(),
|
||||
onSlide: (distance) {
|
||||
_location?.distance ?? 0
|
||||
,
|
||||
onSlide: (int distance) {
|
||||
if (_location != null) {
|
||||
_location!.distance = distance;
|
||||
view.onSlide(_location!);
|
||||
}
|
||||
})
|
||||
]
|
||||
: []),
|
||||
: <Widget>[]),
|
||||
)
|
||||
])));
|
||||
});
|
||||
|
|
@ -368,20 +368,20 @@ class _genericMapState extends State<genericMap> {
|
|||
case FireMapStatus.view:
|
||||
case FireMapStatus.unsubscribe:
|
||||
return <Widget>[
|
||||
new IconButton(
|
||||
icon: new Icon(Icons.edit),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.edit),
|
||||
onPressed: () => view.onEdit(location))
|
||||
];
|
||||
case FireMapStatus.edit:
|
||||
return <Widget>[
|
||||
new IconButton(
|
||||
icon: new Icon(Icons.save),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.save),
|
||||
onPressed: () => view.onEditConfirm(_location!))
|
||||
];
|
||||
case FireMapStatus.viewFireNotification:
|
||||
return <Widget>[
|
||||
new IconButton(
|
||||
icon: new Icon(Icons.share),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.share),
|
||||
onPressed: () {
|
||||
Share.share(
|
||||
'${view.mapState.fireNotification?.description ?? 'Fire'}. ${view.serverUrl}fire/${view.mapState.fireNotification?.sealed ?? ''}');
|
||||
|
|
@ -399,15 +399,15 @@ class _genericMapState extends State<genericMap> {
|
|||
List<dynamic> industries,
|
||||
bool isNotif,
|
||||
OnFirePressedInMap onFirePressed) {
|
||||
List<Marker> markers = [];
|
||||
final List<Marker> markers = <Marker>[];
|
||||
print(
|
||||
'building markers: fires: ${fires.length} falsePos: ${falsePosList.length} industries: ${industries.length}, isNotif: $isNotif ');
|
||||
// const calibrate = false; // useful when we change the fire icons size
|
||||
falsePosList.forEach((falsePos) {
|
||||
for (final falsePos in falsePosList) {
|
||||
try {
|
||||
var coords = falsePos['geo']['coordinates'] as List<dynamic>;
|
||||
final List<dynamic> coords = falsePos['geo']['coordinates'] as List<dynamic>;
|
||||
// print('false pos: ${coords}');
|
||||
var loc = LatLng(
|
||||
final LatLng loc = LatLng(
|
||||
(coords[1] as num).toDouble(), (coords[0] as num).toDouble());
|
||||
markers.add(FireMarker(loc, FireMarkType.falsePos, () {
|
||||
_showFalsePositiveDialog(loc);
|
||||
|
|
@ -417,12 +417,12 @@ class _genericMapState extends State<genericMap> {
|
|||
print('Failed to process $falsePos');
|
||||
reportError(e, stackTrace);
|
||||
}
|
||||
});
|
||||
industries.forEach((industry) {
|
||||
}
|
||||
for (final industry in industries) {
|
||||
try {
|
||||
// print(fire['geo']['coordinates']);
|
||||
var coords = industry['geo']['coordinates'] as List<dynamic>;
|
||||
var loc = LatLng(
|
||||
final List<dynamic> coords = industry['geo']['coordinates'] as List<dynamic>;
|
||||
final LatLng loc = LatLng(
|
||||
(coords[1] as num).toDouble(), (coords[0] as num).toDouble());
|
||||
markers.add(FireMarker(loc, FireMarkType.industry, () {
|
||||
_showIndustryDialog(loc);
|
||||
|
|
@ -432,14 +432,14 @@ class _genericMapState extends State<genericMap> {
|
|||
print('Failed to process $industry');
|
||||
reportError(e, stackTrace);
|
||||
}
|
||||
});
|
||||
fires.forEach((fire) {
|
||||
}
|
||||
for (final fire in fires) {
|
||||
try {
|
||||
var loc = new LatLng(
|
||||
final LatLng loc = LatLng(
|
||||
(fire['lat'] as num).toDouble(), (fire['lon'] as num).toDouble());
|
||||
markers.add(FireMarker(loc, FireMarkType.fire, () {
|
||||
onFirePressed(loc, DateTime.parse(fire['when'].toString()),
|
||||
(fire['type'] as String));
|
||||
fire['type'] as String);
|
||||
print('fire $fire pressed');
|
||||
}));
|
||||
markers.add(FireMarker(loc, FireMarkType.pixel));
|
||||
|
|
@ -447,7 +447,7 @@ class _genericMapState extends State<genericMap> {
|
|||
print('Failed to process $fire');
|
||||
reportError(e, stackTrace);
|
||||
}
|
||||
});
|
||||
}
|
||||
markers.add(
|
||||
FireMarker(pos, isNotif ? FireMarkType.fire : FireMarkType.position));
|
||||
// if (calibrate) markers.add(FireMarker(pos, FireMarkType.pixel));
|
||||
|
|
@ -455,20 +455,20 @@ class _genericMapState extends State<genericMap> {
|
|||
}
|
||||
|
||||
void _showFireDialog(LatLng pos, DateTime date, String type) {
|
||||
var when = Moment.fromDate(date).fromNow(context);
|
||||
final String when = Moment.fromDate(date).fromNow(context);
|
||||
getReverseLocation(lat: pos.latitude, lon: pos.longitude)
|
||||
.then((reverseLoc) {
|
||||
String by = type == 'vecinal'
|
||||
.then((String reverseLoc) {
|
||||
final String by = type == 'vecinal'
|
||||
? S.of(context).byOurUsers
|
||||
: S.of(context).byNASAsatellites;
|
||||
String fireDesc =
|
||||
final String fireDesc =
|
||||
S.of(context).additionalInfoAboutFire(reverseLoc, when, by);
|
||||
showDialog<bool>(
|
||||
context: _scaffoldKey.currentContext!,
|
||||
builder: (_) => new AlertDialog(
|
||||
content: new Text(fireDesc),
|
||||
builder: (_) => AlertDialog(
|
||||
content: Text(fireDesc),
|
||||
actions: <Widget>[
|
||||
new TextButton(
|
||||
TextButton(
|
||||
child: Text(S.of(context).CLOSE),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
|
|
@ -481,17 +481,17 @@ class _genericMapState extends State<genericMap> {
|
|||
|
||||
void _showIndustryDialog(LatLng pos) {
|
||||
getReverseLocation(lat: pos.latitude, lon: pos.longitude)
|
||||
.then((reverseLoc) {
|
||||
String industryDesc = '${S.of(context).itSeemsAIndustry}\n\n'
|
||||
.then((String reverseLoc) {
|
||||
final String industryDesc = '${S.of(context).itSeemsAIndustry}\n\n'
|
||||
'Type: Industry\n'
|
||||
'Location: $reverseLoc';
|
||||
showDialog<bool>(
|
||||
context: _scaffoldKey.currentContext!,
|
||||
builder: (_) => new AlertDialog(
|
||||
builder: (_) => AlertDialog(
|
||||
title: Text(S.of(context).notAWildfire),
|
||||
content: new Text(industryDesc),
|
||||
content: Text(industryDesc),
|
||||
actions: <Widget>[
|
||||
new TextButton(
|
||||
TextButton(
|
||||
child: Text(S.of(context).CLOSE),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
|
|
@ -504,17 +504,17 @@ class _genericMapState extends State<genericMap> {
|
|||
|
||||
void _showFalsePositiveDialog(LatLng pos) {
|
||||
getReverseLocation(lat: pos.latitude, lon: pos.longitude)
|
||||
.then((reverseLoc) {
|
||||
String falseDesc = '${S.of(context).itSeemsNotAtForesFire}\n\n'
|
||||
.then((String reverseLoc) {
|
||||
final String falseDesc = '${S.of(context).itSeemsNotAtForesFire}\n\n'
|
||||
'Type: False Positive\n'
|
||||
'Location: $reverseLoc';
|
||||
showDialog<bool>(
|
||||
context: _scaffoldKey.currentContext!,
|
||||
builder: (_) => new AlertDialog(
|
||||
builder: (_) => AlertDialog(
|
||||
title: Text(S.of(context).notAWildfire),
|
||||
content: new Text(falseDesc),
|
||||
content: Text(falseDesc),
|
||||
actions: <Widget>[
|
||||
new TextButton(
|
||||
TextButton(
|
||||
child: Text(S.of(context).CLOSE),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue