Select<T, P> constructor
const
Select<T, P> ({
- required List<
SelectOption< options,T, P> > - bool? isRequired,
- String? inputLabel,
- String? inputHint,
- T? value,
- String? hint,
- required void onChange(
- T? value
- bool withNotSelectedOption = false,
- bool showNotSelectedOption = false,
- String notSelectedOptionText = "",
- String? error,
- bool isDisabled = false,
- EdgeInsetsGeometry? inputPadding,
- String? dialogLabel,
- BoxDecoration? inputDecoration,
- Color? backgroundColor,
- Future<
void> showOverlay(- BuildContext context,
- Widget dialogContent
- SelectInputBuilder<
T, P> ? inputBuilder, - SelectBackdropBuilder? backdropBuilder,
- Widget optionBuilder(
- BuildContext context,
- SelectOption<
T, P> option
- Widget valueBuilder(
- BuildContext context,
- SelectOption<
T, P> ? option, - bool isDisabled
- Key? key,
Implementation
const Select({
required this.options,
this.isRequired,
this.inputLabel,
this.inputHint,
this.value,
this.hint,
required this.onChange,
this.withNotSelectedOption = false,
this.showNotSelectedOption = false,
this.notSelectedOptionText = "",
this.error,
this.isDisabled = false,
this.inputPadding,
this.dialogLabel,
this.inputDecoration,
this.backgroundColor,
this.showOverlay,
this.inputBuilder,
this.backdropBuilder,
Widget Function(BuildContext context, SelectOption<T, P> option)? optionBuilder,
Widget Function(
BuildContext context,
SelectOption<T, P>? option,
bool isDisabled,
)?
valueBuilder,
super.key,
}) : optionBuilder = optionBuilder ?? _defaultOptionBuilder<T, P>,
valueBuilder = valueBuilder ?? _defaultValueBuilder<T, P>,
assert(
!showNotSelectedOption || notSelectedOptionText != "",
"notSelectedOptionText must be set if showNotSelectedOption is true",
);