fix: optimalizovat a upravit barvy

This commit is contained in:
Matyáš Caras 2022-12-12 17:52:33 +01:00
parent 365976a853
commit e9173a6acd
10 changed files with 43 additions and 64 deletions

View file

@ -1,6 +1,7 @@
# 1.6.0 # 1.6.0
- rozdělit iOS a Android UI zvlášť pro možnost využití Cupertino knihovny - rozdělit iOS a Android UI zvlášť pro možnost využití Cupertino knihovny
- opravit chybu s FlutterLocalNotifications na iOS - opravit chybu s FlutterLocalNotifications na iOS
- upravit vzhled
# 1.5.1 # 1.5.1
- aktualizovat knihovnu canteenlib - aktualizovat knihovnu canteenlib
- přidat podporu pro splitování APK podle ABI - přidat podporu pro splitování APK podle ABI

View file

@ -339,14 +339,8 @@ class _AndroidJidelnicekState extends State<AndroidJidelnicek> {
), ),
); );
} else if (value == Languages.of(context)!.review) { } else if (value == Languages.of(context)!.review) {
(Platform.isAndroid) launchUrl(Uri.parse("market://details?id=cz.hernikplays.opencanteen"),
? launchUrl( mode: LaunchMode.externalApplication);
Uri.parse("market://details?id=cz.hernikplays.opencanteen"),
mode: LaunchMode.externalApplication)
: launchUrl(
Uri.parse(
"https://apps.apple.com/cz/app/opencanteen/id1621124445"),
mode: LaunchMode.externalApplication);
} else if (value == Languages.of(context)!.reportBugs) { } else if (value == Languages.of(context)!.reportBugs) {
launchUrl(Uri.parse("https://forms.gle/jKN7QeFJwpaApSbC8"), launchUrl(Uri.parse("https://forms.gle/jKN7QeFJwpaApSbC8"),
mode: LaunchMode.externalApplication); mode: LaunchMode.externalApplication);

View file

@ -272,12 +272,10 @@ class _AndroidLoginState extends State<AndroidLogin> {
/// Získá offline soubor a zobrazí údaje /// Získá offline soubor a zobrazí údaje
void goOffline() async { void goOffline() async {
if (!mounted) return; if (!mounted) return;
if (Platform.isAndroid) { Navigator.pushAndRemoveUntil(
Navigator.pushAndRemoveUntil( context,
context, MaterialPageRoute(
MaterialPageRoute( builder: ((context) => const AndroidOfflineJidelnicek())),
builder: ((context) => const AndroidOfflineJidelnicek())), (route) => false);
(route) => false);
}
} }
} }

View file

@ -80,6 +80,7 @@ class _AndroidNastaveniState extends State<AndroidNastaveni> {
Text(Languages.of(context)!.saveOffline), Text(Languages.of(context)!.saveOffline),
Switch( Switch(
value: _ukladatOffline, value: _ukladatOffline,
activeColor: Colors.purple,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ukladatOffline = value; _ukladatOffline = value;
@ -115,6 +116,7 @@ class _AndroidNastaveniState extends State<AndroidNastaveni> {
children: [ children: [
Text(Languages.of(context)!.skipWeekend), Text(Languages.of(context)!.skipWeekend),
Switch( Switch(
activeColor: Colors.purple,
value: _preskakovatVikend, value: _preskakovatVikend,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@ -129,6 +131,7 @@ class _AndroidNastaveniState extends State<AndroidNastaveni> {
children: [ children: [
Flexible(child: Text(Languages.of(context)!.checkOrdered)), Flexible(child: Text(Languages.of(context)!.checkOrdered)),
Switch( Switch(
activeColor: Colors.purple,
value: _kontrolovatTyden, value: _kontrolovatTyden,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@ -143,6 +146,7 @@ class _AndroidNastaveniState extends State<AndroidNastaveni> {
children: [ children: [
Flexible(child: Text(Languages.of(context)!.notifyLunch)), Flexible(child: Text(Languages.of(context)!.notifyLunch)),
Switch( Switch(
activeColor: Colors.purple,
value: _oznameniObed, value: _oznameniObed,
thumbColor: (!_zapamatovany thumbColor: (!_zapamatovany
? MaterialStateProperty.all(Colors.grey) ? MaterialStateProperty.all(Colors.grey)

View file

@ -117,14 +117,8 @@ class _AndroidOfflineJidelnicekState extends State<AndroidOfflineJidelnicek> {
Navigator.pushReplacement( Navigator.pushReplacement(
context, MaterialPageRoute(builder: (c) => const AndroidLogin())); context, MaterialPageRoute(builder: (c) => const AndroidLogin()));
} else if (value == Languages.of(context)!.review) { } else if (value == Languages.of(context)!.review) {
(Platform.isAndroid) launchUrl(Uri.parse("market://details?id=cz.hernikplays.opencanteen"),
? launchUrl( mode: LaunchMode.externalApplication);
Uri.parse("market://details?id=cz.hernikplays.opencanteen"),
mode: LaunchMode.externalApplication)
: launchUrl(
Uri.parse(
"https://apps.apple.com/cz/app/opencanteen/id1621124445"),
mode: LaunchMode.externalApplication);
} else if (value == Languages.of(context)!.reportBugs) { } else if (value == Languages.of(context)!.reportBugs) {
launchUrl(Uri.parse("https://forms.gle/jKN7QeFJwpaApSbC8"), launchUrl(Uri.parse("https://forms.gle/jKN7QeFJwpaApSbC8"),
mode: LaunchMode.externalApplication); mode: LaunchMode.externalApplication);

View file

@ -33,23 +33,16 @@ class _IOSLoginState extends State<IOSLogin> {
void initState() { void initState() {
super.initState(); super.initState();
LoginManager.getDetails().then((r) async { LoginManager.getDetails().then((r) async {
if (Platform.isIOS) { // žádat o oprávnění na iOS
// žádat o oprávnění na iOS await flutterLocalNotificationsPlugin
await flutterLocalNotificationsPlugin .resolvePlatformSpecificImplementation<
.resolvePlatformSpecificImplementation< IOSFlutterLocalNotificationsPlugin>()
IOSFlutterLocalNotificationsPlugin>() ?.requestPermissions(
?.requestPermissions( alert: true,
alert: true, badge: true,
badge: true, sound: true,
sound: true, );
);
} else if (Platform.isAndroid) {
// žádat o oprávnění na android
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.requestPermission();
}
if (r != null) { if (r != null) {
// Automaticky přihlásit // Automaticky přihlásit
showDialog( showDialog(
@ -146,16 +139,14 @@ class _IOSLoginState extends State<IOSLogin> {
Languages.of(context)!.logIn, Languages.of(context)!.logIn,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
TextField( CupertinoTextField(
controller: userControl, controller: userControl,
autofillHints: const [AutofillHints.username], autofillHints: const [AutofillHints.username],
decoration: InputDecoration( prefix: Text(Languages.of(context)!.username),
labelText: Languages.of(context)!.username),
), ),
TextField( CupertinoTextField(
autofillHints: const [AutofillHints.password], autofillHints: const [AutofillHints.password],
decoration: InputDecoration( prefix: Text(Languages.of(context)!.password),
labelText: Languages.of(context)!.password),
controller: passControl, controller: passControl,
obscureText: true, obscureText: true,
), ),
@ -283,12 +274,9 @@ class _IOSLoginState extends State<IOSLogin> {
/// Získá offline soubor a zobrazí údaje /// Získá offline soubor a zobrazí údaje
void goOffline() async { void goOffline() async {
if (!mounted) return; if (!mounted) return;
if (Platform.isAndroid) { Navigator.pushAndRemoveUntil(
Navigator.pushAndRemoveUntil( context,
context, MaterialPageRoute(builder: ((context) => const IOSOfflineJidelnicek())),
MaterialPageRoute( (route) => false);
builder: ((context) => const IOSOfflineJidelnicek())),
(route) => false);
}
} }
} }

View file

@ -80,6 +80,7 @@ class _IOSNastaveniState extends State<IOSNastaveni> {
children: [ children: [
Text(Languages.of(context)!.saveOffline), Text(Languages.of(context)!.saveOffline),
CupertinoSwitch( CupertinoSwitch(
activeColor: Colors.purple,
value: _ukladatOffline, value: _ukladatOffline,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@ -116,6 +117,7 @@ class _IOSNastaveniState extends State<IOSNastaveni> {
children: [ children: [
Text(Languages.of(context)!.skipWeekend), Text(Languages.of(context)!.skipWeekend),
CupertinoSwitch( CupertinoSwitch(
activeColor: Colors.purple,
value: _preskakovatVikend, value: _preskakovatVikend,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@ -130,6 +132,7 @@ class _IOSNastaveniState extends State<IOSNastaveni> {
children: [ children: [
Flexible(child: Text(Languages.of(context)!.checkOrdered)), Flexible(child: Text(Languages.of(context)!.checkOrdered)),
CupertinoSwitch( CupertinoSwitch(
activeColor: Colors.purple,
value: _kontrolovatTyden, value: _kontrolovatTyden,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@ -144,8 +147,8 @@ class _IOSNastaveniState extends State<IOSNastaveni> {
children: [ children: [
Flexible(child: Text(Languages.of(context)!.notifyLunch)), Flexible(child: Text(Languages.of(context)!.notifyLunch)),
CupertinoSwitch( CupertinoSwitch(
activeColor: Colors.purple,
value: _oznameniObed, value: _oznameniObed,
thumbColor: (Colors.grey),
onChanged: (value) { onChanged: (value) {
if (!_zapamatovany) { if (!_zapamatovany) {
showDialog( showDialog(

View file

@ -117,14 +117,9 @@ class _IOSOfflineJidelnicekState extends State<IOSOfflineJidelnicek> {
Navigator.pushReplacement( Navigator.pushReplacement(
context, MaterialPageRoute(builder: (c) => const IOSLogin())); context, MaterialPageRoute(builder: (c) => const IOSLogin()));
} else if (value == Languages.of(context)!.review) { } else if (value == Languages.of(context)!.review) {
(Platform.isAndroid) launchUrl(
? launchUrl( Uri.parse("https://apps.apple.com/cz/app/opencanteen/id1621124445"),
Uri.parse("market://details?id=cz.hernikplays.opencanteen"), mode: LaunchMode.externalApplication);
mode: LaunchMode.externalApplication)
: launchUrl(
Uri.parse(
"https://apps.apple.com/cz/app/opencanteen/id1621124445"),
mode: LaunchMode.externalApplication);
} else if (value == Languages.of(context)!.reportBugs) { } else if (value == Languages.of(context)!.reportBugs) {
launchUrl(Uri.parse("https://forms.gle/jKN7QeFJwpaApSbC8"), launchUrl(Uri.parse("https://forms.gle/jKN7QeFJwpaApSbC8"),
mode: LaunchMode.externalApplication); mode: LaunchMode.externalApplication);

View file

@ -1 +1,2 @@
- Optimalizace ze strany kodu - Optimalizace ze strany kodu
- Úpravy vzhledu

View file

@ -1 +1,2 @@
- Code optimization - Code optimization
- Theme edits