decodeFloatingActionButtonThemeData static method
FloatingActionButtonThemeData?
decodeFloatingActionButtonThemeData(
- dynamic value, {
- bool validate = true,
Decodes the given value
to an FloatingActionButtonThemeData. This
expects the given value
to follow the structure below:
{
"backgroundColor": <Color>,
"disabledElevation": <double>,
"elevation": <double>,
"extendedIconLabelSpacing": <double>,
"extendedPadding": <EdgeInsetsGeometry>,
"extendedSizeConstraints": <BoxConstraints>,
"extendedTextStyle": <TextStyle>
"focusColor": <Color>,
"focusElevation": <double>,
"foregroundColor": <Color>,
"highlightElevation": <double>,
"hoverColor": <Color>,
"hoverElevation": <double>,
"largeSizeConstraints": <BoxConstraints>,
"shape": <ShapeBorder>,
"sizeConstraints": <BoxConstraints>,
"smallSizeConstraints": <BoxConstraints>,
"splashColor": <Color>
}
See also:
Implementation
static FloatingActionButtonThemeData? decodeFloatingActionButtonThemeData(
dynamic value, {
bool validate = true,
}) {
FloatingActionButtonThemeData? result;
if (value is FloatingActionButtonThemeData) {
result = value;
} else if (value != null) {
assert(SchemaValidator.validate(
schemaId: '$_baseSchemaUrl/floating_action_button_theme_data',
value: value,
validate: validate,
));
result = FloatingActionButtonThemeData(
backgroundColor: decodeColor(
value['backgroundColor'],
validate: false,
),
disabledElevation: JsonClass.parseDouble(value['disabledElevation']),
enableFeedback: value['enableFeedback'] == null
? null
: JsonClass.parseBool(value['enableFeedback']),
elevation: JsonClass.parseDouble(value['elevation']),
extendedIconLabelSpacing: JsonClass.parseDouble(
value['extendedIconLabelSpacing'],
),
extendedPadding: decodeEdgeInsetsGeometry(value['extendedPadding']),
extendedSizeConstraints: decodeBoxConstraints(
value['extendedSizeConstraints'],
),
extendedTextStyle: decodeTextStyle(value['extendedTextStyle']),
focusColor: decodeColor(
value['focusColor'],
validate: false,
),
focusElevation: JsonClass.parseDouble(value['focusElevation']),
foregroundColor: decodeColor(
value['foregroundColor'],
validate: false,
),
highlightElevation: JsonClass.parseDouble(value['highlightElevation']),
hoverColor: decodeColor(
value['hoverColor'],
validate: false,
),
hoverElevation: JsonClass.parseDouble(value['hoverElevation']),
largeSizeConstraints: decodeBoxConstraints(
value['largeSizeConstraints'],
),
shape: decodeShapeBorder(
value['shape'],
validate: false,
),
sizeConstraints: decodeBoxConstraints(
value['sizeConstraints'],
),
smallSizeConstraints: decodeBoxConstraints(
value['smallSizeConstraints'],
),
splashColor: decodeColor(
value['splashColor'],
validate: false,
),
);
}
return result;
}