ofProperty static method
Implementation
static OptionsHandler<String> ofProperty(
IMSchemaProperty prop, {
String placeholder = "Enter an option",
List<String>? allOptions,
required bool allowAdHoc,
}) {
if (prop is IStringSelectProperty) {
allOptions ??= prop.options;
}
allOptions ??= [];
return _OptionsHandler<String>(prop.baseCode,
allOptions: allOptions,
placeholder: placeholder,
canShowAll: true,
adhocOptionsBuilder: allowAdHoc == true
? ((item, {context}) => AdhocOption.ofString("$item"))
: null,
toOption: ((String? from) => Option.ofValue(from)));
}