Added predictive back gesture
This commit is contained in:
parent
96d7761f19
commit
5d68e9893d
|
@ -2,7 +2,8 @@
|
||||||
<application
|
<application
|
||||||
android:label="Ollama"
|
android:label="Ollama"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:enableOnBackInvokedCallback="true">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
|
|
@ -54,10 +54,19 @@ void resetSystemNavigation(BuildContext context,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThemeData themeModifier(ThemeData theme) {
|
||||||
|
return theme.copyWith(
|
||||||
|
pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
|
builders: <TargetPlatform, PageTransitionsBuilder>{
|
||||||
|
TargetPlatform.android: PredictiveBackPageTransitionsBuilder(),
|
||||||
|
},
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
ThemeData themeLight() {
|
ThemeData themeLight() {
|
||||||
if (!(prefs?.getBool("useDeviceTheme") ?? false) ||
|
if (!(prefs?.getBool("useDeviceTheme") ?? false) ||
|
||||||
colorSchemeLight == null) {
|
colorSchemeLight == null) {
|
||||||
return ThemeData.from(
|
return themeModifier(ThemeData.from(
|
||||||
colorScheme: const ColorScheme(
|
colorScheme: const ColorScheme(
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
primary: Colors.black,
|
primary: Colors.black,
|
||||||
|
@ -67,15 +76,15 @@ ThemeData themeLight() {
|
||||||
error: Colors.red,
|
error: Colors.red,
|
||||||
onError: Colors.white,
|
onError: Colors.white,
|
||||||
surface: Colors.white,
|
surface: Colors.white,
|
||||||
onSurface: Colors.black));
|
onSurface: Colors.black)));
|
||||||
} else {
|
} else {
|
||||||
return ThemeData.from(colorScheme: colorSchemeLight!);
|
return themeModifier(ThemeData.from(colorScheme: colorSchemeLight!));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeData themeDark() {
|
ThemeData themeDark() {
|
||||||
if (!(prefs?.getBool("useDeviceTheme") ?? false) || colorSchemeDark == null) {
|
if (!(prefs?.getBool("useDeviceTheme") ?? false) || colorSchemeDark == null) {
|
||||||
return ThemeData.from(
|
return themeModifier(ThemeData.from(
|
||||||
colorScheme: const ColorScheme(
|
colorScheme: const ColorScheme(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
primary: Colors.white,
|
primary: Colors.white,
|
||||||
|
@ -85,9 +94,9 @@ ThemeData themeDark() {
|
||||||
error: Colors.red,
|
error: Colors.red,
|
||||||
onError: Colors.black,
|
onError: Colors.black,
|
||||||
surface: Colors.black,
|
surface: Colors.black,
|
||||||
onSurface: Colors.white));
|
onSurface: Colors.white)));
|
||||||
} else {
|
} else {
|
||||||
return ThemeData.from(colorScheme: colorSchemeDark!);
|
return themeModifier(ThemeData.from(colorScheme: colorSchemeDark!));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue