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