todos-contra-el-fuego-mobile/lib/redux/fireMapActions.dart
vjrj 14b558340d feat: replace layer toggle with layer selector menu
- 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
2026-03-06 08:48:59 +01:00

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);
}