mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 17:26:35 +00:00
feat: Use Material 3 animation curves
This commit is contained in:
parent
6656635785
commit
0df9d2ac27
|
@ -38,7 +38,7 @@ class SegmentedButtons extends StatelessWidget {
|
||||||
opacity: isSelected[index] ? 1 : 0,
|
opacity: isSelected[index] ? 1 : 0,
|
||||||
child: AnimatedScale(
|
child: AnimatedScale(
|
||||||
duration: const Duration(milliseconds: 200),
|
duration: const Duration(milliseconds: 200),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOutCubicEmphasized,
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
scale: isSelected[index] ? 1 : 0,
|
scale: isSelected[index] ? 1 : 0,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
|
@ -53,7 +53,7 @@ class SegmentedButtons extends StatelessWidget {
|
||||||
? const EdgeInsets.only(left: 24)
|
? const EdgeInsets.only(left: 24)
|
||||||
: EdgeInsets.zero,
|
: EdgeInsets.zero,
|
||||||
duration: const Duration(milliseconds: 200),
|
duration: const Duration(milliseconds: 200),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOutCubicEmphasized,
|
||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
style: Theme.of(context).textTheme.labelLarge,
|
style: Theme.of(context).textTheme.labelLarge,
|
||||||
|
|
|
@ -27,14 +27,14 @@ class BrandLinearIndicator extends StatelessWidget {
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: AnimatedSlide(
|
child: AnimatedSlide(
|
||||||
duration: const Duration(milliseconds: 400),
|
duration: const Duration(milliseconds: 400),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOutCubicEmphasized,
|
||||||
offset: Offset(
|
offset: Offset(
|
||||||
-(1 - value),
|
-(1 - value),
|
||||||
0,
|
0,
|
||||||
),
|
),
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 400),
|
duration: const Duration(milliseconds: 400),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOutCubicEmphasized,
|
||||||
width: constraints.maxWidth,
|
width: constraints.maxWidth,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: color,
|
color: color,
|
||||||
|
|
|
@ -190,9 +190,9 @@ class BottomBar extends StatelessWidget {
|
||||||
print(prevActiveIndex);
|
print(prevActiveIndex);
|
||||||
|
|
||||||
return AnimatedContainer(
|
return AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 200),
|
duration: const Duration(milliseconds: 500),
|
||||||
height: hidden ? 0 : 80,
|
height: hidden ? 0 : 80,
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOutCubicEmphasized,
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).scaffoldBackgroundColor,
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
|
|
@ -76,7 +76,7 @@ class _OnboardingPageState extends State<OnboardingPage> {
|
||||||
pageController.animateToPage(
|
pageController.animateToPage(
|
||||||
1,
|
1,
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
curve: Curves.easeIn,
|
curve: Curves.easeInOutCubicEmphasized,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
text: 'basis.next'.tr(),
|
text: 'basis.next'.tr(),
|
||||||
|
|
|
@ -53,25 +53,25 @@ Widget fadeThroughTransition(
|
||||||
usesPathAsKey: true,
|
usesPathAsKey: true,
|
||||||
initial: true,
|
initial: true,
|
||||||
transitionsBuilder: fadeThroughTransition,
|
transitionsBuilder: fadeThroughTransition,
|
||||||
durationInMilliseconds: 200,
|
durationInMilliseconds: 400,
|
||||||
),
|
),
|
||||||
CustomRoute(
|
CustomRoute(
|
||||||
page: ServicesPage,
|
page: ServicesPage,
|
||||||
usesPathAsKey: true,
|
usesPathAsKey: true,
|
||||||
transitionsBuilder: fadeThroughTransition,
|
transitionsBuilder: fadeThroughTransition,
|
||||||
durationInMilliseconds: 200,
|
durationInMilliseconds: 400,
|
||||||
),
|
),
|
||||||
CustomRoute(
|
CustomRoute(
|
||||||
page: UsersPage,
|
page: UsersPage,
|
||||||
usesPathAsKey: true,
|
usesPathAsKey: true,
|
||||||
transitionsBuilder: fadeThroughTransition,
|
transitionsBuilder: fadeThroughTransition,
|
||||||
durationInMilliseconds: 200,
|
durationInMilliseconds: 400,
|
||||||
),
|
),
|
||||||
CustomRoute(
|
CustomRoute(
|
||||||
page: MorePage,
|
page: MorePage,
|
||||||
usesPathAsKey: true,
|
usesPathAsKey: true,
|
||||||
transitionsBuilder: fadeThroughTransition,
|
transitionsBuilder: fadeThroughTransition,
|
||||||
durationInMilliseconds: 200,
|
durationInMilliseconds: 400,
|
||||||
),
|
),
|
||||||
AutoRoute(page: AppSettingsPage),
|
AutoRoute(page: AppSettingsPage),
|
||||||
AutoRoute(page: UserDetailsPage),
|
AutoRoute(page: UserDetailsPage),
|
||||||
|
|
|
@ -64,7 +64,7 @@ class _$RootRouter extends RootStackRouter {
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: const ProvidersPage(),
|
child: const ProvidersPage(),
|
||||||
transitionsBuilder: fadeThroughTransition,
|
transitionsBuilder: fadeThroughTransition,
|
||||||
durationInMilliseconds: 200,
|
durationInMilliseconds: 400,
|
||||||
opaque: true,
|
opaque: true,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
);
|
);
|
||||||
|
@ -74,7 +74,7 @@ class _$RootRouter extends RootStackRouter {
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: const ServicesPage(),
|
child: const ServicesPage(),
|
||||||
transitionsBuilder: fadeThroughTransition,
|
transitionsBuilder: fadeThroughTransition,
|
||||||
durationInMilliseconds: 200,
|
durationInMilliseconds: 400,
|
||||||
opaque: true,
|
opaque: true,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
);
|
);
|
||||||
|
@ -84,7 +84,7 @@ class _$RootRouter extends RootStackRouter {
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: const UsersPage(),
|
child: const UsersPage(),
|
||||||
transitionsBuilder: fadeThroughTransition,
|
transitionsBuilder: fadeThroughTransition,
|
||||||
durationInMilliseconds: 200,
|
durationInMilliseconds: 400,
|
||||||
opaque: true,
|
opaque: true,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
);
|
);
|
||||||
|
@ -94,7 +94,7 @@ class _$RootRouter extends RootStackRouter {
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: const MorePage(),
|
child: const MorePage(),
|
||||||
transitionsBuilder: fadeThroughTransition,
|
transitionsBuilder: fadeThroughTransition,
|
||||||
durationInMilliseconds: 200,
|
durationInMilliseconds: 400,
|
||||||
opaque: true,
|
opaque: true,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue