FTabs constructor
FTabs({
- required List<
FTabEntry> children, - bool scrollable = false,
- ScrollPhysics? physics,
- FTabController? controller,
- FTabsStyle style()?,
- ValueChanged<
int> ? onChange, - ValueChanged<
int> ? onPress, - int initialIndex = 0,
- Key? key,
Creates a FTabs.
Contract
Throws AssertionError if:
children
is empty.initialIndex
is not within the range '0 <= initialIndex < tabs.length`.controller
index does not match theinitialIndex
.
Implementation
FTabs({
required this.children,
this.scrollable = false,
this.physics,
this.controller,
this.style,
this.onChange,
this.onPress,
this.initialIndex = 0,
super.key,
}) : assert(children.isNotEmpty, 'Must provide at least 1 tab.'),
assert(
0 <= initialIndex && initialIndex < children.length,
'initialIndex ($initialIndex) must be between 0 and the number of children (${children.length})',
),
assert(
controller == null || initialIndex == 0,
'Cannot provide both controller and initialIndex. To fix, set the initialIndex on the controller.',
),
assert(
controller == null || controller.length == children.length,
"Controller's number of tabs (${controller.length} must match the number of children (${children.length}).",
);