ExtractWidgetOptions.fromJson constructor

ExtractWidgetOptions.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json
)

Implementation

factory ExtractWidgetOptions.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    String name;
    if (json.containsKey('name')) {
      name = jsonDecoder.decodeString('$jsonPath.name', json['name']);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'name');
    }
    return ExtractWidgetOptions(name);
  } else {
    throw jsonDecoder.mismatch(jsonPath, 'extractWidget options', json);
  }
}