FTabs constructor

FTabs({
  1. required List<FTabEntry> children,
  2. bool scrollable = false,
  3. ScrollPhysics? physics,
  4. FTabController? controller,
  5. FTabsStyle style(
    1. FTabsStyle
    )?,
  6. ValueChanged<int>? onChange,
  7. ValueChanged<int>? onPress,
  8. int initialIndex = 0,
  9. 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 the initialIndex.

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}).",
     );