mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
feat: platform bottom navigation bar add
This commit is contained in:
parent
e795e23e42
commit
ff1446982f
@ -75,7 +75,7 @@ class Sidebar extends HookConsumerWidget {
|
|||||||
|
|
||||||
if (layoutMode == LayoutMode.compact ||
|
if (layoutMode == LayoutMode.compact ||
|
||||||
(breakpoints.isSm && layoutMode == LayoutMode.adaptive)) {
|
(breakpoints.isSm && layoutMode == LayoutMode.adaptive)) {
|
||||||
return child;
|
return PlatformScaffold(body: child);
|
||||||
}
|
}
|
||||||
|
|
||||||
void toggleExtended() =>
|
void toggleExtended() =>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:badges/badges.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:platform_ui/platform_ui.dart';
|
||||||
import 'package:spotube/components/Home/Sidebar.dart';
|
import 'package:spotube/components/Home/Sidebar.dart';
|
||||||
import 'package:spotube/hooks/useBreakpoints.dart';
|
import 'package:spotube/hooks/useBreakpoints.dart';
|
||||||
import 'package:spotube/models/sideBarTiles.dart';
|
import 'package:spotube/models/sideBarTiles.dart';
|
||||||
@ -37,37 +37,23 @@ class SpotubeNavigationBar extends HookConsumerWidget {
|
|||||||
if (layoutMode == LayoutMode.extended ||
|
if (layoutMode == LayoutMode.extended ||
|
||||||
(breakpoint.isMoreThan(Breakpoints.sm) &&
|
(breakpoint.isMoreThan(Breakpoints.sm) &&
|
||||||
layoutMode == LayoutMode.adaptive)) return const SizedBox();
|
layoutMode == LayoutMode.adaptive)) return const SizedBox();
|
||||||
return NavigationBar(
|
return PlatformBottomNavigationBar(
|
||||||
destinations: [
|
items: [
|
||||||
...sidebarTileList.map(
|
...sidebarTileList.map(
|
||||||
(e) {
|
(e) {
|
||||||
final icon = Icon(e.icon);
|
return PlatformBottomNavigationBarItem(
|
||||||
return NavigationDestination(
|
icon: e.icon,
|
||||||
icon: e.title == "Library" && downloadCount > 0
|
|
||||||
? Badge(
|
|
||||||
badgeColor: Colors.red[100]!,
|
|
||||||
badgeContent: Text(
|
|
||||||
downloadCount.toString(),
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.red,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
animationType: BadgeAnimationType.fade,
|
|
||||||
child: icon,
|
|
||||||
)
|
|
||||||
: icon,
|
|
||||||
label: e.title,
|
label: e.title,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const NavigationDestination(
|
const PlatformBottomNavigationBarItem(
|
||||||
icon: Icon(Icons.settings_rounded),
|
icon: Icons.settings_rounded,
|
||||||
label: "Settings",
|
label: "Settings",
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
selectedIndex: insideSelectedIndex.value,
|
selectedIndex: insideSelectedIndex.value,
|
||||||
onDestinationSelected: (i) {
|
onSelectedIndexChanged: (i) {
|
||||||
if (i == 4) {
|
if (i == 4) {
|
||||||
insideSelectedIndex.value = 4;
|
insideSelectedIndex.value = 4;
|
||||||
Sidebar.goToSettings(context);
|
Sidebar.goToSettings(context);
|
||||||
|
Loading…
Reference in New Issue
Block a user