diff options
Diffstat (limited to 'lib/services')
| -rw-r--r-- | lib/services/storegear_api_service.dart | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/lib/services/storegear_api_service.dart b/lib/services/storegear_api_service.dart index b346292..ecd0c94 100644 --- a/lib/services/storegear_api_service.dart +++ b/lib/services/storegear_api_service.dart @@ -30,8 +30,42 @@ class StoregearApiService extends IStoregearApiService { } } + _getMockRouteList() { + return RouteList.fromJson(jsonDecode(''' +{ + "routes": [ + { + "timeframe_key": "96870", + "trip_key": "18996870", + "trip_number": "9", + "trip_pda_status": "5", + "trip_pda_status_description": "Rit overgedragen", + "trip_sequence_number": "1", + "number_in_trip": "139", + "plate": "VND-37-B", + "damage_registration": true, + "eva": "11:11", + "trip_date": "4/11/2022", + "first_address_lat": "50.8996568140536", + "first_address_lng": "5.75238472757395", + "started": "true", + "all_tasks_finished": "false", + "start_km": "24704", + "end_km": null, + "tasks_enriched": "true", + "in_trip_scan_finished": "true", + "eva_added": "true", + "trip_start_request_sent": "true" + } + ] +} +''')); + } + @override Future<RouteList> getRoutes() async { + return _getMockRouteList(); + debugPrint('WE GOT HERE!!! ' + apiKey); final response = await http.get( Uri.parse('http://dhlapis.com/delivery/v1/routes'), @@ -44,9 +78,9 @@ class StoregearApiService extends IStoregearApiService { var content = jsonDecode(response.body); if (content["message"] != null) { - content = jsonEncode(RouteList()); + return RouteList(routes: []); } - + debugPrint('amogus'); return RouteList.fromJson(content); } else { // If the server did not return a 200 OK response, |
