- Replace ToggleMapLayerAction with SelectMapLayerAction that takes a specific layer - Update fireMapReducer to handle SelectMapLayerAction instead of toggling - Use PopupMenuButton with GlobalKey to open menu on button tap - Show check icon and bold text for currently selected layer - Menu items display layer names: OSMC Grey, OSMC, Esri Street, Esri Satellite, Esri Terrain - Selecting a layer immediately updates Redux state and closes the menu
61 lines
1.4 KiB
Dart
61 lines
1.4 KiB
Dart
import 'package:fires_flutter/models/yourLocation.dart';
|
|
import 'package:fires_flutter/models/fireNotification.dart';
|
|
import 'package:fires_flutter/models/fireMapState.dart';
|
|
|
|
abstract class FiresMapActions {}
|
|
|
|
class UpdateYourLocationMapAction extends FiresMapActions {
|
|
final YourLocation loc;
|
|
|
|
UpdateYourLocationMapAction(
|
|
this.loc,
|
|
);
|
|
}
|
|
|
|
class UpdateFireMapStatsAction extends FiresMapActions {
|
|
int numFires;
|
|
List<dynamic> fires = [];
|
|
List<dynamic> falsePos = [];
|
|
List<dynamic> industries = [];
|
|
|
|
UpdateFireMapStatsAction(
|
|
{required this.numFires,
|
|
required this.fires,
|
|
required this.falsePos,
|
|
required this.industries});
|
|
}
|
|
|
|
class ShowYourLocationMapAction extends FiresMapActions {
|
|
YourLocation loc;
|
|
|
|
ShowYourLocationMapAction(this.loc);
|
|
}
|
|
|
|
class ShowFireNotificationMapAction extends FiresMapActions {
|
|
FireNotification notif;
|
|
|
|
ShowFireNotificationMapAction(this.notif);
|
|
}
|
|
|
|
class EditYourLocationAction extends FiresMapActions {
|
|
YourLocation loc;
|
|
|
|
EditYourLocationAction(this.loc);
|
|
}
|
|
|
|
class EditConfirmYourLocationAction extends FiresMapActions {
|
|
YourLocation loc;
|
|
|
|
EditConfirmYourLocationAction(this.loc);
|
|
}
|
|
|
|
class EditCancelYourLocationAction extends FiresMapActions {
|
|
YourLocation loc;
|
|
EditCancelYourLocationAction(this.loc);
|
|
}
|
|
|
|
class SelectMapLayerAction extends FiresMapActions {
|
|
final FireMapLayer layer;
|
|
|
|
SelectMapLayerAction(this.layer);
|
|
}
|