cuberto bottom bar
flutter plugin – cubertobottombar.
cuberto bottom bar gif- default style
cuberto bottom bar gif- faded style
getting started
dependencies:
...
cuberto_bottom_bar: ^0.0.2
limitations
for now this is limited to more than 1 tab, and less than 5. so 2-4 tabs.
textcolor will only be applied in the case of style_normal,
in case of style_faded_background the tabcolor will be set as textcolor,(if tabcolor is not set inactivecolor will be set)
manually drawer or enddrawer has to be added and then respective drawer has to be added in cubertobottombar (
cubertodrawer.no_drawer for no drawer, cubertodrawer.start_drawer for drawer and cubertodrawer.end_drawer for enddrawer)
by default the drawer overlaps the cubertobottombar, for that margin: edgeinsets.only(bottom: 60.0) has been added. (please check with the example)
the values in ontabchangedlistener: (position, title, color) (position, title and color are null at the beginning), but gets the value once the tab is clicked.
basic usage
adding the widget
bottomnavigationbar: cubertobottombar(
inactiveiconcolor: inactivecolor,
tabstyle: cubertotabstyle.style_faded_background, // by default its cubertotabstyle.style_normal
initialselection: 0, // by default its 0
drawer: cubertodrawer.no_drawer, // by default its no_drawer (availble start_drawer and end_drawer as per where you want to how the drawer icon in cuberto bottom bar)
tabs: [
tabdata(
icondata: icons.home,
title: "home",
tabcolor: colors.deeppurple),
tabdata(
icondata: icons.search,
title: "search",
tabcolor: colors.pink),
tabdata(
icondata: icons.access_alarm,
title: "alarm",
tabcolor: colors.amber),
tabdata(
icondata: icons.settings,
title: "settings",
tabcolor: colors.teal),
],
ontabchangedlistener: (position, title, color) {
setstate(() {
currentpage = position;
currenttitle = title;
currentcolor = color;
});
},
),
tabdata
icondata -> icon to be used for the tab
title -> string to be used for the tab
tabcolor: -> colors to be used for background and label when style_faded_background is choosed
onclick -> optional function to be used when the circle itself is clicked, on an active tab
attributes
required
tabs -> list of tabdata
objects
ontabchangedlistener -> function to handle a tap on a tab, receives int position
, string title
and color tabcolor
(if not set will return inactiveiconcolor in both style_normal and style_faded_background)
optional
initialselection -> defaults to 0
inactiveiconcolor -> defaults to null, derives from theme
textcolor -> defaults to colors.white
barbackgroundcolor -> defaults to null, derives from theme
tabstyle -> defaults to cubertotabstyle.style_normal
drawer -> defaults to cubertodrawer.no_drawer (can be set as cubertodrawer.start_drawer or cubertodrawer.end_drawer as per the need for the placement of drawer icon)
key -> defaults to null
theming
the bar will attempt to use your current theme out of the box, however you may want to theme it. here are the attributes:
cuberto bottom bar theming – style_faded_background
cuberto bottom bar theming – style_normal
showcase
using this package in a live app, let me know and i’ll add you app here.
Comments are closed.