floating_navbar 2.0.2 floating_navbar: ^2.0.2 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(
resizeToAvoidBottomInset: false,
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: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"iamngoni made it๐",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
SizedBox(
height: 20,
),
TextField(
decoration: InputDecoration(
hintText: "Fixing insets issue",
),
),
],
),
);
}
}
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,
),
),
),
);
}
}