Compare commits

...
This repository has been archived on 2024-07-21. You can view files and clone it, but cannot push or open issues or pull requests.

2 commits

Author SHA1 Message Date
Matyáš Caras
68ee7d16c4 feat(autoburza): vytvořit základ pro autoburzu 2022-10-20 17:44:04 +02:00
Matyáš Caras
656c5739a8 chore(npm): odstranit husky skript 2022-10-20 17:26:55 +02:00
12 changed files with 55 additions and 7 deletions

View file

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '10.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

View file

@ -547,3 +547,9 @@
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
};
};

View file

@ -1,5 +1,6 @@
import UIKit
import Flutter
import workmanager
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
@ -7,6 +8,7 @@ import Flutter
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
WorkmanagerPlugin.registerTask(withIdentifier: "oc_bg")
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

View file

@ -50,5 +50,13 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>processing</string>
</array>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>oc_bg</string>
</array>
</dict>
</plist>

View file

@ -157,6 +157,8 @@ abstract class Languages {
String get notifyWarning;
String get autoburzaSetting;
// Offline
String get offline;

View file

@ -237,4 +237,8 @@ class LanguageCz extends Languages {
@override
String get review => "Ohodnotit aplikaci";
@override
String get autoburzaSetting =>
"Automaticky objednat jídlo z burzy když bude dostupné";
}

View file

@ -235,4 +235,8 @@ class LanguageEn extends Languages {
@override
String get review => "Review the app";
@override
String get autoburzaSetting =>
"Automatically order food from exchange when available";
}

View file

@ -102,7 +102,6 @@ void oznamitPredem(SharedPreferences prefs, tz.Location l) async {
}
void main() async {
WidgetsFlutterBinding.ensureInitialized();
tz.initializeTimeZones();
var l = tz.getLocation(await FlutterNativeTimezone.getLocalTimezone());
tz.setLocalLocation(l);
@ -137,6 +136,8 @@ void main() async {
}
});
WidgetsFlutterBinding.ensureInitialized();
// spustit aplikaci
runApp(const MyApp());
}

View file

@ -27,6 +27,7 @@ class _NastaveniState extends State<Nastaveni> {
bool _kontrolovatTyden = false;
bool _oznameniObed = false;
bool _zapamatovany = false;
bool _autoburza = false;
TimeOfDay _oznameniCas = TimeOfDay.now();
void najitNastaveni() async {
@ -37,6 +38,7 @@ class _NastaveniState extends State<Nastaveni> {
_preskakovatVikend = preferences.getBool("skip") ?? false;
_kontrolovatTyden = preferences.getBool("tyden") ?? false;
_oznameniObed = preferences.getBool("oznamit") ?? false;
_autoburza = preferences.getBool("autoburza") ?? false;
var casStr = preferences.getString("oznameni_cas");
if (casStr == null) {
var now = DateTime.now();
@ -114,6 +116,20 @@ class _NastaveniState extends State<Nastaveni> {
})
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(child: Text(Languages.of(context)!.autoburzaSetting)),
Switch(
value: _autoburza,
onChanged: (value) {
setState(() {
_kontrolovatTyden = value;
zmenitNastaveni("autoburza", value);
});
})
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [

View file

@ -4,9 +4,6 @@
"@commitlint/config-conventional": "^17.0.0",
"cz-conventional-changelog": "^3.3.0"
},
"scripts": {
"prepare": "husky install"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"

View file

@ -539,6 +539,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
workmanager:
dependency: "direct main"
description:
name: workmanager
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.1"
xdg_directories:
dependency: transitive
description:
@ -561,5 +568,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=3.0.0"

View file

@ -6,7 +6,7 @@ publish_to: 'none'
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
version: 1.4.1+20
version: 1.5.0+21
environment:
sdk: ">=2.16.1 <3.0.0"
@ -27,6 +27,7 @@ dependencies:
flutter_native_timezone: ^2.0.0
intl: ^0.17.0
package_info_plus: ^1.4.3+1
workmanager: ^0.5.1
dev_dependencies:
flutter_lints: ^2.0.1