tabbar
a powerful official extension library of tab/tab,bar/tabview, which support to scroll ancestor or child tabs when current is overscroll, and set scroll direction and cache extent.
usage
dependencies:
flutter:
sdk: flutter
extended_tabs: any
colortabindicator
show tab indicator with color fill
tabb,ar(
indicator: colortabindicator(colors.blue),
labelcolor: colors.black,
tabs: [
tab(text: "tab0"),
tab(text: "tab1"),
],
controller: tabcontroller,
)
link
/// if link is true and current ,over scroll,
/// it will check and scroll ancestor or child t,abbarview.
/// default is true
final bool link;
extendedtab,barview(
children: <widget>[
list("tab000"),
list("tab001"),
list("tab002"),
list("tab003"),
],
controller: tabcontroller2,
link: true,
)
scrolldirection
/// the axis along which the tab bar and tab view scrolls.
///
/// defaults to [axis.horizontal].
final axis scrolldirection;
row(
children: <widget>[
extendedtabbar(
indicator: const colortabindicator(colors.blue),
labelcolor: colors.black,
scrolldirection: axis.vertical,
tabs: const <extendedtab>[
extendedtab(
text: 'tab0',
scrolldirection: axis.vertical,
),
extendedtab(
text: 'tab1',
scrolldirection: axis.vertical,
),
],
controller: tabcontroller,
),
expanded(
child: extendedtabbarview(
children: <widget>[
const listwidget(
'tab1',
scrolldirection: axis.horizontal,
),
const listwidget(
'tab1',
scrolldirection: axis.horizontal,
),
],
controller: tabcontroller,
scrolldirection: axis.vertical,
),
)
],
)
cacheextent
/// cache page count
/// default is 0.
/// if cacheextent is 1, it has two pages in cache
final int cacheextent;
extendedtabbarview(
children: <widget>[
list("tab000"),
list("tab001"),
list("tab002"),
list("tab003"),
],
controller: tabcontroller2,
linkwithancestor: true,
cacheextent: 1,
)
Comments are closed.