decodeTypography static method
Decodes the given value
to a Typography. This expects the value
to
have the following structure:
{
"black": <TextTheme>,
"dense": <TextTheme>,
"englishLike": <TextTheme>,
"platform": <TargetPlatform>,
"tall": <TextTheme>,
"white": <TextTheme>,
}
See also:
Implementation
static Typography? decodeTypography(
dynamic value, {
bool validate = true,
}) {
Typography? result;
if (value is Typography) {
result = value;
} else if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/typography',
value: value,
validate: validate,
));
result = Typography.material2018(
black: decodeTextTheme(
value['black'],
validate: false,
),
dense: decodeTextTheme(
value['dense'],
validate: false,
),
englishLike: decodeTextTheme(
value['englishLike'],
validate: false,
),
platform: decodeTargetPlatform(
value['platform'],
validate: false,
),
tall: decodeTextTheme(
value['tall'],
validate: false,
),
white: decodeTextTheme(
value['white'],
validate: false,
),
);
}
return result;
}