decodeTextOverflow static method
Decodes the value
to a TextOverflow. Supported values are:
clip
ellipsis
fade
visible
Implementation
static TextOverflow? decodeTextOverflow(
dynamic value, {
bool validate = true,
}) {
TextOverflow? result;
if (value is TextOverflow) {
result = value;
} else {
_checkSupported(
'TextOverflow',
[
'clip',
'ellipsis',
'fade',
'visible',
],
value,
);
if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/text_overflow',
value: value,
validate: validate,
));
switch (value) {
case 'clip':
result = TextOverflow.clip;
break;
case 'ellipsis':
result = TextOverflow.ellipsis;
break;
case 'fade':
result = TextOverflow.fade;
break;
case 'visible':
result = TextOverflow.visible;
break;
}
}
}
return result;
}