FTabs constructor

FTabs({
  1. required List<FTabEntry> tabs,
  2. int initialIndex = 0,
  3. bool scrollable = false,
  4. FTabController? controller,
  5. FTabsStyle? style,
  6. ValueChanged<int>? onPress,
  7. Key? key,
})

Creates a FTabs.

Throws

Implementation

FTabs({
  required this.tabs,
  this.initialIndex = 0,
  this.scrollable = false,
  this.controller,
  this.style,
  this.onPress,
  super.key,
})  : assert(tabs.isNotEmpty, 'Must have at least 1 tab provided.'),
      assert(0 <= initialIndex && initialIndex < tabs.length, 'Initial index must be within the range of tabs.'),
      assert(
        controller == null || controller.index == initialIndex,
        'Controller index must match the initial index.',
      ),
      assert(
        controller == null || controller.length == tabs.length,
        'Controller length must match the number of tabs.',
      );