fromDynamic static method

HideWidgetStep fromDynamic(
  1. dynamic map
)

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

{
  "hide": <bool>,
  "testableId": <String>,
  "timeout": <number>
}

See also:

  • JsonClass.parseDurationFromSeconds

Implementation

static HideWidgetStep fromDynamic(dynamic map) {
  HideWidgetStep result;

  if (map == null) {
    throw Exception('[HideWidgetStep.fromDynamic]: map is null');
  } else {
    result = HideWidgetStep(
      hide: map['hide'] == null ? true : JsonClass.parseBool(map['hide']),
      testableId: map['testableId'],
      timeout: JsonClass.parseDurationFromSeconds(map['timeout']),
    );
  }

  return result;
}