quite a few UX improvements
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user