animated_bottom_bar 0.0.1 animated_bottom_bar: ^0.0.1 copied to clipboard
A Nice Animated Bottom Bar
Installation #
- Add the latest version of package to pubspec.yaml
dependencies:
animated_bottom_bar:
- Import the package
import 'package:animated_bottom_bar/animated_bottom_bar.dart';
class Test extends StatefulWidget {
const Test({Key? key}) : super(key: key);
@override
State<Test> createState() => _TestState();
}
class _TestState extends State<Test> {
int select = 0;
Color active = Colors.blue;
Color inactive = Colors.black;
@override
Widget build(BuildContext context) {
double mediaQH = MediaQuery.of(context).size.height;
double mediaQW = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
height: mediaQH,
width: mediaQW,
color: Colors.white.withOpacity(0.9),
child: AnimatedBottomBar(
width: mediaQW,
height: mediaQH*0.1,
selectedIndex: select,
items: [
AnimatedBarItem(
icon: Icon(Icons.home),
),
AnimatedBarItem(
icon: Icon(Icons.dashboard),
),
AnimatedBarItem(
icon: Icon(Icons.safety_check),
),
AnimatedBarItem(
icon: Icon(Icons.person),
),
],
onItemSelected: (_){
setState((){
select = _;
});
print(select);
},
),
),
);
}
}