mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-10-11 02:08:43 +02:00
Edge cases - UX bugs
This commit is contained in:
1 parent
19de232484
commit
40c78ab3b7
5 files changed
+69
-11
No files matched your search
@@ -203,6 +203,11 @@ class MapViewState extends State<MapView> {
|
||||
void retryLocationInit() {
|
||||
_gpsController.retryLocationInit();
|
||||
}
|
||||
|
||||
/// Get current user location
|
||||
LatLng? getUserLocation() {
|
||||
return _gpsController.currentLocation;
|
||||
}
|
||||
|
||||
/// Expose static methods from MapPositionManager for external access
|
||||
static Future<void> clearStoredMapPosition() =>
|
||||
@@ -390,7 +395,7 @@ class MapViewState extends State<MapView> {
|
||||
}
|
||||
|
||||
// Build start/end pins for route visualization
|
||||
if (appState.showingOverview || appState.isInRouteMode) {
|
||||
if (appState.showingOverview || appState.isInRouteMode || appState.isSettingSecondPoint) {
|
||||
if (appState.routeStart != null) {
|
||||
centerMarkers.add(
|
||||
Marker(
|
||||
@@ -415,13 +420,15 @@ class MapViewState extends State<MapView> {
|
||||
|
||||
// Build route path visualization
|
||||
final routeLines = <Polyline>[];
|
||||
if (appState.routePath != null && appState.routePath!.length > 1 &&
|
||||
(appState.showingOverview || appState.isInRouteMode)) {
|
||||
routeLines.add(Polyline(
|
||||
points: appState.routePath!,
|
||||
color: Colors.blue,
|
||||
strokeWidth: 4.0,
|
||||
));
|
||||
if (appState.routePath != null && appState.routePath!.length > 1) {
|
||||
// Show route line during overview or active route
|
||||
if (appState.showingOverview || appState.isInRouteMode) {
|
||||
routeLines.add(Polyline(
|
||||
points: appState.routePath!,
|
||||
color: Colors.blue,
|
||||
strokeWidth: 4.0,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return Stack(
|
||||
|
||||
@@ -6,7 +6,12 @@ import 'package:latlong2/latlong.dart';
|
||||
import '../app_state.dart';
|
||||
|
||||
class NavigationSheet extends StatelessWidget {
|
||||
const NavigationSheet({super.key});
|
||||
final VoidCallback? onStartRoute;
|
||||
|
||||
const NavigationSheet({
|
||||
super.key,
|
||||
this.onStartRoute,
|
||||
});
|
||||
|
||||
String _formatCoordinates(LatLng coordinates) {
|
||||
return '${coordinates.latitude.toStringAsFixed(6)}, ${coordinates.longitude.toStringAsFixed(6)}';
|
||||
@@ -207,7 +212,7 @@ class NavigationSheet extends StatelessWidget {
|
||||
child: ElevatedButton.icon(
|
||||
icon: const Icon(Icons.play_arrow),
|
||||
label: const Text('Start'),
|
||||
onPressed: () => appState.startRoute(),
|
||||
onPressed: onStartRoute ?? () => appState.startRoute(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
|
||||
Reference in new issue
Block a user