PlexFormField.dropDown constructor

PlexFormField.dropDown({
  1. required String title,
  2. required dynamic onChange(
    1. dynamic value
    ),
  3. bool editable = true,
  4. String itemAsString(
    1. dynamic item
    )?,
  5. List? items,
  6. Future<List>? itemsAsync,
  7. bool onSearch(
    1. String,
    2. dynamic
    )?,
  8. Widget dropdownWidget(
    1. dynamic
    )?,
  9. Widget dropdownLeadingWidget(
    1. dynamic
    )?,
  10. dynamic initialValue,
})

Implementation

PlexFormField.dropDown({
  required this.title,
  required this.onChange,
  this.editable = true,
  this.itemAsString,
  this.items,
  this.itemsAsync,
  this.onSearch,
  this.dropdownWidget,
  this.dropdownLeadingWidget,
  this.initialValue,
}) {
  if (items == null && itemsAsync == null) {
    throw Exception("Items must be initialized or async item function must be initialized");
  }
  itemAsString ??= (item) => item.toString();
  fieldType = TYPE_DROPDOWN;
}