decodeDividerThemeData static method

DividerThemeData? decodeDividerThemeData(
  1. dynamic value, {
  2. bool validate = true,
})

Decodes the given value to an DividerThemeData. This expects the given value to follow the structure below:

{
  "color": "<Color>",
  "endIndent": "<double>",
  "indent": "<double>",
  "space": "<double>",
  "thickness": "<double>"
}

See also:

Implementation

static DividerThemeData? decodeDividerThemeData(
  dynamic value, {
  bool validate = true,
}) {
  DividerThemeData? result;

  if (value is DividerThemeData) {
    result = value;
  } else if (value != null) {
    assert(SchemaValidator.validate(
      schemaId: '$_baseSchemaUrl/divider_theme_data',
      value: value,
      validate: validate,
    ));
    result = DividerThemeData(
      color: decodeColor(
        value['color'],
        validate: false,
      ),
      endIndent: JsonClass.maybeParseDouble(value['endIndent']),
      indent: JsonClass.maybeParseDouble(value['indent']),
      space: JsonClass.maybeParseDouble(value['space']),
      thickness: JsonClass.maybeParseDouble(value['thickness']),
    );
  }

  return result;
}