35 lines
724 B
Dart
35 lines
724 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SidebarNav extends StatelessWidget {
|
|
final int selectedIndex;
|
|
final ValueChanged<int> onItemSelected;
|
|
|
|
const SidebarNav({
|
|
super.key,
|
|
required this.selectedIndex,
|
|
required this.onItemSelected,
|
|
});
|
|
|
|
final List<String> _navItems = const [
|
|
'Home',
|
|
'SoundSources',
|
|
'Listen',
|
|
'Settings',
|
|
'About'
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return NavigationRail(
|
|
selectedIndex: selectedIndex,
|
|
onDestinationSelected: onItemSelected,
|
|
destinations: _navItems
|
|
.map((item) => NavigationRailDestination(
|
|
icon: Text(item),
|
|
label: Text(item),
|
|
))
|
|
.toList(),
|
|
);
|
|
}
|
|
}
|