feat: Use Material 3 animation curves

This commit is contained in:
inexcode 2023-02-24 13:38:57 +03:00 committed by Gitea
parent 6656635785
commit 0df9d2ac27
6 changed files with 15 additions and 15 deletions

View file

@ -38,7 +38,7 @@ class SegmentedButtons extends StatelessWidget {
opacity: isSelected[index] ? 1 : 0,
child: AnimatedScale(
duration: const Duration(milliseconds: 200),
curve: Curves.easeInOut,
curve: Curves.easeInOutCubicEmphasized,
alignment: Alignment.centerLeft,
scale: isSelected[index] ? 1 : 0,
child: Icon(
@ -53,7 +53,7 @@ class SegmentedButtons extends StatelessWidget {
? const EdgeInsets.only(left: 24)
: EdgeInsets.zero,
duration: const Duration(milliseconds: 200),
curve: Curves.easeInOut,
curve: Curves.easeInOutCubicEmphasized,
child: Text(
title,
style: Theme.of(context).textTheme.labelLarge,

View file

@ -27,14 +27,14 @@ class BrandLinearIndicator extends StatelessWidget {
alignment: Alignment.centerLeft,
child: AnimatedSlide(
duration: const Duration(milliseconds: 400),
curve: Curves.easeInOut,
curve: Curves.easeInOutCubicEmphasized,
offset: Offset(
-(1 - value),
0,
),
child: AnimatedContainer(
duration: const Duration(milliseconds: 400),
curve: Curves.easeInOut,
curve: Curves.easeInOutCubicEmphasized,
width: constraints.maxWidth,
decoration: BoxDecoration(
color: color,

View file

@ -190,9 +190,9 @@ class BottomBar extends StatelessWidget {
print(prevActiveIndex);
return AnimatedContainer(
duration: const Duration(milliseconds: 200),
duration: const Duration(milliseconds: 500),
height: hidden ? 0 : 80,
curve: Curves.easeInOut,
curve: Curves.easeInOutCubicEmphasized,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: Theme.of(context).scaffoldBackgroundColor,

View file

@ -76,7 +76,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
pageController.animateToPage(
1,
duration: const Duration(milliseconds: 300),
curve: Curves.easeIn,
curve: Curves.easeInOutCubicEmphasized,
);
},
text: 'basis.next'.tr(),

View file

@ -53,25 +53,25 @@ Widget fadeThroughTransition(
usesPathAsKey: true,
initial: true,
transitionsBuilder: fadeThroughTransition,
durationInMilliseconds: 200,
durationInMilliseconds: 400,
),
CustomRoute(
page: ServicesPage,
usesPathAsKey: true,
transitionsBuilder: fadeThroughTransition,
durationInMilliseconds: 200,
durationInMilliseconds: 400,
),
CustomRoute(
page: UsersPage,
usesPathAsKey: true,
transitionsBuilder: fadeThroughTransition,
durationInMilliseconds: 200,
durationInMilliseconds: 400,
),
CustomRoute(
page: MorePage,
usesPathAsKey: true,
transitionsBuilder: fadeThroughTransition,
durationInMilliseconds: 200,
durationInMilliseconds: 400,
),
AutoRoute(page: AppSettingsPage),
AutoRoute(page: UserDetailsPage),

View file

@ -64,7 +64,7 @@ class _$RootRouter extends RootStackRouter {
routeData: routeData,
child: const ProvidersPage(),
transitionsBuilder: fadeThroughTransition,
durationInMilliseconds: 200,
durationInMilliseconds: 400,
opaque: true,
barrierDismissible: false,
);
@ -74,7 +74,7 @@ class _$RootRouter extends RootStackRouter {
routeData: routeData,
child: const ServicesPage(),
transitionsBuilder: fadeThroughTransition,
durationInMilliseconds: 200,
durationInMilliseconds: 400,
opaque: true,
barrierDismissible: false,
);
@ -84,7 +84,7 @@ class _$RootRouter extends RootStackRouter {
routeData: routeData,
child: const UsersPage(),
transitionsBuilder: fadeThroughTransition,
durationInMilliseconds: 200,
durationInMilliseconds: 400,
opaque: true,
barrierDismissible: false,
);
@ -94,7 +94,7 @@ class _$RootRouter extends RootStackRouter {
routeData: routeData,
child: const MorePage(),
transitionsBuilder: fadeThroughTransition,
durationInMilliseconds: 200,
durationInMilliseconds: 400,
opaque: true,
barrierDismissible: false,
);