DefaultTabController class
Provides a TabController to descendant widgets via inheritance.
Wrap a TabBar and TabBarView pair in a DefaultTabController so they share the same controller without passing it manually.
- Inheritance
-
- Object
- Widget
- InheritedWidget
- DefaultTabController
Constructors
- DefaultTabController({Key? key, required TabController controller, required Widget child})
-
Creates a DefaultTabController that provides
controllerto descendants.const
Properties
- child → Widget
-
The widget below this inherited widget in the tree.
finalinherited
- controller → TabController
-
The TabController provided to descendant widgets.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → InheritedElement -
Creates the Element for this widget.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateShouldNotify(
covariant DefaultTabController oldWidget) → bool -
Whether the widgets that depend on this widget should be rebuilt when
oldWidgetis replaced by this widget.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → TabController? - Retrieves the nearest TabController from the widget tree.