decodeFloatingLabelBehavior static method
Decodes the value
to a FloatingLabelBehavior. Supported values are:
always
auto
never
Implementation
static FloatingLabelBehavior? decodeFloatingLabelBehavior(
dynamic value, {
bool validate = true,
}) {
FloatingLabelBehavior? result;
if (value is FloatingLabelBehavior) {
result = value;
} else {
_checkSupported(
'FloatingLabelBehavior',
[
'always',
'auto',
'never',
],
value,
);
if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/floating_label_behavior',
value: value,
validate: validate,
));
switch (value) {
case 'always':
result = FloatingLabelBehavior.always;
break;
case 'auto':
result = FloatingLabelBehavior.auto;
break;
case 'never':
result = FloatingLabelBehavior.never;
break;
}
}
}
return result;
}