VuTabScope class

Instruments a TabController-driven tab surface.

Wrap whatever subtree owns the tabs — the TabBar, the TabBarView, or the Scaffold holding both. Because it listens to the controller rather than intercepting onTap, it captures swipe-driven TabBarView changes as well as taps.

VuTabScope(
  controller: _tabs,
  tabNames: const ['Taps', 'Values', 'Gestures'],
  child: TabBarView(controller: _tabs, children: [...]),
)

Each change emits a ui.navigation span with navigation.transition.type = tab_switch, and screen.name becomes Page>Tab so HTTP, error and jank spans bucket by the visible tab.

Takes the real widget as child rather than mirroring TabBar's constructor, so it stays correct across Flutter releases and works with any tab surface.

Set foldIntoScreenName to false when each destination is already a distinct nested route, exactly as on VuIndexScope.

Inheritance

Constructors

VuTabScope({Key? key, required TabController controller, required Widget child, List<String>? tabNames, String? group, bool foldIntoScreenName = true})
const

Properties

child Widget
final
controller TabController
The controller whose selection is reported. Not owned or disposed here.
final
foldIntoScreenName bool
Whether to append the selected label to screen.name. Disable for shells whose per-destination routes already name the screen; tab_switch spans and their navigation.tab.* attributes are unaffected.
final
group String?
Distinguishes this surface when a screen has more than one — e.g. a TabBar and a bottom nav on the same page.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tabNames List<String>?
Labels per tab index. Falls back to tab_0, tab_1, … when omitted.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<VuTabScope>
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