automatically save a trip when it is first created
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Build and release debug APK / Build APK (pull_request) Failing after 3m52s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Build and release debug APK / Build APK (pull_request) Failing after 3m52s
				
			This commit is contained in:
		| @@ -1,5 +1,6 @@ | ||||
| import "dart:convert"; | ||||
| import "dart:developer"; | ||||
| import "package:anyway/main.dart"; | ||||
| import 'package:dio/dio.dart'; | ||||
|  | ||||
| import 'package:anyway/constants.dart'; | ||||
| @@ -82,6 +83,8 @@ fetchTrip( | ||||
|     } | ||||
|  | ||||
|   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) { | ||||
|     throw Exception(response.data["detail"]); | ||||
|   } | ||||
|   log(response.data.toString()); | ||||
|   // log(response.data.toString()); | ||||
|   Map<String, dynamic> json = response.data; | ||||
|   String? nextUUID = json["next_uuid"]; | ||||
|   Landmark landmark = Landmark.fromJson(json); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user