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']),
      color: decodeColor(value['color']),
      linearMinHeight: JsonClass.parseDouble(value['linearMinHeight']),
      linearTrackColor: decodeColor(value['linearTrackColor']),
      refreshBackgroundColor: decodeColor(value['refreshBackgroundColor']),
    );
  }

  return result;
}