import 'dart:collection'; import 'package:anyway/structs/trip.dart'; import 'package:anyway/structs/landmark.dart'; import 'package:shared_preferences/shared_preferences.dart'; Future> loadTrips() async { SharedPreferences prefs = await SharedPreferences.getInstance(); List trips = []; Set keys = prefs.getKeys(); for (String key in keys) { if (key.startsWith('trip_')) { String uuid = key.replaceFirst('trip_', ''); trips.add(Trip.fromPrefs(prefs, uuid)); } } return trips; }