VMatTabBar class
A material design widget that displays a horizontal row of vTabs.
Typically created as the AppBar.bottom part of an AppBar and in conjunction with a VMatTabBarView.
If a TabController is not provided, then a DefaultTabController ancestor must be provided instead. The vTab controller's TabController.length must equal the length of the vTabs list and the length of the VMatTabBarView.children list.
Requires one of its ancestors to be a Material widget.
Uses values from TabBarTheme if it is set in the current context.
{@tool dartpad} This sample shows the implementation of VMatTabBar and VMatTabBarView using a DefaultTabController. Each VMatTab corresponds to a child of the VMatTabBarView in the order they are written.
** See code in examples/api/lib/material/vTabs/vTab_bar.0.dart ** {@end-tool}
{@tool dartpad} VMatTabBar can also be implemented by using a TabController which provides more options to control the behavior of the VMatTabBar and VMatTabBarView. This can be used instead of a DefaultTabController, demonstrated below.
** See code in examples/api/lib/material/vTabs/vTab_bar.1.dart ** {@end-tool}
See also:
- VMatTabBarView, which displays page views that correspond to each vTab.
- VMatTabBar, which is used to display the VMatTab that corresponds to each page of the VMatTabBarView.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- VMatTabBar
- Implemented types
Constructors
-
VMatTabBar({Key? key, required List<
Widget> vTabs, TabController? controller, bool isScrollable = false, EdgeInsetsGeometry? padding, Color? indicatorColor, bool automaticIndicatorColorAdjustment = true, double indicatorWeight = 2.0, EdgeInsetsGeometry indicatorPadding = EdgeInsets.zero, Decoration? indicator, VMatTabBarIndicatorSize? indicatorSize = VMatTabBarIndicatorSize.vTab, Color? labelColor, TextStyle? labelStyle, EdgeInsetsGeometry? labelPadding, Color? unselectedLabelColor, TextStyle? unselectedLabelStyle, Color? selectedBackgroundColor, Color? unselectedBackgroundColor, DragStartBehavior dragStartBehavior = DragStartBehavior.start, WidgetStateProperty<Color?> ? overlayColor, MouseCursor? mouseCursor, bool? enableFeedback, ValueChanged<int> ? onTap, ScrollPhysics? physics}) -
Creates a material design vTab bar.
const
Properties
- automaticIndicatorColorAdjustment → bool
-
Whether this vTab bar should automatically adjust the indicatorColor.
final
- controller → TabController?
-
This widget's selection and animation state.
final
- dragStartBehavior → DragStartBehavior
-
Determines the way that drag start behavior is handled.
final
- enableFeedback → bool?
-
Whether detected gestures should provide acoustic and/or haptic feedback.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- indicator → Decoration?
-
Defines the appearance of the selected vTab indicator.
final
- indicatorColor → Color?
-
The color of the line that appears below the selected vTab.
final
- indicatorPadding → EdgeInsetsGeometry
-
Padding for indicator.
This property will now no longer be ignored even if indicator is declared
or provided by TabBarTheme
final
- indicatorSize → VMatTabBarIndicatorSize?
-
Defines how the selected vTab indicator's size is computed.
final
- indicatorWeight → double
-
The thickness of the line that appears below the selected vTab.
final
- isScrollable → bool
-
Whether this vTab bar can be scrolled horizontally.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- labelColor → Color?
-
The color of selected vTab labels.
final
- labelPadding → EdgeInsetsGeometry?
-
The padding added to each of the vTab labels.
final
- labelStyle → TextStyle?
-
The text style of the selected vTab labels.
final
- mouseCursor → MouseCursor?
-
The cursor for a mouse pointer when it enters or is hovering over the
individual vTab widgets.
final
-
onTap
→ ValueChanged<
int> ? -
An optional callback that's called when the VMatTabBar is tapped.
final
-
overlayColor
→ WidgetStateProperty<
Color?> ? -
Defines the ink response focus, hover, and splash colors.
final
- padding → EdgeInsetsGeometry?
-
The amount of space by which to inset the vTab bar.
final
- physics → ScrollPhysics?
-
How the VMatTabBar's scroll view should respond to user input.
final
- preferredSize → Size
-
A size whose height depends on if the vTabs have both icons and text.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedBackgroundColor → Color?
-
The color of selected vTab background.
final
- unselectedBackgroundColor → Color?
-
The color of unselected vTab background.
final
- unselectedLabelColor → Color?
-
The color of unselected vTab labels.
final
- unselectedLabelStyle → TextStyle?
-
The text style of the unselected vTab labels.
final
- vTabHasTextAndIcon → bool
-
Returns whether the VMatTabBar contains a vTab with both text and icon.
no setter
-
vTabs
→ List<
Widget> -
Typically a list of two or more VMatTab widgets.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< VMatTabBar> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited