fix: přidat info o baterii a odstranit zbytecny if
This commit is contained in:
parent
6bbc9c2d0a
commit
c95518c557
6 changed files with 63 additions and 36 deletions
|
@ -149,6 +149,8 @@ abstract class Languages {
|
||||||
|
|
||||||
String get notifyAt;
|
String get notifyAt;
|
||||||
|
|
||||||
|
String get notifyWarning;
|
||||||
|
|
||||||
// Offline
|
// Offline
|
||||||
String get offline;
|
String get offline;
|
||||||
|
|
||||||
|
|
|
@ -224,4 +224,8 @@ class LanguageCz extends Languages {
|
||||||
@override
|
@override
|
||||||
String get needRemember =>
|
String get needRemember =>
|
||||||
"Musíte své přihlašovací údaje uložit na přihlašovací obrazovce";
|
"Musíte své přihlašovací údaje uložit na přihlašovací obrazovce";
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get notifyWarning =>
|
||||||
|
"Vaše zařízení může mít povolenou optimalizaci baterie, což může způsobovat neodesílání oznámení. Zkontrolujte nastavení ve vašem zařízení.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,4 +222,8 @@ class LanguageEn extends Languages {
|
||||||
@override
|
@override
|
||||||
String get needRemember =>
|
String get needRemember =>
|
||||||
"You need to save your login details on the login screen first";
|
"You need to save your login details on the login screen first";
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get notifyWarning =>
|
||||||
|
"Your device may have battery optimization enabled. This may cause notifications to not be sent. Check the application info in your device's settings.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,9 +55,9 @@ void oznamitPredem(SharedPreferences prefs, tz.Location l) async {
|
||||||
title = LanguageEn().lunchNotif;
|
title = LanguageEn().lunchNotif;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prefs.getBool("offline") ?? false) {
|
/*if (prefs.getBool("offline") ?? false) {
|
||||||
// TODO možnost brát z offline dat
|
// TODO možnost brát z offline dat
|
||||||
} else {
|
} else {*/
|
||||||
// bere online
|
// bere online
|
||||||
var d = await LoginManager.getDetails(); // získat údaje
|
var d = await LoginManager.getDetails(); // získat údaje
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
|
@ -92,7 +92,7 @@ void oznamitPredem(SharedPreferences prefs, tz.Location l) async {
|
||||||
// nenalezeno
|
// nenalezeno
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,23 @@ class _NastaveniState extends State<Nastaveni> {
|
||||||
setState(() {
|
setState(() {
|
||||||
_oznameniObed = value;
|
_oznameniObed = value;
|
||||||
if (_oznameniObed) {
|
if (_oznameniObed) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AlertDialog(
|
||||||
|
title:
|
||||||
|
Text(Languages.of(context)!.warning),
|
||||||
|
content: Text(
|
||||||
|
Languages.of(context)!.notifyWarning),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
child:
|
||||||
|
Text(Languages.of(context)!.ok),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
vytvoritOznameni(casNaDate(_oznameniCas));
|
vytvoritOznameni(casNaDate(_oznameniCas));
|
||||||
}
|
}
|
||||||
zmenitNastaveni("oznamit", value);
|
zmenitNastaveni("oznamit", value);
|
||||||
|
|
|
@ -6,7 +6,7 @@ publish_to: 'none'
|
||||||
# The following defines the version and build number for your application.
|
# The following defines the version and build number for your application.
|
||||||
# A version number is three numbers separated by dots, like 1.2.43
|
# A version number is three numbers separated by dots, like 1.2.43
|
||||||
# followed by an optional build number separated by a +.
|
# followed by an optional build number separated by a +.
|
||||||
version: 1.3.0+15
|
version: 1.3.1+16
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.16.1 <3.0.0"
|
sdk: ">=2.16.1 <3.0.0"
|
||||||
|
|
Reference in a new issue