decodeListTileThemeData static method
Decodes the given value
to an Locale. This expects the
given value
to be of the following structure:
{
"contentPadding": <EdgeInsetsGeometry>,
"dense": <bool>,
"enableFeedback": <bool>,
"horizontalTitleGap": <double>,
"iconColor": <Color>,
"minLeadingWidth": <double>,
"minVerticalPadding": <double>,
"selectedColor": <Color>,
"selectedTileColor": <Color>,
"shape": <ShapeBorder>,
"style": <ListTileStyle>,
"textColor": <Color>,
"tileColor": <Color>
}
Implementation
static ListTileThemeData? decodeListTileThemeData(
dynamic value, {
bool validate = true,
}) {
ListTileThemeData? result;
if (value is ListTileThemeData) {
result = value;
} else if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/list_tile_theme_data',
value: value,
validate: validate,
));
result = ListTileThemeData(
contentPadding: decodeEdgeInsetsGeometry(value['contentPadding']),
dense:
value['dense'] == null ? null : JsonClass.parseBool(value['dense']),
enableFeedback: value['enableFeedback'] == null
? null
: JsonClass.parseBool(value['enableFeedback']),
horizontalTitleGap: JsonClass.parseDouble(value['horizontalTitleGap']),
iconColor: decodeColor(value['iconColor']),
minLeadingWidth: JsonClass.parseDouble(value['minLeadingWidth']),
minVerticalPadding: JsonClass.parseDouble(value['minVerticalPadding']),
selectedColor: decodeColor(value['selectedColor']),
selectedTileColor: decodeColor(value['selectedTileColor']),
shape: decodeShapeBorder(value['shape']),
style: decodeListTileStyle(value['style']),
textColor: decodeColor(value['textColor']),
tileColor: decodeColor(value['tileColor']),
);
}
return result;
}