showBottomSelector static method

dynamic showBottomSelector(
  1. BuildContext context, {
  2. String? title,
  3. required List<HbSelectItemModel> items,
  4. bool showIcon = true,
  5. bool showDescription = true,
  6. required HbRadioController controller,
  7. ValueChanged<int>? onSelected,
})

弹出底部选择弹窗

Implementation

static showBottomSelector(
  BuildContext context, {
  String? title, // title
  required List<HbSelectItemModel> items, // 下拉选项
  bool showIcon = true, // 是否显示图标
  bool showDescription = true, // 是否显示描述
  required HbRadioController controller, // 初始选中项下标与selectItem
  // 选项发生变化
  ValueChanged<int>? onSelected, //选项发生变化
}) {
  showModalBottomSheet(
    context: context,
    clipBehavior: Clip.hardEdge,
    isScrollControlled: true,
    constraints: BoxConstraints(maxHeight: 620.w),
    backgroundColor: Colors.transparent,
    builder: (context) {
      return _SelectDialog(
        title: title,
        items: items,
        showIcon: showIcon,
        showDescription: showDescription,
        controller: controller,
        onSelected: onSelected,
      );
    },
  );
}