fromDynamic static method

ObscureWidgetStep fromDynamic(
  1. dynamic map
)

Creates an instance from a JSON-like map structure. This expects the following format:

{
  "color": <String>,
  "testableId": <String>,
  "timeout": <number>
}

See also:

  • JsonClass.parseDurationFromSeconds
  • ThemeDecoder.decodeColor

Implementation

static ObscureWidgetStep fromDynamic(dynamic map) {
  ObscureWidgetStep result;

  if (map == null) {
    throw Exception('[ObscureWidgetStep.fromDynamic]: map is null');
  } else {
    result = ObscureWidgetStep(
      color: ThemeDecoder.decodeColor(map['color']),
      testableId: map['testableId'],
      timeout: JsonClass.parseDurationFromSeconds(map['timeout']),
    );
  }

  return result;
}