pandabar 0.0.2 pandabar: ^0.0.2 copied to clipboard
A new Flutter package project.
PandaBar #
A fancy navigation bar for pandas.
Preview | PageView |
---|---|
Customization (Optional) #
PandaBar #
buttonData
- navigation items, required more than one item and less than 5onChange
- required to listen when a item is pressed it provide the selected item's idbackgroundColor
- the navigation bar's background colorfabIcon
- the navigation bar's fab button icononFabButtonPressed
- required to listen fab button is pressed
PandaBarButtonData #
id
- the id of this itemicon
- the icon of this itemtitle
- the title of this item
Getting Started #
Add the dependency in pubspec.yaml
:
dependencies:
...
pandabar: ^0.0.2
Basic Usage #
Adding the widget
bottomNavigationBar: PandaBar(
buttonData: [
PandaBarButtonData(
id: AppPage.Dashboard,
icon: Icons.dashboard,
title: 'Dashboard'
),
PandaBarButtonData(
id: AppPage.ReservationList,
icon: Icons.book,
title: 'Reservation'
),
PandaBarButtonData(
id: AppPage.Accounting,
icon: Icons.account_balance_wallet,
title: 'Accounting'
),
PandaBarButtonData(
id: AppPage.Notifications,
icon: Icons.notifications,
title: 'Notifications'
),
],
onChange: (id) {
BlocProvider.of<DrawerBloc>(context).add(PageSelected(page: (id as AppPage)));
},
onFabButtonPressed: () {
Navigator.push(context, CupertinoPageRoute(
fullscreenDialog: true,
builder: (context) => NewBookingScreen(),
));
},
),