diff --git a/android/settings.gradle b/android/settings.gradle index a7ac45f4..253bd048 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.3.0" apply false + id "com.android.application" version '8.3.1' apply false id "org.jetbrains.kotlin.android" version "1.9.20" apply false id "com.google.gms.google-services" version "4.4.0" apply false id "com.google.firebase.crashlytics" version "2.9.9" apply false diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 098821c9..d8001a42 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -17,9 +17,9 @@ PODS: - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) - - FirebaseCoreExtension (10.22.0): + - FirebaseCoreExtension (10.23.0): - FirebaseCore (~> 10.0) - - FirebaseCoreInternal (10.22.0): + - FirebaseCoreInternal (10.23.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - FirebaseCrashlytics (10.22.0): - FirebaseCore (~> 10.5) @@ -29,12 +29,12 @@ PODS: - GoogleUtilities/Environment (~> 7.8) - nanopb (< 2.30911.0, >= 2.30908.0) - PromisesObjC (~> 2.1) - - FirebaseInstallations (10.22.0): + - FirebaseInstallations (10.23.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - PromisesObjC (~> 2.1) - - FirebaseSessions (10.22.0): + - FirebaseSessions (10.23.0): - FirebaseCore (~> 10.5) - FirebaseCoreExtension (~> 10.0) - FirebaseInstallations (~> 10.0) @@ -191,11 +191,11 @@ SPEC CHECKSUMS: firebase_core: 100945864b4aedce3cfef0c62ab864858bf013cf firebase_crashlytics: 2b9ca6246501a03427eb43280be7615027e32142 FirebaseCore: 0326ec9b05fbed8f8716cddbf0e36894a13837f7 - FirebaseCoreExtension: 6394c00b887d0bebadbc7049c464aa0cbddc5d41 - FirebaseCoreInternal: bca337352024b18424a61e478460547d46c4c753 + FirebaseCoreExtension: cb88851781a24e031d1b58e0bd01eb1f46b044b5 + FirebaseCoreInternal: 6a292e6f0bece1243a737e81556e56e5e19282e3 FirebaseCrashlytics: e568d68ce89117c80cddb04073ab9018725fbb8c - FirebaseInstallations: 763814908793c0da14c18b3dcffdec71e29ed55e - FirebaseSessions: cd97fb07674f3906619c871eefbd260a1546c9d3 + FirebaseInstallations: 42d6ead4605d6eafb3b6683674e80e18eb6f2c35 + FirebaseSessions: f06853e30f99fe42aa511014d7ee6c8c319f08a3 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778 flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be diff --git a/lib/departuresComponent/model/departure.dart b/lib/departuresComponent/model/departure.dart index 78420622..d051262d 100644 --- a/lib/departuresComponent/model/departure.dart +++ b/lib/departuresComponent/model/departure.dart @@ -11,7 +11,7 @@ class Departure { @JsonKey(fromJson: StringParser.stringToInt) final int countdown; @JsonKey(fromJson: plannedDate) - final DateTime dateTime; + final DateTime? dateTime; @JsonKey(fromJson: realDate) final DateTime? realDateTime; final ServingLine servingLine; diff --git a/lib/departuresComponent/model/departure.g.dart b/lib/departuresComponent/model/departure.g.dart index fe9d18a8..b9af59f0 100644 --- a/lib/departuresComponent/model/departure.g.dart +++ b/lib/departuresComponent/model/departure.g.dart @@ -22,7 +22,7 @@ Departure _$DepartureFromJson(Map json) => Departure( Map _$DepartureToJson(Departure instance) => { 'stopID': instance.stopId, 'countdown': instance.countdown, - 'dateTime': instance.dateTime.toIso8601String(), + 'dateTime': instance.dateTime?.toIso8601String(), 'realDateTime': instance.realDateTime?.toIso8601String(), 'servingLine': instance.servingLine, 'lineInfos': instance.lineInfos, diff --git a/lib/departuresComponent/viewModel/departures_viewmodel.dart b/lib/departuresComponent/viewModel/departures_viewmodel.dart index 26a55878..ff6f1623 100644 --- a/lib/departuresComponent/viewModel/departures_viewmodel.dart +++ b/lib/departuresComponent/viewModel/departures_viewmodel.dart @@ -158,12 +158,16 @@ class DeparturesViewModel { response.data.departures.sort((departure1, departure2) { if (departure1.realDateTime != null && departure2.realDateTime != null) { return departure1.realDateTime!.compareTo(departure2.realDateTime!); - } else if (departure1.realDateTime != null) { - return departure1.realDateTime!.compareTo(departure2.dateTime); - } else if (departure2.realDateTime != null) { - return departure1.dateTime.compareTo(departure2.realDateTime!); + } else if (departure1.realDateTime != null && + departure2.dateTime != null) { + return departure1.realDateTime!.compareTo(departure2.dateTime!); + } else if (departure2.realDateTime != null && + departure2.dateTime != null) { + return departure1.dateTime!.compareTo(departure2.realDateTime!); + } else if (departure1.dateTime != null && departure2.dateTime != null) { + return departure1.dateTime!.compareTo(departure2.dateTime!); } else { - return departure1.dateTime.compareTo(departure2.dateTime); + return 0; } }); diff --git a/lib/departuresComponent/views/departures_details_row_view.dart b/lib/departuresComponent/views/departures_details_row_view.dart index b22f38a5..5cfffaaf 100644 --- a/lib/departuresComponent/views/departures_details_row_view.dart +++ b/lib/departuresComponent/views/departures_details_row_view.dart @@ -111,16 +111,16 @@ class DeparturesDetailsRowView extends ConsumerWidget { } } - Widget timeBuilder(BuildContext context, DateTime dateTime, Color? color) { - // TODO: walking distance + Widget timeBuilder(BuildContext context, DateTime? dateTime, Color? color) { + // TODO: walking distance? if (departure.countdown < 1) { return Text( context.localizations.now, style: TextStyle(color: color, fontWeight: FontWeight.w500), ); } else { - final hour = NumberFormat("00").format(dateTime.hour); - final minute = NumberFormat("00").format(dateTime.minute); + final hour = NumberFormat("00").format(dateTime?.hour ?? 00); + final minute = NumberFormat("00").format(dateTime?.minute ?? 00); return Text( "$hour:$minute", style: TextStyle(color: color, fontWeight: FontWeight.w500), diff --git a/pubspec.lock b/pubspec.lock index 2810b34a..a1b966f8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -513,10 +513,10 @@ packages: dependency: transitive description: name: geolocator_android - sha256: "136f1c97e1903366393bda514c5d9e98843418baea52899aa45edae9af8a5cd6" + sha256: f15d1536cd01b1399578f1da1eb5d566e7a718db6a3648f2c24d2e2f859f0692 url: "https://pub.dev" source: hosted - version: "4.5.2" + version: "4.5.4" geolocator_apple: dependency: transitive description: @@ -610,7 +610,7 @@ packages: description: path: "packages/google_maps_flutter/google_maps_flutter_ios" ref: main - resolved-ref: a5011d9f6751eb916dfe9b6579c40d2d778bbf3c + resolved-ref: "99ce8f085c3a6e72cabdde7098f0922d6a84bec5" url: "https://github.com/jakobkoerber/packages.git" source: git version: "2.5.1"