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,
  7. Icon newTabIcon = const Icon(FluentIcons.add),
  8. Widget addIconBuilder(
    1. Widget addIcon
    )?,
  9. bool shortcutsEnabled = true,
  10. ReorderCallback? onReorder,
  11. bool showScrollButtons = true,
  12. ScrollPosController? scrollController,
  13. double minTabWidth = _kMinTileWidth,
  14. double maxTabWidth = _kMaxTileWidth,
  15. CloseButtonVisibilityMode closeButtonVisibility = CloseButtonVisibilityMode.always,
  16. TabWidthBehavior tabWidthBehavior = TabWidthBehavior.equal,
  17. Widget? header,
  18. Widget? footer,
  19. double? reservedStripWidth,
  20. Widget stripBuilder(
    1. BuildContext context,
    2. Widget strip
    )?,
  21. Duration closeDelayDuration = const Duration(seconds: 1),
})

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,
  this.newTabIcon = const Icon(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.reservedStripWidth,
  this.stripBuilder,
  this.closeDelayDuration = const Duration(seconds: 1),
});