mirror of
https://github.com/git-touch/git-touch
synced 2025-02-07 15:18:47 +01:00
fix: disable animation on replacement
This commit is contained in:
parent
ce00adf54c
commit
ae7b1247b4
@ -36,6 +36,25 @@ class PickerGroupItem<T> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No animation. For replacing route
|
||||||
|
// TODO: Go back
|
||||||
|
class StaticRoute extends PageRouteBuilder {
|
||||||
|
final WidgetBuilder builder;
|
||||||
|
StaticRoute({this.builder})
|
||||||
|
: super(
|
||||||
|
pageBuilder: (BuildContext context, Animation<double> animation,
|
||||||
|
Animation<double> secondaryAnimation) {
|
||||||
|
return builder(context);
|
||||||
|
},
|
||||||
|
transitionsBuilder: (BuildContext context,
|
||||||
|
Animation<double> animation,
|
||||||
|
Animation<double> secondaryAnimation,
|
||||||
|
Widget child) {
|
||||||
|
return child;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
class ThemeModel with ChangeNotifier {
|
class ThemeModel with ChangeNotifier {
|
||||||
static const storageKey = 'theme';
|
static const storageKey = 'theme';
|
||||||
|
|
||||||
@ -89,14 +108,7 @@ class ThemeModel with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pushReplacementRoute(BuildContext context, WidgetBuilder builder) {
|
pushReplacementRoute(BuildContext context, WidgetBuilder builder) {
|
||||||
switch (theme) {
|
return Navigator.of(context).pushReplacement(StaticRoute(builder: builder));
|
||||||
case AppThemeType.cupertino:
|
|
||||||
return Navigator.of(context)
|
|
||||||
.pushReplacement(CupertinoPageRoute(builder: builder));
|
|
||||||
default:
|
|
||||||
return Navigator.of(context)
|
|
||||||
.pushReplacement(MaterialPageRoute(builder: builder));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> showConfirm(BuildContext context, String text) {
|
Future<bool> showConfirm(BuildContext context, String text) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user