Tab class

Represents a single tab within a TabView.

Inheritance
Available extensions

Constructors

Tab.new({Key? key, Widget? icon = const SizedBox.shrink(), required Widget text, required Widget body, WidgetStateProperty<Color>? backgroundColor, WidgetStateProperty<Color>? selectedBackgroundColor, WidgetStateProperty<Color>? foregroundColor, WidgetStateProperty<Color>? selectedForegroundColor, WidgetStateProperty<Color>? outlineColor, Widget? closeIcon = const Icon(FluentIcons.chrome_close), VoidCallback? onClosed, String? semanticLabel, bool disabled = false, Map<Type, GestureRecognizerFactory<GestureRecognizer>> gestures = const {}})
Creates a tab.

Properties

backgroundColor WidgetStateProperty<Color>?
The background color of the tab.
final
body Widget
The body of the view attached to this tab
final
closeIcon Widget?
The close icon of the tab.
final
disabled bool
Whether the tab is disabled or not.
final
foregroundColor WidgetStateProperty<Color>?
The foreground color of the tab.
final
gestures Map<Type, GestureRecognizerFactory<GestureRecognizer>>
The gestures that this widget will attempt to recognize.
final
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
the IconSource to be displayed within the tab.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onClosed VoidCallback?
Called when clicking x-to-close button or when the Ctrl + T or Ctrl + F4 is executed
final
outlineColor WidgetStateProperty<Color>?
The outline color of the tab.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedBackgroundColor WidgetStateProperty<Color>?
The background color of the tab if it is selected.
final
selectedForegroundColor WidgetStateProperty<Color>?
The background color of the tab if it is selected.
final
semanticLabel String?
Semantic label for the input.
final
text Widget
The content that appears inside the tab strip to represent the tab.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<Tab>
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.
override
getProperty<T>([dynamic def]) → T?

Available on Widget, provided by the ItemExtension extension

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