TabView constructor

const TabView({
  1. Key? key,
  2. required int currentIndex,
  3. ValueChanged<int>? onChanged,
  4. required List<Tab> tabs,
  5. VoidCallback? onNewPressed,
  6. IconData addIconData = FluentIcons.add,
  7. Widget addIconBuilder(
    1. Widget addIcon
    )?,
  8. bool shortcutsEnabled = true,
  9. ReorderCallback? onReorder,
  10. bool showScrollButtons = true,
  11. ScrollPosController? scrollController,
  12. double minTabWidth = _kMinTileWidth,
  13. double maxTabWidth = _kMaxTileWidth,
  14. CloseButtonVisibilityMode closeButtonVisibility = CloseButtonVisibilityMode.always,
  15. TabWidthBehavior tabWidthBehavior = TabWidthBehavior.equal,
  16. Widget? header,
  17. Widget? footer,
  18. Duration closeDelayDuration = const Duration(milliseconds: 400),
})

Creates a tab view.

tabs must have the same length as bodies

maxTabWidth must be non-negative

Implementation

const TabView({
  super.key,
  required this.currentIndex,
  this.onChanged,
  required this.tabs,
  this.onNewPressed,
  this.addIconData = FluentIcons.add,
  this.addIconBuilder,
  this.shortcutsEnabled = true,
  this.onReorder,
  this.showScrollButtons = true,
  this.scrollController,
  this.minTabWidth = _kMinTileWidth,
  this.maxTabWidth = _kMaxTileWidth,
  this.closeButtonVisibility = CloseButtonVisibilityMode.always,
  this.tabWidthBehavior = TabWidthBehavior.equal,
  this.header,
  this.footer,
  this.closeDelayDuration = const Duration(milliseconds: 400),
});