Big overhaul of the UI and usability of the app #61
| @@ -19,8 +19,6 @@ class _saveButtonState extends State<saveButton> { | |||||||
|     return ElevatedButton( |     return ElevatedButton( | ||||||
|       onPressed: () async { |       onPressed: () async { | ||||||
|         savedTrips.addTrip(widget.trip); |         savedTrips.addTrip(widget.trip); | ||||||
|         // SharedPreferences prefs = await SharedPreferences.getInstance(); |  | ||||||
|         // setState(() => widget.trip.toPrefs(prefs)); |  | ||||||
|         rootScaffoldMessengerKey.currentState!.showSnackBar( |         rootScaffoldMessengerKey.currentState!.showSnackBar( | ||||||
|           SnackBar( |           SnackBar( | ||||||
|             content: Text('Trip saved'), |             content: Text('Trip saved'), | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| import "dart:convert"; | import "dart:convert"; | ||||||
| import "dart:developer"; | import "dart:developer"; | ||||||
|  | import "package:anyway/main.dart"; | ||||||
| import 'package:dio/dio.dart'; | import 'package:dio/dio.dart'; | ||||||
|  |  | ||||||
| import 'package:anyway/constants.dart'; | import 'package:anyway/constants.dart'; | ||||||
| @@ -82,6 +83,8 @@ fetchTrip( | |||||||
|     } |     } | ||||||
|  |  | ||||||
|   log(response.data.toString()); |   log(response.data.toString()); | ||||||
|  |   // Also save the trip for the user's convenience | ||||||
|  |   savedTrips.addTrip(trip); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -113,7 +116,7 @@ Future<(Landmark, String?)> fetchLandmark(String uuid) async { | |||||||
|   if (response.data["detail"] != null) { |   if (response.data["detail"] != null) { | ||||||
|     throw Exception(response.data["detail"]); |     throw Exception(response.data["detail"]); | ||||||
|   } |   } | ||||||
|   log(response.data.toString()); |   // log(response.data.toString()); | ||||||
|   Map<String, dynamic> json = response.data; |   Map<String, dynamic> json = response.data; | ||||||
|   String? nextUUID = json["next_uuid"]; |   String? nextUUID = json["next_uuid"]; | ||||||
|   Landmark landmark = Landmark.fromJson(json); |   Landmark landmark = Landmark.fromJson(json); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user