update to v3 upload action
Some checks failed
Release / meta (push) Successful in 3s
Release / linux-build (push) Successful in 1m35s
Release / android-build (push) Successful in 4m50s
Release / windows-build (push) Has been cancelled
Release / release-dev (push) Has been cancelled
Release / release-master (push) Has been cancelled

This commit is contained in:
2025-12-11 01:52:48 +00:00
parent 40fb88a089
commit c8d962b770
4 changed files with 63 additions and 10 deletions

View File

@@ -261,8 +261,26 @@ class DataService extends ChangeNotifier {
Future<void> fetchTrips() async {
try {
final json = await api.get('/trips');
Iterable<dynamic>? raw;
if (json is List) {
_tripList = json.map((e) => TripSummary.fromJson(e)).toList();
raw = json;
} else if (json is Map) {
for (final key in ['trips', 'trip_data', 'data']) {
final value = json[key];
if (value is List) {
raw = value;
break;
}
}
}
if (raw != null) {
_tripList = raw
.whereType<Map<String, dynamic>>()
.map((e) => TripSummary.fromJson(e))
.toList();
} else {
debugPrint('Unexpected trip list response: $json');
_tripList = [];
}
} catch (e) {
debugPrint('Failed to fetch trip list: $e');