feat: Zoom page transition on Android and Fuchsia

This commit is contained in:
Christian Pauly 2021-05-16 09:58:21 +02:00
parent 3830b4bd6b
commit e6c20ddd18
2 changed files with 21 additions and 1 deletions

View File

@ -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,

View File

@ -95,7 +95,7 @@ class FluffyChatApp extends StatelessWidget {
'/search',
'/contacts',
}.contains(settings.name)
? CupertinoPageRoute(builder: builder)
? MaterialPageRoute(builder: builder)
: FadeRoute(page: builder(context)),
),
),