custombottomnavbar 0.0.8 custombottomnavbar: ^0.0.8 copied to clipboard
A Custom Bottom Navigation Bar with the ability to create custom shapes for the icons
import 'package:custombottomnavbar/custombottomnavbar.dart';
import 'package:flutter/material.dart';
class Test extends StatefulWidget {
@override
_TestState createState() => _TestState();
}
List indexList = [
// put your pages here
];
class _TestState extends State<Test> {
int _index = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
// backgroundColor: Color(0xff2F2D52),
bottomSheet: CustomBottomNavigation(
radius: BorderRadius.only(
topRight: Radius.circular(0), topLeft: Radius.circular(0)),
items: [
// items go here
NavItem(
icon: Icons.home,
index: _index,
bg: _index != 0 ? Color(0xff595775) : Colors.white,
size: 30,
current: 0,
onTap: () {
setState(() {
_index = 0;
});
},
),
Container(
width: 60,
height: 60,
decoration: BoxDecoration(
color: _index == 1 ? Colors.white : Color(0xff595775),
borderRadius: BorderRadius.circular(20),
),
child: NavItem(
icon: Icons.add,
index: _index,
bg: _index == 1 ? Color(0xff595775) : Colors.white,
size: 40,
current: 1,
onTap: () {
setState(() {
_index = 1;
});
},
),
),
],
color1: Color(0xff2F2D52),
),
body: indexList.elementAt(_index),
);
}
}