mucke/lib/presentation/widgets/navbar.dart

53 lines
1.4 KiB
Dart
Raw Normal View History

2020-03-20 16:17:02 +01:00
import 'package:flutter/material.dart';
2020-04-09 17:50:28 +02:00
import 'currently_playing_bar.dart';
2020-03-20 16:17:02 +01:00
class NavBar extends StatefulWidget {
const NavBar({Key key, @required this.onTap, @required this.currentIndex})
: super(key: key);
2020-03-26 10:19:36 +01:00
final int currentIndex;
final Function(int) onTap;
2020-03-20 16:17:02 +01:00
@override
_NavBarState createState() => _NavBarState();
}
class _NavBarState extends State<NavBar> {
@override
Widget build(BuildContext context) {
return Container(
2020-05-09 19:46:06 +02:00
color: Theme.of(context).primaryColor,
2020-03-20 16:17:02 +01:00
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
2020-04-09 17:50:28 +02:00
const CurrentlyPlayingBar(),
2020-03-20 16:17:02 +01:00
Container(
2020-05-09 19:46:06 +02:00
color: Theme.of(context).primaryColorLight,
2020-03-20 16:17:02 +01:00
height: 1.0,
),
BottomNavigationBar(
2020-05-09 19:46:06 +02:00
backgroundColor: Theme.of(context).primaryColor,
2020-04-09 17:50:28 +02:00
currentIndex: widget.currentIndex,
onTap: widget.onTap,
items: const [
2020-04-09 17:50:28 +02:00
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
2020-04-09 17:50:28 +02:00
),
BottomNavigationBarItem(
icon: Icon(Icons.library_music),
label: 'Library',
2020-04-09 17:50:28 +02:00
),
BottomNavigationBarItem(
icon: Icon(Icons.settings),
label: 'Settings',
2020-04-09 17:50:28 +02:00
),
],
)
2020-03-20 16:17:02 +01:00
],
),
);
}
}