mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00

PlayerControls slider & duration are now vertical hotkey init moved to Home Player & YoutubeExplode are provided through riverpod Playback handles all things Player used to do GoRoutes are seperated from main to individual model file usePaletteColor bugfix occuring for before initilizing mount
75 lines
2.4 KiB
Dart
75 lines
2.4 KiB
Dart
import 'package:go_router/go_router.dart';
|
|
import 'package:palette_generator/palette_generator.dart';
|
|
import 'package:spotify/spotify.dart';
|
|
import 'package:spotube/components/Album/AlbumView.dart';
|
|
import 'package:spotube/components/Artist/ArtistAlbumView.dart';
|
|
import 'package:spotube/components/Artist/ArtistProfile.dart';
|
|
import 'package:spotube/components/Home/Home.dart';
|
|
import 'package:spotube/components/Player/PlayerControls.dart';
|
|
import 'package:spotube/components/Player/PlayerView.dart';
|
|
import 'package:spotube/components/Playlist/PlaylistView.dart';
|
|
import 'package:spotube/components/Settings.dart';
|
|
import 'package:spotube/components/Shared/SpotubePageRoute.dart';
|
|
|
|
GoRouter createGoRouter() => GoRouter(
|
|
routes: [
|
|
GoRoute(
|
|
path: "/",
|
|
builder: (context, state) => const Home(),
|
|
),
|
|
GoRoute(
|
|
path: "/settings",
|
|
pageBuilder: (context, state) => SpotubePage(
|
|
child: const Settings(),
|
|
),
|
|
),
|
|
GoRoute(
|
|
path: "/album/:id",
|
|
pageBuilder: (context, state) {
|
|
assert(state.extra is AlbumSimple);
|
|
return SpotubePage(child: AlbumView(state.extra as AlbumSimple));
|
|
},
|
|
),
|
|
GoRoute(
|
|
path: "/artist/:id",
|
|
pageBuilder: (context, state) {
|
|
assert(state.params["id"] != null);
|
|
return SpotubePage(child: ArtistProfile(state.params["id"]!));
|
|
},
|
|
),
|
|
GoRoute(
|
|
path: "/artist-album/:id",
|
|
pageBuilder: (context, state) {
|
|
assert(state.params["id"] != null);
|
|
assert(state.extra is String);
|
|
return SpotubePage(
|
|
child: ArtistAlbumView(
|
|
state.params["id"]!,
|
|
state.extra as String,
|
|
),
|
|
);
|
|
},
|
|
),
|
|
GoRoute(
|
|
path: "/playlist/:id",
|
|
pageBuilder: (context, state) {
|
|
assert(state.extra is PlaylistSimple);
|
|
return SpotubePage(
|
|
child: PlaylistView(state.extra as PlaylistSimple),
|
|
);
|
|
},
|
|
),
|
|
GoRoute(
|
|
path: "/player",
|
|
pageBuilder: (context, state) {
|
|
assert(state.extra is PaletteColor);
|
|
return SpotubePage(
|
|
child: PlayerView(
|
|
paletteColor: state.extra as PaletteColor,
|
|
),
|
|
);
|
|
},
|
|
)
|
|
],
|
|
);
|