mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00

PlaylistView/SearchAlbumView are responsive now ArtistProfile album view & tracks view are paginated now
43 lines
1.2 KiB
Dart
43 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
import 'package:spotube/components/Home/Sidebar.dart';
|
|
import 'package:spotube/hooks/useBreakpoints.dart';
|
|
import 'package:spotube/models/sideBarTiles.dart';
|
|
|
|
class SpotubeNavigationBar extends HookWidget {
|
|
final int selectedIndex;
|
|
final void Function(int) onSelectedIndexChanged;
|
|
|
|
const SpotubeNavigationBar({
|
|
required this.selectedIndex,
|
|
required this.onSelectedIndexChanged,
|
|
Key? key,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final breakpoint = useBreakpoints();
|
|
|
|
if (breakpoint.isMoreThan(Breakpoints.sm)) return Container();
|
|
return NavigationBar(
|
|
destinations: [
|
|
...sidebarTileList.map(
|
|
(e) => NavigationDestination(icon: Icon(e.icon), label: e.title),
|
|
),
|
|
const NavigationDestination(
|
|
icon: Icon(Icons.settings_rounded),
|
|
label: "Settings",
|
|
)
|
|
],
|
|
selectedIndex: selectedIndex,
|
|
onDestinationSelected: (i) {
|
|
if (i == 4) {
|
|
Sidebar.goToSettings(context);
|
|
} else {
|
|
onSelectedIndexChanged(i);
|
|
}
|
|
},
|
|
);
|
|
}
|
|
}
|