CustomSinglePicker<T> constructor

const CustomSinglePicker<T>({
  1. required void onChanged(
    1. PickerItem<T>?
    ),
  2. required dynamic value,
  3. required BuildContext context,
  4. Key? key,
  5. Widget? leading,
  6. Widget? subtitle,
  7. String? subtitleText,
  8. Widget? trailing,
  9. bool? isRequired,
  10. String? trailingText,
  11. String? additionalInfoText,
  12. Widget? additionalInfo,
  13. ValueNotifier<List<PickerItem<T>>>? notifierOptions,
  14. List<PickerItem<T>>? options,
  15. Widget? title,
  16. String? titleText,
  17. BoxConstraints? constraints,
  18. double? height,
  19. EdgeInsets? margin,
  20. EdgeInsets? padding,
  21. bool filterable = false,
  22. void onTapListTile()?,
  23. Future<void>? onRequest()?,
  24. void onSelected()?,
  25. 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');