fix: nastavit fixní verze a opravit offline crash

This commit is contained in:
Matyáš Caras 2022-09-06 20:02:37 +02:00
parent a51e16907d
commit c6a60744b7
3 changed files with 16 additions and 6 deletions

View file

@ -356,8 +356,18 @@ class _JidelnicekPageState extends State<JidelnicekPage> {
f.deleteSync(); f.deleteSync();
} }
} }
// Uložíme nová data // Uložíme nová data
var j = await widget.canteen.jidelnicekDen(); Jidelnicek j = Jidelnicek(DateTime.now(), []);
try {
j = await widget.canteen.jidelnicekDen();
} catch (e) {
if (!widget.canteen.prihlasen) {
if (!mounted) return; // ! Přidat chybu, pokud není mounted
Navigator.pushReplacement(
context, MaterialPageRoute(builder: (c) => const LoginPage()));
}
}
var soubor = File( var soubor = File(
"${appDocDir.path}/jidelnicek_${den.year}-${den.month}-${den.day}.json"); "${appDocDir.path}/jidelnicek_${den.year}-${den.month}-${den.day}.json");
soubor.createSync(); soubor.createSync();

View file

@ -110,14 +110,14 @@ packages:
name: flutter_local_notifications name: flutter_local_notifications
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "9.9.1" version: "9.5.3+1"
flutter_local_notifications_linux: flutter_local_notifications_linux:
dependency: transitive dependency: transitive
description: description:
name: flutter_local_notifications_linux name: flutter_local_notifications_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.5.1" version: "0.4.2"
flutter_local_notifications_platform_interface: flutter_local_notifications_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -143,7 +143,7 @@ packages:
name: flutter_secure_storage name: flutter_secure_storage
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.1.2" version: "5.0.2"
flutter_secure_storage_linux: flutter_secure_storage_linux:
dependency: transitive dependency: transitive
description: description:

View file

@ -17,12 +17,12 @@ dependencies:
flutter_localizations: flutter_localizations:
sdk: flutter sdk: flutter
canteenlib: ^1.0.0 canteenlib: ^1.0.0
flutter_secure_storage: ^5.0.2 flutter_secure_storage: 5.0.2
url_launcher: ^6.0.20 url_launcher: ^6.0.20
path_provider: ^2.0.9 path_provider: ^2.0.9
shared_preferences: ^2.0.13 shared_preferences: ^2.0.13
introduction_screen: ^3.0.1 introduction_screen: ^3.0.1
flutter_local_notifications: ^9.5.3+1 flutter_local_notifications: 9.5.3+1
timezone: ^0.8.0 timezone: ^0.8.0
flutter_native_timezone: ^2.0.0 flutter_native_timezone: ^2.0.0
intl: ^0.17.0 intl: ^0.17.0