decodeProgressIndicatorThemeData static method

ProgressIndicatorThemeData? decodeProgressIndicatorThemeData(
  1. dynamic value, {
  2. bool validate = true,
})

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

{
  "circularTrackColor": "<Color>",
  "color": "<Color>",
  "linearMinHeight": "<double>",
  "linearTrackColor": "<Color>",
  "refreshBackgroundColor": "<Color>"
}

See also:

Implementation

static ProgressIndicatorThemeData? decodeProgressIndicatorThemeData(
  dynamic value, {
  bool validate = true,
}) {
  ProgressIndicatorThemeData? result;

  if (value is ProgressIndicatorThemeData) {
    result = value;
  } else if (value != null) {
    assert(SchemaValidator.validate(
      schemaId: '$_baseSchemaUrl/progress_indicator_theme_data',
      value: value,
      validate: validate,
    ));

    result = ProgressIndicatorThemeData(
      circularTrackColor: decodeColor(
        value['circularTrackColor'],
        validate: false,
      ),
      color: decodeColor(
        value['color'],
        validate: false,
      ),
      linearMinHeight: JsonClass.maybeParseDouble(value['linearMinHeight']),
      linearTrackColor: decodeColor(
        value['linearTrackColor'],
        validate: false,
      ),
      refreshBackgroundColor: decodeColor(
        value['refreshBackgroundColor'],
        validate: false,
      ),
    );
  }

  return result;
}