TcsCustomSelectionDialog constructor
const
TcsCustomSelectionDialog({
- Key? key,
- String? title = "請選擇",
- String? buttonText = "取消",
- required List<
CustomSelectionDialogOptionItem> items, - dynamic onItemSelected(
- CustomSelectionDialogOptionItem selectedItem
- int? initialSelectedIndex,
- int itemCountThreshold = 6,
- int scrollOffsetThreshold = 3,
彈跳視窗:選擇視窗樣式
說明:
- initialSelectedIndex => 上次選中的項目索引,會加上底色
- itemCountThreshold(6) => 項目數量閾值
- 這個變數用來設定當項目
items數量少於等於這個值時,不需要滾動。- ex:設定為 6,表示當項目數量少於等於 6 時,不執行滾動。
- 這個變數用來設定當項目
- scrollOffsetThreshold(3) => 滾動距離閾值
- 這個變數用來設定滾動的距離閾值,超過這個值才會進行滾動。
- ex:設定為 3,表示滾動的距離閾值為 3 個項目的高度。
- 這個變數用來設定滾動的距離閾值,超過這個值才會進行滾動。
Implementation
const TcsCustomSelectionDialog({
super.key,
this.title = "請選擇",
this.buttonText = "取消",
required this.items,
this.onItemSelected,
this.initialSelectedIndex,
this.itemCountThreshold = 6,
this.scrollOffsetThreshold = 3,
});