MacosTabController constructor

MacosTabController({
  1. int initialIndex = 0,
  2. required int length,
})

Coordinates tab selection for MacosSegmentedControl and MacosTabView.

The index property is the index of the selected tab.

A stateful widget that builds a MacosSegmentedControl and a MacosTabView can create a MacosTabController and share it between them.

Implementation

MacosTabController({
  int initialIndex = 0,
  required this.length,
})  : assert(length >= 0),
      assert(initialIndex >= 0 && (length == 0 || initialIndex < length)),
      _index = initialIndex,
      _previousIndex = initialIndex;