Skip to content

Commit

Permalink
feat(navigation): add custom slide-up page transition for now playing…
Browse files Browse the repository at this point in the history
… page (#451)
  • Loading branch information
gokadzev committed Nov 29, 2024
1 parent 296b817 commit 30dafc8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/widgets/mini_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,23 @@ class MiniPlayer extends StatelessWidget {
if (details.primaryDelta! < 0) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const NowPlayingPage(),
PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) {
return const NowPlayingPage();
},
transitionsBuilder:
(context, animation, secondaryAnimation, child) {
const begin = Offset(0, 1);
const end = Offset.zero;

final tween = Tween(begin: begin, end: end);
final curve =
CurvedAnimation(parent: animation, curve: Curves.easeInOut);

final offsetAnimation = tween.animate(curve);

return SlideTransition(position: offsetAnimation, child: child);
},
),
);
}
Expand Down

0 comments on commit 30dafc8

Please sign in to comment.