mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-08-14 15:10:36 +02:00
UX working
This commit is contained in:
@@ -2,10 +2,11 @@ import 'package:flutter/material.dart';
|
||||
import '../dev_config.dart';
|
||||
|
||||
enum CameraIconType {
|
||||
real, // Blue ring - real cameras from OSM
|
||||
mock, // White ring - add camera mock point
|
||||
pending, // Purple ring - submitted/pending cameras
|
||||
editing, // Orange ring - camera being edited
|
||||
real, // Blue ring - real cameras from OSM
|
||||
mock, // White ring - add camera mock point
|
||||
pending, // Purple ring - submitted/pending cameras
|
||||
editing, // Orange ring - camera being edited
|
||||
pendingEdit, // Grey ring - original camera with pending edit
|
||||
}
|
||||
|
||||
/// Simple camera icon with grey dot and colored ring
|
||||
@@ -24,6 +25,8 @@ class CameraIcon extends StatelessWidget {
|
||||
return kCameraRingColorPending;
|
||||
case CameraIconType.editing:
|
||||
return kCameraRingColorEditing;
|
||||
case CameraIconType.pendingEdit:
|
||||
return kCameraRingColorPendingEdit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,11 @@ class CameraTagSheet extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final appState = context.watch<AppState>();
|
||||
|
||||
// Check if this camera is editable (not a pending upload)
|
||||
final isEditable = !node.tags.containsKey('_pending_upload') ||
|
||||
node.tags['_pending_upload'] != 'true';
|
||||
// Check if this camera is editable (not a pending upload or pending edit)
|
||||
final isEditable = (!node.tags.containsKey('_pending_upload') ||
|
||||
node.tags['_pending_upload'] != 'true') &&
|
||||
(!node.tags.containsKey('_pending_edit') ||
|
||||
node.tags['_pending_edit'] != 'true');
|
||||
|
||||
void _openEditSheet() {
|
||||
Navigator.pop(context); // Close this sheet first
|
||||
|
||||
@@ -46,16 +46,25 @@ class _CameraMapMarkerState extends State<CameraMapMarker> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Check if this is a pending upload
|
||||
final isPending = widget.node.tags.containsKey('_pending_upload') &&
|
||||
widget.node.tags['_pending_upload'] == 'true';
|
||||
// Check camera state
|
||||
final isPendingUpload = widget.node.tags.containsKey('_pending_upload') &&
|
||||
widget.node.tags['_pending_upload'] == 'true';
|
||||
final isPendingEdit = widget.node.tags.containsKey('_pending_edit') &&
|
||||
widget.node.tags['_pending_edit'] == 'true';
|
||||
|
||||
CameraIconType iconType;
|
||||
if (isPendingUpload) {
|
||||
iconType = CameraIconType.pending;
|
||||
} else if (isPendingEdit) {
|
||||
iconType = CameraIconType.pendingEdit;
|
||||
} else {
|
||||
iconType = CameraIconType.real;
|
||||
}
|
||||
|
||||
return GestureDetector(
|
||||
onTap: _onTap,
|
||||
onDoubleTap: _onDoubleTap,
|
||||
child: CameraIcon(
|
||||
type: isPending ? CameraIconType.pending : CameraIconType.real,
|
||||
),
|
||||
child: CameraIcon(type: iconType),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user