Merge branch 'autoburza' into autoburza-sync
This commit is contained in:
commit
31b6091e8d
|
@ -1,17 +1,25 @@
|
||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="Dart SDK">
|
<library name="Dart SDK">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/async" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/async" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/collection" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/cli" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/convert" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/collection" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/core" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/convert" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/developer" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/core" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/html" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/developer" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/io" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/ffi" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/isolate" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/html" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/math" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/indexed_db" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/mirrors" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/io" />
|
||||||
<root url="file://C:\flutter/bin/cache/dart-sdk/lib/typed_data" />
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/isolate" />
|
||||||
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/js" />
|
||||||
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/js_util" />
|
||||||
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/math" />
|
||||||
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/mirrors" />
|
||||||
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/svg" />
|
||||||
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/typed_data" />
|
||||||
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/web_audio" />
|
||||||
|
<root url="file:///opt/flutter/bin/cache/dart-sdk/lib/web_gl" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
|
|
@ -1,17 +1,66 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="FileEditorManager">
|
<component name="AutoImportSettings">
|
||||||
<leaf>
|
<option name="autoReloadType" value="NONE" />
|
||||||
<file leaf-file-name="main.dart" pinned="false" current-in-tab="true">
|
</component>
|
||||||
<entry file="file://$PROJECT_DIR$/lib/main.dart">
|
<component name="ChangeListManager">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<list default="true" id="fb812771-e9e7-4fce-b8f3-64af4c4831fd" name="Changes" comment="">
|
||||||
<state relative-caret-position="0">
|
<change beforePath="$PROJECT_DIR$/.idea/libraries/Dart_SDK.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/libraries/Dart_SDK.xml" afterDir="false" />
|
||||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
</state>
|
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
|
||||||
</provider>
|
<change beforePath="$PROJECT_DIR$/android/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/android/app/build.gradle" afterDir="false" />
|
||||||
</entry>
|
<change beforePath="$PROJECT_DIR$/android/app/src/main/AndroidManifest.xml" beforeDir="false" afterPath="$PROJECT_DIR$/android/app/src/main/AndroidManifest.xml" afterDir="false" />
|
||||||
</file>
|
<change beforePath="$PROJECT_DIR$/android/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/android/build.gradle" afterDir="false" />
|
||||||
</leaf>
|
<change beforePath="$PROJECT_DIR$/android/opencanteen_android.iml" beforeDir="false" afterPath="$PROJECT_DIR$/android/opencanteen_android.iml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/ios/Runner/AppDelegate.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Runner/AppDelegate.swift" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/lib/lang/lang.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/lang/lang.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/lib/lang/lang_cz.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/lang/lang_cz.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/lib/lang/lang_en.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/lang/lang_en.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/lib/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/main.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/lib/okna/about.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/okna/about.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/lib/okna/nastaveni.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/okna/nastaveni.dart" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/pubspec.lock" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.lock" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/pubspec.yaml" afterDir="false" />
|
||||||
|
</list>
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="Git.Settings">
|
||||||
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectId" id="29eu54xQdUiQHx3lTDIjSQh4nnl" />
|
||||||
|
<component name="ProjectView">
|
||||||
|
<navigator currentView="ProjectPane" proportions="" version="1" />
|
||||||
|
<panes>
|
||||||
|
<pane id="ProjectPane">
|
||||||
|
<option name="show-excluded-files" value="false" />
|
||||||
|
</pane>
|
||||||
|
</panes>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectViewState">
|
||||||
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
|
<option name="showLibraryContents" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent">
|
||||||
|
<property name="RunOnceActivity.cidr.known.project.marker" value="true" />
|
||||||
|
<property name="cidr.known.project.marker" value="true" />
|
||||||
|
<property name="dart.analysis.tool.window.force.activate" value="true" />
|
||||||
|
<property name="dart.analysis.tool.window.visible" value="false" />
|
||||||
|
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||||
|
<property name="show.migrate.to.gradle.popup" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||||
|
<component name="TaskManager">
|
||||||
|
<task active="true" id="Default" summary="Default task">
|
||||||
|
<changelist id="fb812771-e9e7-4fce-b8f3-64af4c4831fd" name="Changes" comment="" />
|
||||||
|
<created>1653485695149</created>
|
||||||
|
<option name="number" value="Default" />
|
||||||
|
<option name="presentableId" value="Default" />
|
||||||
|
<updated>1653485695149</updated>
|
||||||
|
</task>
|
||||||
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="ToolWindowManager">
|
<component name="ToolWindowManager">
|
||||||
<editor active="true" />
|
<editor active="true" />
|
||||||
|
@ -19,18 +68,4 @@
|
||||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||||
</layout>
|
</layout>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectView">
|
</project>
|
||||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
|
||||||
</navigator>
|
|
||||||
<panes>
|
|
||||||
<pane id="ProjectPane">
|
|
||||||
<option name="show-excluded-files" value="false" />
|
|
||||||
</pane>
|
|
||||||
</panes>
|
|
||||||
</component>
|
|
||||||
<component name="PropertiesComponent">
|
|
||||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
|
||||||
<property name="dart.analysis.tool.window.force.activate" value="true" />
|
|
||||||
<property name="show.migrate.to.gradle.popup" value="false" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
# 1.3.0
|
||||||
|
- Přidat možnost automatického objednávání z burzy
|
||||||
|
- Odstranit "connectivity_plus" knihovnu
|
||||||
|
- Změnit launch na launchUrl kvůli změnám v knihovně
|
||||||
|
- Nepodporovat instance s HTTP
|
||||||
# 1.2.0
|
# 1.2.0
|
||||||
- Přidat možnost zobrazení oznámení v případě neobjednaného jídla na příští týden
|
- Přidat možnost zobrazení oznámení v případě neobjednaného jídla na příští týden
|
||||||
- Přidat oznámení o rozbitých uložených údajích
|
- Přidat oznámení o rozbitých uložených údajích
|
||||||
|
|
|
@ -53,6 +53,7 @@ android {
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
|
multiDexEnabled true
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
@ -76,4 +77,5 @@ flutter {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
|
implementation 'com.android.support:multidex:1.0.3'
|
||||||
}
|
}
|
||||||
|
|
32
android/app/proguard-rules.pro
vendored
Normal file
32
android/app/proguard-rules.pro
vendored
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
##---------------Begin: proguard configuration for Gson ----------
|
||||||
|
# Gson uses generic type information stored in a class file when working with fields. Proguard
|
||||||
|
# removes such information by default, so configure it to keep all of it.
|
||||||
|
-keepattributes Signature
|
||||||
|
|
||||||
|
# For using GSON @Expose annotation
|
||||||
|
-keepattributes *Annotation*
|
||||||
|
|
||||||
|
# Gson specific classes
|
||||||
|
-dontwarn sun.misc.**
|
||||||
|
#-keep class com.google.gson.stream.** { *; }
|
||||||
|
|
||||||
|
# Application classes that will be serialized/deserialized over Gson
|
||||||
|
-keep class com.google.gson.examples.android.model.** { <fields>; }
|
||||||
|
|
||||||
|
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
|
||||||
|
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
|
||||||
|
-keep class * extends com.google.gson.TypeAdapter
|
||||||
|
-keep class * implements com.google.gson.TypeAdapterFactory
|
||||||
|
-keep class * implements com.google.gson.JsonSerializer
|
||||||
|
-keep class * implements com.google.gson.JsonDeserializer
|
||||||
|
|
||||||
|
# Prevent R8 from leaving Data object members always null
|
||||||
|
-keepclassmembers,allowobfuscation class * {
|
||||||
|
@com.google.gson.annotations.SerializedName <fields>;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
|
||||||
|
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
|
||||||
|
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
||||||
|
|
||||||
|
##---------------End: proguard configuration for Gson ----------
|
|
@ -1,7 +1,9 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="cz.hernikplays.opencanteen">
|
package="cz.hernikplays.opencanteen">
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<application
|
<application
|
||||||
|
tools:replace="android:label"
|
||||||
android:label="OpenCanteen"
|
android:label="OpenCanteen"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/launcher_icon"
|
android:icon="@mipmap/launcher_icon"
|
||||||
|
|
10
android/app/src/main/res/drawable/notif_icon.xml
Normal file
10
android/app/src/main/res/drawable/notif_icon.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="48dp"
|
||||||
|
android:height="48dp"
|
||||||
|
android:viewportWidth="48"
|
||||||
|
android:viewportHeight="48"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M8.25,42 L6.15,39.9 27.15,18.9Q26.05,16.5 26.65,13.925Q27.25,11.35 29.5,9.1Q31.75,6.9 34.95,6.275Q38.15,5.65 40.2,7.7Q42.3,9.8 41.625,12.95Q40.95,16.1 38.6,18.5Q36.55,20.6 34.025,21.25Q31.5,21.9 29.3,20.95L25.95,24.3L41.55,39.9L39.45,42L23.85,26.4ZM14.5,24.45 L8.55,18.5Q6,15.95 5.9,12.45Q5.8,8.95 8.2,6.25L20.45,18.5Z"/>
|
||||||
|
</vector>
|
3
android/app/src/main/res/raw/keep.xml
Normal file
3
android/app/src/main/res/raw/keep.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:keep="@drawable/notif_icon"/>
|
|
@ -15,6 +15,10 @@ allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
// [required] background_fetch
|
||||||
|
url "${project(':background_fetch').projectDir}/libs"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,11 @@
|
||||||
<sourceFolder url="file://$MODULE_DIR$/app/src/main/java" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/app/src/main/java" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/app/src/main/kotlin" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/app/src/main/kotlin" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
|
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/app/src/main/res" type="java-resource" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
|
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="Flutter for Android" level="project" />
|
<orderEntry type="library" name="Flutter for Android" level="project" />
|
||||||
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
|
@ -7,6 +7,9 @@ import Flutter
|
||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
) -> Bool {
|
) -> Bool {
|
||||||
|
if #available(iOS 10.0, *) {
|
||||||
|
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
|
||||||
|
}
|
||||||
GeneratedPluginRegistrant.register(with: self)
|
GeneratedPluginRegistrant.register(with: self)
|
||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,8 +145,15 @@ abstract class Languages {
|
||||||
|
|
||||||
String get checkOrdered;
|
String get checkOrdered;
|
||||||
|
|
||||||
|
String get autoBurza;
|
||||||
|
|
||||||
|
String get autoburzaNeeds;
|
||||||
|
|
||||||
// Offline
|
// Offline
|
||||||
String get offline;
|
String get offline;
|
||||||
|
|
||||||
String get mustLogout;
|
String get mustLogout;
|
||||||
|
|
||||||
|
// Autoburza
|
||||||
|
String get autoFound;
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,4 +207,14 @@ class LanguageCz extends Languages {
|
||||||
@override
|
@override
|
||||||
String get corrupted =>
|
String get corrupted =>
|
||||||
"Nastal problém s dešifrováním uložených údajů, prosím zkuste vyčistit veškerá data této aplikace.";
|
"Nastal problém s dešifrováním uložených údajů, prosím zkuste vyčistit veškerá data této aplikace.";
|
||||||
|
|
||||||
|
String get autoBurza =>
|
||||||
|
"Automaticky objednat jídlo z burzy, pokud žádné nemám";
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get autoburzaNeeds =>
|
||||||
|
"Tato funkcionalita vyžaduje stálé internetové připojení a vaše údaje musí být uložené (pomocí přepínače 'Zapamatovat si mě' na přihlašovací obrazovce)";
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get autoFound => "Objednáno jídlo z burzy";
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,4 +206,14 @@ class LanguageEn extends Languages {
|
||||||
@override
|
@override
|
||||||
String get corrupted =>
|
String get corrupted =>
|
||||||
"The saved credentials seem to be corrupted, please try clearing the application's data.";
|
"The saved credentials seem to be corrupted, please try clearing the application's data.";
|
||||||
|
|
||||||
|
String get autoBurza =>
|
||||||
|
"Automatically order food from exchange when I didn't order one";
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get autoburzaNeeds =>
|
||||||
|
"This function requires constant network connection and you need to have saved login details (using the 'Remember me' switch on the login page).";
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get autoFound => "Successfully ordered food from exchange";
|
||||||
}
|
}
|
||||||
|
|
260
lib/main.dart
260
lib/main.dart
|
@ -1,18 +1,22 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:background_fetch/background_fetch.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
=======
|
||||||
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
import 'package:opencanteen/lang/lang_cz.dart';
|
import 'package:opencanteen/lang/lang_cz.dart';
|
||||||
import 'package:opencanteen/loginmanager.dart';
|
import 'package:opencanteen/loginmanager.dart';
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
|
||||||
import 'package:canteenlib/canteenlib.dart';
|
import 'package:canteenlib/canteenlib.dart';
|
||||||
import 'package:opencanteen/okna/offline_jidelnicek.dart';
|
import 'package:opencanteen/okna/offline_jidelnicek.dart';
|
||||||
import 'package:opencanteen/okna/welcome.dart';
|
import 'package:opencanteen/okna/welcome.dart';
|
||||||
import 'package:opencanteen/util.dart';
|
import 'package:opencanteen/util.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
import 'lang/lang.dart';
|
import 'lang/lang.dart';
|
||||||
import 'lang/lang_en.dart';
|
import 'lang/lang_en.dart';
|
||||||
|
@ -35,8 +39,112 @@ Copyright (C) 2022 Matyáš Caras a přispěvatelé
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void main() {
|
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||||
|
FlutterLocalNotificationsPlugin();
|
||||||
|
|
||||||
|
// Pouze pro Android
|
||||||
|
void backgroundFetchHeadlessTask(HeadlessTask task) async {
|
||||||
|
String taskId = task.taskId;
|
||||||
|
bool isTimeout = task.timeout;
|
||||||
|
if (isTimeout) {
|
||||||
|
// Timeout
|
||||||
|
debugPrint("[BackgroundFetch] Headless task má time-out: $taskId");
|
||||||
|
BackgroundFetch.finish(taskId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
debugPrint('[BackgroundFetch] Přišel headless event.');
|
||||||
|
|
||||||
|
var d = await LoginManager.getDetails(); // získat údaje
|
||||||
|
if (d != null) {
|
||||||
|
var c = Canteen(d["url"]!);
|
||||||
|
await c.login(d["user"]!, d["pass"]!); // přihlásit se
|
||||||
|
var burza = await c.ziskatBurzu(); // získat burzu
|
||||||
|
|
||||||
|
for (var jidlo in burza) {
|
||||||
|
try {
|
||||||
|
String locale = Intl.getCurrentLocale();
|
||||||
|
String title;
|
||||||
|
switch (locale) {
|
||||||
|
case "cs_CZ":
|
||||||
|
title = LanguageCz().autoFound;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
title = LanguageEn().autoFound;
|
||||||
|
}
|
||||||
|
var r = await c.objednatZBurzy(jidlo); // objednat
|
||||||
|
if (r) {
|
||||||
|
const AndroidNotificationDetails androidPlatformChannelSpecifics =
|
||||||
|
AndroidNotificationDetails('opencanteen', 'autoburza',
|
||||||
|
channelDescription: 'Oznámení o objednání jídla z burzy',
|
||||||
|
importance: Importance.max,
|
||||||
|
priority: Priority.high,
|
||||||
|
ticker: 'burza success');
|
||||||
|
const NotificationDetails platformChannelSpecifics =
|
||||||
|
NotificationDetails(android: androidPlatformChannelSpecifics);
|
||||||
|
await flutterLocalNotificationsPlugin.show(
|
||||||
|
0, title, null, platformChannelSpecifics);
|
||||||
|
break; // ukončit pokud objednáno
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
const AndroidNotificationDetails androidPlatformChannelSpecifics =
|
||||||
|
AndroidNotificationDetails('opencanteen', 'autoburza',
|
||||||
|
channelDescription: 'Oznámení o objednání jídla z burzy',
|
||||||
|
importance: Importance.max,
|
||||||
|
priority: Priority.high,
|
||||||
|
ticker: 'burza fail');
|
||||||
|
const NotificationDetails platformChannelSpecifics =
|
||||||
|
NotificationDetails(android: androidPlatformChannelSpecifics);
|
||||||
|
await flutterLocalNotificationsPlugin.show(
|
||||||
|
0,
|
||||||
|
"CHYBA PŘI OBJEDNÁVÁNÍ ${jidlo.nazev}",
|
||||||
|
e.toString(),
|
||||||
|
platformChannelSpecifics);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BackgroundFetch.finish(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
|
const AndroidInitializationSettings initializationSettingsAndroid =
|
||||||
|
AndroidInitializationSettings('notif_icon');
|
||||||
|
|
||||||
|
/// Note: permissions aren't requested here just to demonstrate that can be
|
||||||
|
/// done later
|
||||||
|
final IOSInitializationSettings initializationSettingsIOS =
|
||||||
|
IOSInitializationSettings(
|
||||||
|
requestAlertPermission: false,
|
||||||
|
requestBadgePermission: false,
|
||||||
|
requestSoundPermission: false,
|
||||||
|
onDidReceiveLocalNotification: (
|
||||||
|
int id,
|
||||||
|
String? title,
|
||||||
|
String? body,
|
||||||
|
String? payload,
|
||||||
|
) async {
|
||||||
|
debugPrint(body);
|
||||||
|
});
|
||||||
|
|
||||||
|
final InitializationSettings initializationSettings = InitializationSettings(
|
||||||
|
android: initializationSettingsAndroid,
|
||||||
|
iOS: initializationSettingsIOS,
|
||||||
|
);
|
||||||
|
await flutterLocalNotificationsPlugin.initialize(initializationSettings,
|
||||||
|
onSelectNotification: (String? payload) async {
|
||||||
|
if (payload != null) {
|
||||||
|
debugPrint('notification payload: $payload');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
|
var prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
if (prefs.getBool("autoburza") ?? false) {
|
||||||
|
debugPrint("Nastavuji");
|
||||||
|
BackgroundFetch.registerHeadlessTask(backgroundFetchHeadlessTask);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
|
@ -78,21 +186,97 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
TextEditingController canteenControl = TextEditingController();
|
TextEditingController canteenControl = TextEditingController();
|
||||||
bool rememberMe = false;
|
bool rememberMe = false;
|
||||||
|
|
||||||
|
void nastavitPozadi() async {
|
||||||
|
// Configure BackgroundFetch.
|
||||||
|
int status = await BackgroundFetch.configure(
|
||||||
|
BackgroundFetchConfig(
|
||||||
|
minimumFetchInterval: 15,
|
||||||
|
stopOnTerminate: false,
|
||||||
|
enableHeadless: true,
|
||||||
|
requiresBatteryNotLow: false,
|
||||||
|
requiresCharging: false,
|
||||||
|
requiresStorageNotLow: false,
|
||||||
|
requiresDeviceIdle: false,
|
||||||
|
requiredNetworkType: NetworkType.ANY), (String taskId) async {
|
||||||
|
// Callback
|
||||||
|
debugPrint("[BackgroundFetch] Event získán $taskId");
|
||||||
|
var d = await LoginManager.getDetails();
|
||||||
|
if (d != null) {
|
||||||
|
var c = Canteen(d["url"]!);
|
||||||
|
await c.login(d["user"]!, d["pass"]!);
|
||||||
|
var burza = await c.ziskatBurzu();
|
||||||
|
|
||||||
|
for (var jidlo in burza) {
|
||||||
|
// DEBUG
|
||||||
|
var debugge = const AndroidNotificationDetails(
|
||||||
|
'opencanteen', 'debugge',
|
||||||
|
channelDescription: 'Debug opencanteen',
|
||||||
|
importance: Importance.max,
|
||||||
|
priority: Priority.high,
|
||||||
|
ticker: 'burza debug');
|
||||||
|
await flutterLocalNotificationsPlugin.show(
|
||||||
|
0,
|
||||||
|
"Nalezeno jídlo ${jidlo.nazev}",
|
||||||
|
null,
|
||||||
|
NotificationDetails(android: debugge)); // TODO debug
|
||||||
|
try {
|
||||||
|
var r = await c.objednatZBurzy(jidlo); // objednat
|
||||||
|
if (r) {
|
||||||
|
const AndroidNotificationDetails androidPlatformChannelSpecifics =
|
||||||
|
AndroidNotificationDetails('opencanteen', 'autoburza',
|
||||||
|
channelDescription: 'Oznámení o objednání jídla z burzy',
|
||||||
|
importance: Importance.max,
|
||||||
|
priority: Priority.high,
|
||||||
|
ticker: 'burza success');
|
||||||
|
const NotificationDetails platformChannelSpecifics =
|
||||||
|
NotificationDetails(android: androidPlatformChannelSpecifics);
|
||||||
|
await flutterLocalNotificationsPlugin.show(
|
||||||
|
0,
|
||||||
|
Languages.of(context)!.autoFound,
|
||||||
|
null,
|
||||||
|
platformChannelSpecifics);
|
||||||
|
break; // ukončit pokud objednáno
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
const AndroidNotificationDetails androidPlatformChannelSpecifics =
|
||||||
|
AndroidNotificationDetails('opencanteen', 'autoburza',
|
||||||
|
channelDescription: 'Oznámení o objednání jídla z burzy',
|
||||||
|
importance: Importance.max,
|
||||||
|
priority: Priority.high,
|
||||||
|
ticker: 'burza fail');
|
||||||
|
const NotificationDetails platformChannelSpecifics =
|
||||||
|
NotificationDetails(android: androidPlatformChannelSpecifics);
|
||||||
|
await flutterLocalNotificationsPlugin.show(
|
||||||
|
0,
|
||||||
|
"CHYBA PŘI OBJEDNÁVÁNÍ ${jidlo.nazev}",
|
||||||
|
e.toString(),
|
||||||
|
platformChannelSpecifics);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BackgroundFetch.finish(taskId);
|
||||||
|
}, (String taskId) async {
|
||||||
|
debugPrint("[BackgroundFetch] TASK TIMEOUT taskId: $taskId");
|
||||||
|
BackgroundFetch.finish(taskId);
|
||||||
|
});
|
||||||
|
debugPrint('[BackgroundFetch] úspěšně nakonfigurováno: $status');
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
LoginManager.getDetails().then((r) async {
|
LoginManager.getDetails().then((r) async {
|
||||||
var connectivityResult = await (Connectivity().checkConnectivity());
|
if (Platform.isIOS) {
|
||||||
if (connectivityResult == ConnectivityResult.none) {
|
await flutterLocalNotificationsPlugin
|
||||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
.resolvePlatformSpecificImplementation<
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
IOSFlutterLocalNotificationsPlugin>()
|
||||||
SnackBar(
|
?.requestPermissions(
|
||||||
content: Text(Languages.of(context)!.errorContacting),
|
alert: true,
|
||||||
),
|
badge: true,
|
||||||
);
|
sound: true,
|
||||||
goOffline();
|
) ??
|
||||||
|
false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -121,6 +305,10 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var prefs = await SharedPreferences.getInstance();
|
||||||
|
if (prefs.getBool("autoburza") ?? false) {
|
||||||
|
nastavitPozadi();
|
||||||
|
}
|
||||||
const storage = FlutterSecureStorage();
|
const storage = FlutterSecureStorage();
|
||||||
var odsouhlasil = await storage.read(key: "oc_souhlas");
|
var odsouhlasil = await storage.read(key: "oc_souhlas");
|
||||||
if (odsouhlasil == null || odsouhlasil != "ano") {
|
if (odsouhlasil == null || odsouhlasil != "ano") {
|
||||||
|
@ -144,7 +332,13 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
content: Text(Languages.of(context)!.corrupted),
|
content: Text(Languages.of(context)!.corrupted),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} catch (_) {
|
} catch (e) {
|
||||||
|
// DEBUG ODSTRANIT
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (c) => SimpleDialog(
|
||||||
|
title: Text("Chyba"), children: [Text(e.toString())]));
|
||||||
|
|
||||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
|
@ -213,30 +407,6 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
]),
|
]),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (canteenControl.text.contains("http://")) {
|
|
||||||
// kontrolujeme šifrované spojení
|
|
||||||
var d = await showDialog<bool>(
|
|
||||||
context: context,
|
|
||||||
builder: (c) => AlertDialog(
|
|
||||||
title: Text(Languages.of(context)!.warning),
|
|
||||||
content: SingleChildScrollView(
|
|
||||||
child: Text(
|
|
||||||
Languages.of(context)!.httpLogin)),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () =>
|
|
||||||
Navigator.pop(c, true),
|
|
||||||
child:
|
|
||||||
Text(Languages.of(context)!.yes)),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () =>
|
|
||||||
Navigator.pop(c, false),
|
|
||||||
child: Text(
|
|
||||||
Languages.of(context)!.noChange))
|
|
||||||
],
|
|
||||||
));
|
|
||||||
if (!d!) return;
|
|
||||||
}
|
|
||||||
if (!canteenControl.text.startsWith("https://") &&
|
if (!canteenControl.text.startsWith("https://") &&
|
||||||
!canteenControl.text.startsWith("http://")) {
|
!canteenControl.text.startsWith("http://")) {
|
||||||
canteenControl.text =
|
canteenControl.text =
|
||||||
|
@ -274,9 +444,10 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
Navigator.pushReplacement(
|
Navigator.pushReplacement(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => JidelnicekPage(
|
builder: (context) => JidelnicekPage(
|
||||||
canteen: canteen,
|
canteen: canteen,
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} on PlatformException {
|
} on PlatformException {
|
||||||
|
@ -286,7 +457,14 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
content: Text(Languages.of(context)!.corrupted),
|
content: Text(Languages.of(context)!.corrupted),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} on Exception catch (_) {
|
|
||||||
|
} on Exception catch (e) {
|
||||||
|
// TODO: DEBUG ODSTRANIT
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (c) => SimpleDialog(
|
||||||
|
title: Text("Chyba"),
|
||||||
|
children: [Text(e.toString())]));
|
||||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
|
|
|
@ -26,8 +26,8 @@ class _AboutPageState extends State<AboutPage> {
|
||||||
const Text("OpenCanteen", style: TextStyle(fontSize: 30)),
|
const Text("OpenCanteen", style: TextStyle(fontSize: 30)),
|
||||||
Text(Languages.of(context)!.copyright),
|
Text(Languages.of(context)!.copyright),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () => launch(
|
onTap: () => launchUrl(Uri.parse(
|
||||||
"https://github.com/hernikplays/opencanteen/blob/main/LICENSE"),
|
"https://github.com/hernikplays/opencanteen/blob/main/LICENSE")),
|
||||||
child: Text(Languages.of(context)!.license)),
|
child: Text(Languages.of(context)!.license)),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Text(Languages.of(context)!.usedLibs,
|
Text(Languages.of(context)!.usedLibs,
|
||||||
|
@ -44,9 +44,9 @@ class _AboutPageState extends State<AboutPage> {
|
||||||
"https://github.com/mogol/flutter_secure_storage/blob/develop/flutter_secure_storage/LICENSE"),
|
"https://github.com/mogol/flutter_secure_storage/blob/develop/flutter_secure_storage/LICENSE"),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
cudlik(
|
cudlik(
|
||||||
"connectivity_plus",
|
"Material Icons",
|
||||||
"Copyright 2017 The Chromium Authors. All rights reserved, licence BSD 3-Clause",
|
"Copyright Google. All rights reserved, licence Apache 2.0",
|
||||||
"https://github.com/fluttercommunity/plus_plugins/blob/main/packages/connectivity_plus/connectivity_plus/LICENSE"),
|
"https://github.com/google/material-design-icons/blob/master/LICENSE"),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
cudlik(
|
cudlik(
|
||||||
"url_launcher",
|
"url_launcher",
|
||||||
|
@ -60,18 +60,32 @@ class _AboutPageState extends State<AboutPage> {
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
cudlik(
|
cudlik(
|
||||||
"path_provider",
|
"path_provider",
|
||||||
"Copyright 2013 The Flutter Authors. All rights reserved., licence BSD-3-Clause",
|
"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"),
|
"https://github.com/flutter/plugins/blob/main/packages/path_provider/path_provider/LICENSE"),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
cudlik(
|
cudlik(
|
||||||
"shared_preferences",
|
"shared_preferences",
|
||||||
"Copyright 2013 The Flutter Authors. All rights reserved., licence BSD-3-Clause",
|
"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"),
|
"https://github.com/flutter/plugins/blob/main/packages/path_provider/path_provider/LICENSE"),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
cudlik(
|
cudlik(
|
||||||
"introduction_screen",
|
"introduction_screen",
|
||||||
"Copyright 2019 Jean-Charles Moussé, licence MIT",
|
"Copyright 2019 Jean-Charles Moussé, licence MIT",
|
||||||
"https://github.com/Pyozer/introduction_screen/blob/master/LICENSE")
|
"https://github.com/Pyozer/introduction_screen/blob/master/LICENSE"),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
cudlik(
|
||||||
|
"flutter_local_notifications",
|
||||||
|
"Copyright 2018 Michael Bui. All rights reserved, licence BSD 3-Clause",
|
||||||
|
"https://github.com/MaikuB/flutter_local_notifications/blob/master/flutter_local_notifications/LICENSE"),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
cudlik(
|
||||||
|
"background_fetch",
|
||||||
|
"Copyright (c) 2018 Transistor Software, licence MIT",
|
||||||
|
"https://github.com/transistorsoft/flutter_background_fetch/blob/master/LICENSE")
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -81,7 +95,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||||
|
|
||||||
Widget cudlik(String nazev, String copyright, String licence) {
|
Widget cudlik(String nazev, String copyright, String licence) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => launch(licence),
|
onTap: () => launchUrl(Uri.parse(licence)),
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Text(
|
Text(
|
||||||
nazev,
|
nazev,
|
||||||
|
|
|
@ -17,6 +17,7 @@ class _NastaveniState extends State<Nastaveni> {
|
||||||
bool _ukladatOffline = false;
|
bool _ukladatOffline = false;
|
||||||
bool _preskakovatVikend = false;
|
bool _preskakovatVikend = false;
|
||||||
bool _kontrolovatTyden = false;
|
bool _kontrolovatTyden = false;
|
||||||
|
bool _autoBurza = false;
|
||||||
|
|
||||||
void najitNastaveni() async {
|
void najitNastaveni() async {
|
||||||
var preferences = await SharedPreferences.getInstance();
|
var preferences = await SharedPreferences.getInstance();
|
||||||
|
@ -24,6 +25,7 @@ class _NastaveniState extends State<Nastaveni> {
|
||||||
_ukladatOffline = preferences.getBool("offline") ?? false;
|
_ukladatOffline = preferences.getBool("offline") ?? false;
|
||||||
_preskakovatVikend = preferences.getBool("skip") ?? false;
|
_preskakovatVikend = preferences.getBool("skip") ?? false;
|
||||||
_kontrolovatTyden = preferences.getBool("tyden") ?? false;
|
_kontrolovatTyden = preferences.getBool("tyden") ?? false;
|
||||||
|
_autoBurza = preferences.getBool("autoburza") ?? false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +90,31 @@ class _NastaveniState extends State<Nastaveni> {
|
||||||
setState(() {
|
setState(() {
|
||||||
_kontrolovatTyden = value;
|
_kontrolovatTyden = value;
|
||||||
zmenitNastaveni("tyden", value);
|
zmenitNastaveni("tyden", value);
|
||||||
|
|
||||||
|
Flexible(
|
||||||
|
child: Text(Languages.of(context)!.autoBurza),
|
||||||
|
),
|
||||||
|
Switch(
|
||||||
|
value: _autoBurza,
|
||||||
|
onChanged: (value) {
|
||||||
|
if (value) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AlertDialog(
|
||||||
|
title: Text(Languages.of(context)!.warning),
|
||||||
|
content:
|
||||||
|
Text(Languages.of(context)!.autoburzaNeeds),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
child: Text(Languages.of(context)!.ok))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
_autoBurza = value;
|
||||||
|
zmenitNastaveni("autoburza", value);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
|
163
pubspec.lock
163
pubspec.lock
|
@ -14,21 +14,28 @@ packages:
|
||||||
name: args
|
name: args
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.0"
|
version: "2.3.1"
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.8.2"
|
version: "2.9.0"
|
||||||
|
background_fetch:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: background_fetch
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
canteenlib:
|
canteenlib:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: canteenlib
|
name: canteenlib
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.0-alpha.16"
|
version: "0.1.0-alpha.17"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -36,13 +43,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
charcode:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: charcode
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.1"
|
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -57,62 +57,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0"
|
version: "1.16.0"
|
||||||
connectivity_plus:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: connectivity_plus
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.2.1"
|
|
||||||
connectivity_plus_linux:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: connectivity_plus_linux
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.3.0"
|
|
||||||
connectivity_plus_macos:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: connectivity_plus_macos
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.1"
|
|
||||||
connectivity_plus_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: connectivity_plus_platform_interface
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.0"
|
|
||||||
connectivity_plus_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: connectivity_plus_web
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.0"
|
|
||||||
connectivity_plus_windows:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: connectivity_plus_windows
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.2.0"
|
|
||||||
crypto:
|
crypto:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: crypto
|
name: crypto
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.0.2"
|
||||||
dbus:
|
dbus:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: dbus
|
name: dbus
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.2"
|
version: "0.7.3"
|
||||||
dots_indicator:
|
dots_indicator:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -126,7 +84,7 @@ packages:
|
||||||
name: ffi
|
name: ffi
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
version: "1.2.1"
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -153,6 +111,27 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
|
flutter_local_notifications:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_local_notifications
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "9.5.3+1"
|
||||||
|
flutter_local_notifications_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_local_notifications_linux
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.4.2"
|
||||||
|
flutter_local_notifications_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_local_notifications_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "5.0.0"
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -218,7 +197,7 @@ packages:
|
||||||
name: http_parser
|
name: http_parser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "4.0.1"
|
||||||
image:
|
image:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -268,13 +247,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.0"
|
version: "1.7.0"
|
||||||
nm:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: nm
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.5.0"
|
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -288,56 +260,56 @@ packages:
|
||||||
name: path_provider
|
name: path_provider
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.9"
|
version: "2.0.10"
|
||||||
path_provider_android:
|
path_provider_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_android
|
name: path_provider_android
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.12"
|
version: "2.0.14"
|
||||||
path_provider_ios:
|
path_provider_ios:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_ios
|
name: path_provider_ios
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.8"
|
version: "2.0.9"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_linux
|
name: path_provider_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.5"
|
version: "2.1.6"
|
||||||
path_provider_macos:
|
path_provider_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_macos
|
name: path_provider_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.5"
|
version: "2.0.6"
|
||||||
path_provider_platform_interface:
|
path_provider_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_platform_interface
|
name: path_provider_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.4"
|
||||||
path_provider_windows:
|
path_provider_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_windows
|
name: path_provider_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.5"
|
version: "2.0.6"
|
||||||
petitparser:
|
petitparser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: petitparser
|
name: petitparser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.4.0"
|
version: "5.0.0"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -365,35 +337,35 @@ packages:
|
||||||
name: shared_preferences
|
name: shared_preferences
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.13"
|
version: "2.0.15"
|
||||||
shared_preferences_android:
|
shared_preferences_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_android
|
name: shared_preferences_android
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.11"
|
version: "2.0.12"
|
||||||
shared_preferences_ios:
|
shared_preferences_ios:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_ios
|
name: shared_preferences_ios
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
shared_preferences_linux:
|
shared_preferences_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_linux
|
name: shared_preferences_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
shared_preferences_macos:
|
shared_preferences_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_macos
|
name: shared_preferences_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.4"
|
||||||
shared_preferences_platform_interface:
|
shared_preferences_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -407,14 +379,14 @@ packages:
|
||||||
name: shared_preferences_web
|
name: shared_preferences_web
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.4"
|
||||||
shared_preferences_windows:
|
shared_preferences_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: shared_preferences_windows
|
name: shared_preferences_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -426,14 +398,14 @@ packages:
|
||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.1"
|
version: "1.9.0"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.1"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -441,48 +413,55 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
|
timezone:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: timezone
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.8.0"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: typed_data
|
name: typed_data
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.1"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: url_launcher
|
name: url_launcher
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.20"
|
version: "6.1.2"
|
||||||
url_launcher_android:
|
url_launcher_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_android
|
name: url_launcher_android
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.15"
|
version: "6.0.17"
|
||||||
url_launcher_ios:
|
url_launcher_ios:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_ios
|
name: url_launcher_ios
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.15"
|
version: "6.0.17"
|
||||||
url_launcher_linux:
|
url_launcher_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_linux
|
name: url_launcher_linux
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.0.1"
|
||||||
url_launcher_macos:
|
url_launcher_macos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_macos
|
name: url_launcher_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.0.1"
|
||||||
url_launcher_platform_interface:
|
url_launcher_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -496,14 +475,14 @@ packages:
|
||||||
name: url_launcher_web
|
name: url_launcher_web
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.9"
|
version: "2.0.11"
|
||||||
url_launcher_windows:
|
url_launcher_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_windows
|
name: url_launcher_windows
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.0.1"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -517,7 +496,7 @@ packages:
|
||||||
name: win32
|
name: win32
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.5.2"
|
version: "2.6.1"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -531,14 +510,14 @@ packages:
|
||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.3.1"
|
version: "5.4.1"
|
||||||
yaml:
|
yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: yaml
|
name: yaml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.17.0-0 <3.0.0"
|
dart: ">=2.17.0 <3.0.0"
|
||||||
flutter: ">=2.10.0"
|
flutter: ">=2.10.0"
|
||||||
|
|
|
@ -8,21 +8,23 @@ publish_to: 'none'
|
||||||
# followed by an optional build number separated by a +.
|
# followed by an optional build number separated by a +.
|
||||||
version: 1.2.0+14
|
version: 1.2.0+14
|
||||||
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.16.1 <3.0.0"
|
sdk: ">=2.16.1 <4.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
canteenlib: ^0.1.0-alpha.16
|
canteenlib: ^0.1.0-alpha.17
|
||||||
connectivity_plus: ^2.2.1
|
|
||||||
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
|
||||||
|
background_fetch: ^1.1.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_lints: ^1.0.0
|
flutter_lints: ^1.0.0
|
||||||
|
|
Loading…
Reference in a new issue