CustomSinglePicker<T> constructor
const
CustomSinglePicker<T> ({
- required void onChanged(
- PickerItem<
T> ?
- PickerItem<
- required dynamic value,
- required BuildContext context,
- Key? key,
- Widget? leading,
- Widget? subtitle,
- String? subtitleText,
- Widget? trailing,
- bool? isRequired,
- String? trailingText,
- String? additionalInfoText,
- Widget? additionalInfo,
- ValueNotifier<
List< ? notifierOptions,PickerItem< >T> > - List<
PickerItem< ? options,T> > - Widget? title,
- String? titleText,
- BoxConstraints? constraints,
- double? height,
- EdgeInsets? margin,
- EdgeInsets? padding,
- bool filterable = false,
- void onTapListTile()?,
- Future<
void> ? onRequest()?, - void onSelected()?,
- bool isScrollControlled = true,
SinglePicker 单选选择器组件
Implementation
const CustomSinglePicker({
required this.onChanged,
required this.value,
required this.context,
super.key,
this.leading,
this.subtitle,
this.subtitleText,
this.trailing,
this.isRequired,
this.trailingText,
this.additionalInfoText,
this.additionalInfo,
this.notifierOptions,
this.options,
this.title,
this.titleText,
this.constraints,
this.height,
this.margin,
this.padding,
this.filterable = false,
this.onTapListTile,
this.onRequest,
this.onSelected,
this.isScrollControlled = true,
}) : assert((title != null) != (titleText != null), '必须设置 title 或 titleText 其中一个参数'),
assert(options != null || notifierOptions != null, '必须设置 options 或 notifierOptions 其中一个参数'),
assert(!(subtitle != null && subtitleText != null), '不能同时设置 subtitle 和 subtitleText'),
assert(!(options != null && onRequest != null), '不能同时设置 options 和 onRequest');