Skip to content

Commit

Permalink
✨ Use SlideTransition
Browse files Browse the repository at this point in the history
  • Loading branch information
H2Sxxa committed Aug 4, 2024
1 parent 742e357 commit aee4186
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ class HomePageState extends State<HomePage> with RefreshMountedStateMixin {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
body: NavigationView(
transitionBuilder: (child, animation) {
const begin = Offset(0.0, 1.0);
const end = Offset.zero;
final tween = Tween(begin: begin, end: end)
.chain(CurveTween(curve: Curves.fastEaseInToSlowEaseOut));
final offsetAnimation = animation.drive(tween);
return SlideTransition(
position: offsetAnimation,
child: child,
);
},
builder: (context, vertical, horizontal, state) => Column(
children: [
Container(
Expand Down

0 comments on commit aee4186

Please sign in to comment.