decodeSmartDashesType static method
Decodes a value
to a SmartDashesType. Supported values are:
disabled
enabled
Implementation
static SmartDashesType? decodeSmartDashesType(
dynamic value, {
bool validate = true,
}) {
SmartDashesType? result;
if (value is SmartDashesType) {
result = value;
} else {
_checkSupported(
'SmartDashesType',
[
'disabled',
'enabled',
],
value,
);
if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/smart_dashes_type',
value: value,
validate: validate,
));
switch (value) {
case 'disabled':
result = SmartDashesType.disabled;
break;
case 'enabled':
result = SmartDashesType.enabled;
break;
}
}
}
return result;
}