t×tecexpressby TeKOcloud
DEv0.7.1
Navigation & feedback / FLUTTER

TxTabs.

Interactive preview

Tab navigation with optional content for the active tab.

TxTabs

ParameterTypeDefaultMeaning
itemsList<TxMenuItem>const []Entries; replaced by dataSource when bound.
dataSourceObject?nullList, configuration or DataSource instance; takes precedence over items.
selectedIndexint?nullZero-based active entry.
initialIndexint0Initial tab in uncontrolled mode.
onChangedValueChanged<int>?nullCallback for changed; see the signature for arguments and return type.
builderWidget Function(BuildContext context, int selectedIndex)?nullBuilds custom content; callback arguments and return type are given in the signature.
disabledboolfalseDisables interaction.
labelString'Reiter'Label or accessible name.
orientationAxisAxis.horizontalTab orientation.
swipeEnabledboolfalseAllows switching tabs by swiping.
animationEnabledbooltrueEnables content transitions.
dart
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';

Widget example() {

  return TxTabs(items: const [TxMenuItem('Home'), TxMenuItem('Settings')], builder: (context, index) => Text('Page $index'));
}