showSingleSelector static method
dynamic
showSingleSelector(
- 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,
- int position = 0,
- double? diameterRatio,
- double? offAxisFraction,
- double? magnification,
- double? squeeze,
- Widget? selectionOverlay,
- required dynamic callBack(
- SelectorItem item,
- int position
- GestureTapCallback? onTapLeft,
- GestureTapCallback? onTapRight,
显示单个选择器
Implementation
static showSingleSelector(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,
int position = 0,
double? diameterRatio,
double? offAxisFraction,
double? magnification,
double? squeeze,
Widget? selectionOverlay,
required Function(SelectorItem item, int position) 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 SelectorSingleWidget(
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,
position: position,
diameterRatio: _diameterRatio ?? diameterRatio,
offAxisFraction: _offAxisFraction ?? offAxisFraction,
magnification: _magnification ?? magnification,
squeeze: _squeeze ?? squeeze,
selectionOverlay: selectionOverlay,
callBack: callBack,
onTapLeft: onTapLeft,
onTapRight: onTapRight);
});
}