Skip to content

Commit

Permalink
feat: re-designed playlist/album page
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 17, 2023
1 parent a0767f4 commit 0cedc7a
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 169 deletions.
4 changes: 2 additions & 2 deletions lib/collections/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ final router = GoRouter(
routes: [
GoRoute(
path: "blacklist",
pageBuilder: (context, state) => const SpotubePage(
child: BlackListPage(),
pageBuilder: (context, state) => SpotubeSlidePage(
child: const BlackListPage(),
),
),
GoRoute(
Expand Down
20 changes: 20 additions & 0 deletions lib/components/shared/spotube_page_route.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

class SpotubePage<T> extends MaterialPage<T> {
const SpotubePage({required super.child});
}

class SpotubeSlidePage extends CustomTransitionPage {
SpotubeSlidePage({
required super.child,
super.key,
}) : super(
reverseTransitionDuration: const Duration(milliseconds: 150),
transitionDuration: const Duration(milliseconds: 150),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return SlideTransition(
position: Tween<Offset>(
begin: const Offset(1, 0),
end: Offset.zero,
).animate(animation),
child: child,
);
},
);
}
Loading

0 comments on commit 0cedc7a

Please sign in to comment.