floating_navbar 2.0.1 floating_navbar: ^2.0.1 copied to clipboard
Customisable, clean looking bottom floating navbar. FloatingNavBar comes with multiple customization options - colors, page indicators, etc. This can be used as an alternative to the default BottomNa [...]
import 'package:floating_navbar/floating_navbar.dart';
import 'package:floating_navbar/floating_navbar_item.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: FloatingNavBar(
color: Colors.green,
items: [
FloatingNavBarItem(
iconData: Icons.home,
title: 'Home',
page: HomePage(),
),
FloatingNavBarItem(
iconData: Icons.account_circle,
title: 'Account',
page: MyPage(),
)
],
selectedIconColor: Colors.white,
hapticFeedback: true,
horizontalPadding: 40,
),
);
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Container(
child: Center(
child: Text(
"iamngoni made it👏",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
),
);
}
}
class MyPage extends StatefulWidget {
@override
_MyPageState createState() => _MyPageState();
}
class _MyPageState extends State<MyPage> {
@override
Widget build(BuildContext context) {
return Container(
child: Center(
child: Text(
"iamngoni is cool😎",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
),
);
}
}