decodeMaterialBannerThemeData static method
Decodes the given value
to an MaterialBannerThemeData. This expects the
given value
to be of the following structure:
{
"backgroundColor": <Color>,
"contentTextStyle": <TextStyle>,
"elevation": <double>,
"leadingPadding": <EdgeInsetsGeometry>,
"padding": <EdgeInsetsGeometry>
}
See also:
Implementation
static MaterialBannerThemeData? decodeMaterialBannerThemeData(
dynamic value, {
bool validate = true,
}) {
MaterialBannerThemeData? result;
if (value is MaterialBannerThemeData) {
result = value;
} else if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/material_banner_theme_data',
value: value,
validate: validate,
));
result = MaterialBannerThemeData(
backgroundColor: decodeColor(
value['backgroundColor'],
validate: false,
),
contentTextStyle: decodeTextStyle(
value['contentTextStyle'],
validate: false,
),
elevation: JsonClass.parseDouble(value['elevation']),
leadingPadding: decodeEdgeInsetsGeometry(
value['leadingPadding'],
validate: false,
),
padding: decodeEdgeInsetsGeometry(
value['padding'],
validate: false,
),
);
}
return result;
}