indicator_bottom_navigationbar 0.0.1
indicator_bottom_navigationbar: ^0.0.1 copied to clipboard
The IndicatorBottomNavigationbar is a customizable and animated bottom navigation bar for Flutter. It allows you to easily create a bottom navigation bar with dynamic indicator animations that highlig [...]
import 'package:flutter/material.dart';
import 'package:indicator_bottom_navigationbar/indicator_bottom_navigationbar.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Indicator Bottom Navigation Bar Demo',
home: Example(),
);
}
}
class Example extends StatefulWidget {
const Example({super.key});
@override
State<Example> createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
int currentIndex = 0;
static List<IconLabel> iconLabels = [
IconLabel(Icons.home, "Home"),
IconLabel(Icons.shopping_bag, "Shopping"),
IconLabel(Icons.money, "Money"),
IconLabel(Icons.more_horiz_outlined, "More"),
];
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
bottomNavigationBar: IndicatorBottomNavigationbar(
currentIndex: currentIndex,
onTap: (index) {
currentIndex = index;
setState(() {});
},
iconLabels: iconLabels,
selectedItemColor: Colors.blue,
unselectedItemColor: Colors.grey[700]!,
backgroundColor: Colors.black,
indicatorHeight: 2.5,
indicatorWidth: 70,
),
);
}
}