mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-08-09 12:36:08 +02:00
bunch of stuff, good luck. still need to fix user-by-mode thing
This commit is contained in:
@@ -82,7 +82,11 @@ class _MapViewState extends State<MapView> {
|
||||
} catch (_) {
|
||||
return; // controller not ready yet
|
||||
}
|
||||
final cams = await _overpass.fetchCameras(bounds, appState.enabledProfiles);
|
||||
final cams = await _overpass.fetchCameras(
|
||||
bounds,
|
||||
appState.enabledProfiles,
|
||||
uploadMode: appState.uploadMode,
|
||||
);
|
||||
if (mounted) setState(() => _cameras = cams);
|
||||
}
|
||||
|
||||
@@ -99,6 +103,12 @@ class _MapViewState extends State<MapView> {
|
||||
final appState = context.watch<AppState>();
|
||||
final session = appState.session;
|
||||
|
||||
// Always watch for changes on uploadMode/profiles and refresh if needed
|
||||
// (debounced, to avoid flooding when quickly toggling)
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_debounce(() => _refreshCameras(appState));
|
||||
});
|
||||
|
||||
// Seed add‑mode target once, after first controller center is available.
|
||||
if (session != null && session.target == null) {
|
||||
try {
|
||||
@@ -181,6 +191,36 @@ class _MapViewState extends State<MapView> {
|
||||
],
|
||||
),
|
||||
|
||||
// MODE INDICATOR badge (top-right)
|
||||
if (appState.uploadMode == UploadMode.sandbox || appState.uploadMode == UploadMode.simulate)
|
||||
Positioned(
|
||||
top: 18,
|
||||
right: 14,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: appState.uploadMode == UploadMode.sandbox
|
||||
? Colors.orange.withOpacity(0.90)
|
||||
: Colors.deepPurple.withOpacity(0.80),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(color: Colors.black26, blurRadius: 5, offset: Offset(0,2)),
|
||||
],
|
||||
),
|
||||
child: Text(
|
||||
appState.uploadMode == UploadMode.sandbox
|
||||
? 'SANDBOX MODE'
|
||||
: 'SIMULATE',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
letterSpacing: 1.1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Attribution overlay
|
||||
Positioned(
|
||||
bottom: 20,
|
||||
|
||||
Reference in New Issue
Block a user