decodeFillPatternType static method
Expects the map
to be either a charts.FillPatternType
or a String
containing one of the following values:
forwardHatch
solid
Implementation
static charts.FillPatternType? decodeFillPatternType(
dynamic map, {
bool validate = true,
}) {
charts.FillPatternType? result;
if (map is charts.FillPatternType) {
result = map;
} else if (map != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/fill_pattern_type',
value: map,
validate: validate,
));
switch (map) {
case 'forwardHatch':
result = charts.FillPatternType.forwardHatch;
break;
case 'solid':
result = charts.FillPatternType.solid;
break;
default:
throw Exception('Unknown [FillPatternType] encountered: [$map]');
}
}
return result;
}