BuiltTabNavigator<T extends EnumClass> class
Constructors
-
BuiltTabNavigator({Key? key, required Map<T, TabRoutesDefinition<EnumClass>> tabs, BodyBuilder? bodyBuilder, TabBuilder<T>? tabBuilder, Color? activeTabColor, dynamic tabTap(T)?, Color? inactiveTabColor, TitleBuilder<T>? titleBuilder, IconBuilder<T>? iconBuilder, OnGenerateRouteFn<T>? onGenerateRoute, T? activeTab, Color? tabContainerBackgroundColor, void didPop(T tab, Route route, Route? previousRoute)?, void didPush(T tab, Route route, Route? previousRoute)?, void didRemove(T tab, Route route, Route? previousRoute)?, void didReplace(T tab, Route? newRoute, Route? oldRoute)?, bool overridePopBehavior = true, double tabsHeight = 60, TabContentWrapBuilder? contentWrapBuilder, Duration contentAnimationDuration = const Duration(milliseconds: 450)})
-
Properties
-
activeTab
→ T?
-
Set
activetab
, if not defined will default to the firs tab
key defined at tabs
final
-
activeTabColor
→ Color?
-
Defines Color used for the tab
title
and icon
when tab
is active
final
-
bodyBuilder
→ BodyBuilder?
-
Defines a bodyBuilder, if you need something very custom, maybe the tabs located at different position: ie on Top
you can place tabs and
tabsViews
in a custom layout arrangement
final
-
contentAnimationDuration
→ Duration
-
Define a custom duration for the opacity transition implemented
This has no effect if you're implementing a custom contentWrapBuilder
Defaults to Duration(400ms)
final
-
contentWrapBuilder
→ TabContentWrapBuilder?
-
Defines a cutom builder for the widget that wraps each tab content,
This can be useful for bulding a Widget that implements a custom animation
params:
BuildContext The current context
EnumClass
The current tab
being builded
bool if the current tab
is active
Widget The actual content to be wraped, you neend to pass this widget as a child of your Widget implementation
final
-
didPop
→ (void Function(T tab, Route route, Route? previousRoute)?)
-
didPop navigationObserver callback
final
-
didPush
→ (void Function(T tab, Route route, Route? previousRoute)?)
-
didPush navigationObserver callback
final
-
didRemove
→ (void Function(T tab, Route route, Route? previousRoute)?)
-
didRemove navigationObserver callback
final
-
didReplace
→ (void Function(T tab, Route? newRoute, Route? oldRoute)?)
-
didReplace navigationObserver callback
final
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
iconBuilder
→ IconBuilder<T>?
-
Builds a custom
icon
Widget
final
-
inactiveTabColor
→ Color?
-
Defines Color used for the tab
title
and icon
when tab
is inactive
final
-
key
→ Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onGenerateRoute
→ OnGenerateRouteFn<T>?
-
Called everytime a route is being generated, it passes
the actual RouteSettings,
the tab
T
who owns that navigator,
the actual route EnumClass
used to produce the page
and the page builder WidgetBuilder based on the routes defined
This can be used to return a custom PageRoute Wrapper like MaterialPageRoute
or wraps the builder with a custom animation, etc
final
-
overridePopBehavior
→ bool
-
If
true
, it will implement WillPopScope widget for the nested navigation views, if false
,
back navigation will target the root navigator
defaults to true
final
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
tabBuilder
→ TabBuilder<T>?
-
Builds a custom
tab
widget for each tab, make sure to call the cb
parameter if you're using a custom GestureDetector|InkWell
or whatever widget that could handle touch events
calling cb
will trigger state build and change tab content as expected
final
-
tabContainerBackgroundColor
→ Color?
-
Change defaults tab container background
final
-
tabs
→ Map<T, TabRoutesDefinition<EnumClass>>
-
Defines default
selectedTab
Defines the tabs of this widget
Each tab
must define a TabRoutesDefinition
final
-
tabsHeight
→ double
-
Set a custom
height
for the tabs container
defaults to 60
This property doesnt take any effect if bodyBuilder is defined
final
-
tabTap
→ (dynamic Function(T)?)
-
Defines a tap handler when a
tab
final
-
titleBuilder
→ TitleBuilder<T>?
-
Builds a custom
title
Widget
final