showSingleMultipleChoiceSelector static method

dynamic showSingleMultipleChoiceSelector(
  1. BuildContext context, {
  2. required List<SelectorItem> list,
  3. double? height,
  4. double? radius,
  5. double? itemExtent,
  6. double? padding,
  7. double? textSize,
  8. String? textLeft,
  9. String? textRight,
  10. Color? textColor,
  11. Color? textColorLeft,
  12. Color? textColorRight,
  13. Color? lineColor,
  14. Color? backgroundColor,
  15. double iconWidth = 24,
  16. Color selectColor = const Color(0xFFFF8000),
  17. Color unSelectedColor = const Color(0xFF999999),
  18. String iconAssetName = '',
  19. required dynamic callBack(
    1. List<SelectorItem> selectorItems
    ),
  20. GestureTapCallback? onTapLeft,
  21. GestureTapCallback? onTapRight,
})

显示单个选择器(支持多选)

Implementation

static showSingleMultipleChoiceSelector(BuildContext context,
    {required List<SelectorItem> list,
    double? height,
    double? radius,
    double? itemExtent,
    double? padding,
    double? textSize,
    String? textLeft,
    String? textRight,
    Color? textColor,
    Color? textColorLeft,
    Color? textColorRight,
    Color? lineColor,
    Color? backgroundColor,
    double iconWidth = 24,
    Color selectColor = const Color(0xFFFF8000),
    Color unSelectedColor = const Color(0xFF999999),
    String iconAssetName = '',
    required Function(List<SelectorItem> selectorItems) callBack,
    GestureTapCallback? onTapLeft,
    GestureTapCallback? onTapRight}) {
  showModalBottomSheet(
      context: context,
      isScrollControlled: false,
      backgroundColor: Colors.transparent,
      shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
        topLeft: Radius.circular(radius ?? _radius),
        topRight: Radius.circular(radius ?? _radius),
      )),
      builder: (BuildContext context) {
        return SelectorMultipleChoiceWidget(
            list: list,
            height: height ?? _height,
            radius: radius ?? _radius,
            itemExtent: itemExtent ?? _itemExtent,
            padding: padding ?? _padding,
            textSize: textSize ?? _textSize,
            textLeft: textLeft ?? _textLeft,
            textRight: textRight ?? _textRight,
            textColor: textColor ?? _textColor,
            textColorLeft: textColorLeft ?? _textColorLeft,
            textColorRight: textColorRight ?? _textColorRight,
            lineColor: lineColor ?? _lineColor,
            backgroundColor: backgroundColor ?? _backgroundColor,
            selectColor: selectColor,
            unSelectedColor: unSelectedColor,
            iconWidth: iconWidth,
            iconAssetName: iconAssetName,
            callBack: callBack,
            onTapLeft: onTapLeft,
            onTapRight: onTapRight);
      });
}