ff_navigation_bar 0.1.2 ff_navigation_bar: ^0.1.2 copied to clipboard
Configurable bottom navigation bar with raised highlight and shadow
import 'package:ff_navigation_bar/ff_navigation_bar.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: 'ff_navigation_bar Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'ff_navigation_bar Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int selectedIndex = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Demonstration',
),
],
),
),
bottomNavigationBar: FFNavigationBar(
theme: FFNavigationBarTheme(
barBackgroundColor: Colors.black87,
selectedItemBorderColor: Colors.transparent,
selectedItemBackgroundColor: Colors.green,
selectedItemIconColor: Colors.white,
selectedItemLabelColor: Colors.white,
),
selectedIndex: selectedIndex,
onSelectTab: (index) {
setState(() {
selectedIndex = index;
});
},
items: [
FFNavigationBarItem(
iconData: Icons.calendar_today,
label: 'Bar Theme',
),
FFNavigationBarItem(
iconData: Icons.people,
label: 'Orange',
selectedBackgroundColor: Colors.orange,
),
FFNavigationBarItem(
iconData: Icons.attach_money,
label: 'Purple',
selectedBackgroundColor: Colors.purple,
),
FFNavigationBarItem(
iconData: Icons.note,
label: 'Blue',
selectedBackgroundColor: Colors.blue,
),
FFNavigationBarItem(
iconData: Icons.settings,
label: 'Red Item',
selectedBackgroundColor: Colors.red,
),
],
),
);
}
}