Select<T, P> constructor

const Select<T, P>({
  1. required List<SelectOption<T, P>> options,
  2. bool? isRequired,
  3. String? inputLabel,
  4. String? inputHint,
  5. T? value,
  6. String? hint,
  7. required void onChange(
    1. T? value
    ),
  8. bool withNotSelectedOption = false,
  9. bool showNotSelectedOption = false,
  10. String notSelectedOptionText = "",
  11. String? error,
  12. bool isDisabled = false,
  13. EdgeInsetsGeometry? inputPadding,
  14. String? dialogLabel,
  15. BoxDecoration? inputDecoration,
  16. Color? backgroundColor,
  17. Future<void> showOverlay(
    1. BuildContext context,
    2. Widget dialogContent
    )?,
  18. SelectInputBuilder<T, P>? inputBuilder,
  19. SelectBackdropBuilder? backdropBuilder,
  20. Widget optionBuilder(
    1. BuildContext context,
    2. SelectOption<T, P> option
    )?,
  21. Widget valueBuilder(
    1. BuildContext context,
    2. SelectOption<T, P>? option,
    3. bool isDisabled
    )?,
  22. 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",
     );