diff --git a/lib/okna/about.dart b/lib/okna/about.dart index 4816505..0903b42 100644 --- a/lib/okna/about.dart +++ b/lib/okna/about.dart @@ -15,48 +15,55 @@ class _AboutPageState extends State { appBar: AppBar( title: const Text("O Aplikaci"), ), - body: SizedBox( - height: MediaQuery.of(context).size.height, - child: Column(mainAxisSize: MainAxisSize.min, children: [ - const Text("OpenCanteen", style: TextStyle(fontSize: 30)), - const Text("© 2022 Matyáš Caras a přispěvatelé"), - InkWell( - onTap: () => launch( - "https://github.com/hernikplays/opencanteen/blob/main/LICENSE"), - child: const Text("Vydáno pod licencí GNU GPLv3")), - const SizedBox(height: 15), - const Text("Použité knihovny:", style: TextStyle(fontSize: 19)), - const SizedBox(height: 10), - cudlik( - "Flutter", - "Copyright 2014 The Flutter Authors. All rights reserved, licence BSD 3-Clause", - "https://github.com/flutter/flutter/blob/master/LICENSE"), - const SizedBox(height: 10), - cudlik( - "Flutter_secure_storage", - "Copyright 2017 German Saprykin. All rights reserved, licence BSD 3-Clause", - "https://github.com/mogol/flutter_secure_storage/blob/develop/flutter_secure_storage/LICENSE"), - const SizedBox(height: 10), - cudlik( - "connectivity_plus", - "Copyright 2017 The Chromium Authors. All rights reserved, licence BSD 3-Clause", - "https://github.com/fluttercommunity/plus_plugins/blob/main/packages/connectivity_plus/connectivity_plus/LICENSE"), - const SizedBox(height: 10), - cudlik( - "url_launcher", - "Copyright 2013 The Flutter Authors. All rights reserved, licence BSD 3-Clause", - "https://github.com/flutter/plugins/blob/main/packages/url_launcher/url_launcher/LICENSE"), - const SizedBox(height: 10), - cudlik( - "canteenlib", - "Copyright (c) 2022 Matyáš Caras and contributors, licence MIT", - "https://github.com/hernikplays/canteenlib/blob/main/LICENSE"), - const SizedBox(height: 10), - cudlik( - "path_provider", - "Copyright 2013 The Flutter Authors. All rights reserved., licence BSD-3-Clause", - "https://github.com/flutter/plugins/blob/main/packages/path_provider/path_provider/LICENSE") - ]), + body: SingleChildScrollView( + child: SizedBox( + height: MediaQuery.of(context).size.height, + child: Column(mainAxisSize: MainAxisSize.min, children: [ + const Text("OpenCanteen", style: TextStyle(fontSize: 30)), + const Text("© 2022 Matyáš Caras a přispěvatelé"), + InkWell( + onTap: () => launch( + "https://github.com/hernikplays/opencanteen/blob/main/LICENSE"), + child: const Text("Vydáno pod licencí GNU GPLv3")), + const SizedBox(height: 15), + const Text("Použité knihovny:", style: TextStyle(fontSize: 19)), + const SizedBox(height: 10), + cudlik( + "Flutter", + "Copyright 2014 The Flutter Authors. All rights reserved, licence BSD 3-Clause", + "https://github.com/flutter/flutter/blob/master/LICENSE"), + const SizedBox(height: 10), + cudlik( + "Flutter_secure_storage", + "Copyright 2017 German Saprykin. All rights reserved, licence BSD 3-Clause", + "https://github.com/mogol/flutter_secure_storage/blob/develop/flutter_secure_storage/LICENSE"), + const SizedBox(height: 10), + cudlik( + "connectivity_plus", + "Copyright 2017 The Chromium Authors. All rights reserved, licence BSD 3-Clause", + "https://github.com/fluttercommunity/plus_plugins/blob/main/packages/connectivity_plus/connectivity_plus/LICENSE"), + const SizedBox(height: 10), + cudlik( + "url_launcher", + "Copyright 2013 The Flutter Authors. All rights reserved, licence BSD 3-Clause", + "https://github.com/flutter/plugins/blob/main/packages/url_launcher/url_launcher/LICENSE"), + const SizedBox(height: 10), + cudlik( + "canteenlib", + "Copyright (c) 2022 Matyáš Caras and contributors, licence MIT", + "https://github.com/hernikplays/canteenlib/blob/main/LICENSE"), + const SizedBox(height: 10), + cudlik( + "path_provider", + "Copyright 2013 The Flutter Authors. All rights reserved., licence BSD-3-Clause", + "https://github.com/flutter/plugins/blob/main/packages/path_provider/path_provider/LICENSE"), + const SizedBox(height: 10), + cudlik( + "shared_preferences", + "Copyright 2013 The Flutter Authors. All rights reserved., licence BSD-3-Clause", + "https://github.com/flutter/plugins/blob/main/packages/path_provider/path_provider/LICENSE") + ]), + ), ), ); } diff --git a/lib/okna/jidelnicek.dart b/lib/okna/jidelnicek.dart index af3fbc0..dc254eb 100644 --- a/lib/okna/jidelnicek.dart +++ b/lib/okna/jidelnicek.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:opencanteen/util.dart'; import 'package:path_provider/path_provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'package:url_launcher/url_launcher.dart'; import '../loginmanager.dart'; @@ -212,7 +213,8 @@ class _JidelnicekPageState extends State { /// uložení jídelníčku pro dnešek offline void ulozitDnesekOffline() async { - if (await LoginManager.zapamatovat()) { + var prefs = await SharedPreferences.getInstance(); + if (prefs.getBool("offline") != null && prefs.getBool("offline")!) { Directory appDocDir = await getApplicationDocumentsDirectory(); for (var f in appDocDir.listSync()) { // Vymažeme obsah diff --git a/lib/okna/nastaveni.dart b/lib/okna/nastaveni.dart new file mode 100644 index 0000000..f219298 --- /dev/null +++ b/lib/okna/nastaveni.dart @@ -0,0 +1,16 @@ +import 'package:flutter/material.dart'; +// TODO + +class Nastaveni extends StatefulWidget { + const Nastaveni({Key? key}) : super(key: key); + + @override + State createState() => _NastaveniState(); +} + +class _NastaveniState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/pubspec.lock b/pubspec.lock index 01c6997..c2025eb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -28,7 +28,7 @@ packages: name: canteenlib url: "https://pub.dartlang.org" source: hosted - version: "0.1.0-alpha.15" + version: "0.1.0-alpha.16" characters: dependency: transitive description: @@ -345,6 +345,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.2.4" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" sky_engine: dependency: transitive description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 3d28314..14f0f79 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,11 +16,12 @@ dependencies: sdk: flutter flutter_localizations: sdk: flutter - canteenlib: ^0.1.0-alpha.15 + canteenlib: ^0.1.0-alpha.16 connectivity_plus: ^2.2.1 flutter_secure_storage: ^5.0.2 url_launcher: ^6.0.20 path_provider: ^2.0.9 + shared_preferences: ^2.0.13 dev_dependencies: flutter_lints: ^1.0.0