From e6c20ddd185b7aae3bff425233fcb942393b419b Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 16 May 2021 09:58:21 +0200 Subject: [PATCH] feat: Zoom page transition on Android and Fuchsia --- lib/config/themes.dart | 20 ++++++++++++++++++++ lib/main.dart | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/config/themes.dart b/lib/config/themes.dart index c1eed89d..86aa109a 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -41,6 +41,16 @@ abstract class FluffyThemes { snackBarTheme: SnackBarThemeData( behavior: kIsWeb ? SnackBarBehavior.floating : SnackBarBehavior.fixed, ), + pageTransitionsTheme: PageTransitionsTheme( + builders: { + TargetPlatform.fuchsia: ZoomPageTransitionsBuilder(), + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.linux: CupertinoPageTransitionsBuilder(), + TargetPlatform.macOS: CupertinoPageTransitionsBuilder(), + TargetPlatform.windows: CupertinoPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), dialogTheme: DialogTheme( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppConfig.borderRadius), @@ -126,6 +136,16 @@ abstract class FluffyThemes { ), clipBehavior: Clip.hardEdge, ), + pageTransitionsTheme: PageTransitionsTheme( + builders: { + TargetPlatform.fuchsia: ZoomPageTransitionsBuilder(), + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.linux: CupertinoPageTransitionsBuilder(), + TargetPlatform.macOS: CupertinoPageTransitionsBuilder(), + TargetPlatform.windows: CupertinoPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), floatingActionButtonTheme: FloatingActionButtonThemeData( backgroundColor: AppConfig.primaryColor, foregroundColor: Colors.white, diff --git a/lib/main.dart b/lib/main.dart index 81d11f1b..a3a28dba 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -95,7 +95,7 @@ class FluffyChatApp extends StatelessWidget { '/search', '/contacts', }.contains(settings.name) - ? CupertinoPageRoute(builder: builder) + ? MaterialPageRoute(builder: builder) : FadeRoute(page: builder(context)), ), ),