quite a few UX improvements

This commit is contained in:
2025-03-23 20:00:24 +01:00
parent 4ad867e609
commit e148c851e1
12 changed files with 166 additions and 60 deletions

View File

@@ -1,5 +1,6 @@
import 'package:anyway/layouts/scaffold.dart';
import 'package:anyway/modules/new_trip_button.dart';
import 'package:anyway/structs/landmark.dart';
import 'package:anyway/structs/preferences.dart';
import 'package:anyway/structs/trip.dart';
import 'package:flutter/cupertino.dart';
@@ -20,6 +21,14 @@ class _NewTripPreferencesPageState extends State<NewTripPreferencesPage> with Sc
@override
Widget build(BuildContext context) {
// Ensure that the trip is "empty" save for the start landmark
// This is necessary because users can swipe back to this page even after the trip has been created
if (widget.trip.landmarks.length > 1) {
Landmark start = widget.trip.landmarks.first;
widget.trip.landmarks.clear();
widget.trip.addLandmark(start);
}
return mainScaffold(
context,
child: Scaffold(