CLDropdown<T extends Object>.singleAsync constructor
CLDropdown<T extends Object>.singleAsync ({
- Key? key,
- required String hint,
- required Future<
(List< searchCallback({})?,T> , Object?)> - required dynamic searchColumn,
- required Widget itemBuilder(
- BuildContext,
- T
- required String valueToShow(
- T
- List<
FormFieldValidator< ? validators,String> > - bool isEnabled = true,
- int length = 10,
- T? selectedValues,
- required dynamic onSelectItem(
- T?
- dynamic onClearItem()?,
- Color? fillColor,
- bool isCompact = false,
Implementation
factory CLDropdown.singleAsync({
Key? key,
required String hint,
required Future<(List<T>, Object?)> Function(
{int? page,
int? perPage,
Map<String, dynamic>? searchBy,
Map<String, dynamic>? orderBy})?
searchCallback,
required searchColumn,
required Widget Function(BuildContext, T) itemBuilder,
required String Function(T) valueToShow,
final List<FormFieldValidator<String>>? validators,
final bool isEnabled = true,
int length = 10,
T? selectedValues,
required Function(T?)? onSelectItem,
Function()? onClearItem,
Color? fillColor,
bool isCompact = false,
}) {
List<T> previousvalueToShows = [];
if (selectedValues != null) {
previousvalueToShows.add(selectedValues);
}
return CLDropdown(
key: key,
itemBuilder: itemBuilder,
hint: hint,
isMultiple: false,
isEnabled: isEnabled,
valueToShow: valueToShow,
asyncSearchCallback: searchCallback,
searchColumn: searchColumn,
selectedValues: previousvalueToShows,
onSelectItem: onSelectItem,
validators: validators,
length: length,
onClearItem: onClearItem,
fillColor: fillColor,
isCompact: isCompact,
);
}