showMultiPicker<K, R> static method
void
showMultiPicker<K, R>({
- required BuildContext context,
- required List<
K> ? value, - required void onConfirm(),
- bool isDismissible = true,
- bool enableDrag = true,
- BoxConstraints? constraints,
- Widget? title,
- String? titleText,
- double? height,
- List<
PickerItem< ? options,R> > - bool filterable = false,
- ValueNotifier<
List< ? notifierOptions,PickerItem< >R> >
显示多选选择器
Implementation
static void showMultiPicker<K, R>({
required BuildContext context,
required List<K>? value,
required void Function(List<K>, List<R>) onConfirm,
bool isDismissible = true,
bool enableDrag = true,
BoxConstraints? constraints,
// -------------------------------------------------------------------- > Custom
Widget? title,
String? titleText,
double? height,
List<PickerItem<R>>? options,
bool filterable = false,
ValueNotifier<List<PickerItem<R>>>? notifierOptions,
}) {
CustomBottomSheet.showDefault(
context: context,
isDismissible: isDismissible,
constraints: constraints ?? const BoxConstraints(),
builder: (BuildContext context) {
return SizedBox(
height: height ?? context.height * ConfigStore.to.config.app.bottomSheetHeight,
child: notifierOptions != null
? ValueListenableBuilder<List<PickerItem<R>>>(
valueListenable: notifierOptions,
builder: (BuildContext context, List<PickerItem<R>> data, Widget? widget) {
return InternalMultiPicker<K, R>(
value: value,
options: data,
onConfirm: onConfirm,
title: title,
titleText: titleText,
filterable: filterable,
);
},
)
: InternalMultiPicker<K, R>(
value: value,
options: options ?? [],
onConfirm: onConfirm,
title: title,
titleText: titleText,
filterable: filterable,
),
);
},
);
}