A new Flutter project.
For help getting started with Flutter, view our online documentation.
For help on editing package code, view the documentation.
##How to use ?
- Depend on it
dependencies:
navigation_bar: "^0.0.1"
- Install it
$ flutter packages get
- Import it
import 'package:navigation_bar/navigation_tab_bar.dart';
##Example
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
var accentBackgroundColors = const Color(0xffe71d36);
return new NavigationTabBar(
onTap: (value, previousIndex) {},
tabBuilder: (BuildContext context, int index) {
return new LoginScreen();
},
navigationViews: <NavigationPageView>[
new NavigationPageView(
icon: const Icon(Icons.home),
title: '首页',
color: const Color(0xffe71d36),
vsync: this,
),
new NavigationPageView(
icon: const Icon(Icons.notifications),
title: '卡包',
color: accentBackgroundColors,
vsync: this,
),
new NavigationPageView(
icon: const Icon(Icons.menu),
title: '账户',
color: accentBackgroundColors,
vsync: this,
),
],
);
}
}