FlutterSetWidgetPropertyValueParams.fromJson constructor

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

Implementation

factory FlutterSetWidgetPropertyValueParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    int id;
    if (json.containsKey('id')) {
      id = jsonDecoder.decodeInt('$jsonPath.id', json['id']);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'id');
    }
    FlutterWidgetPropertyValue? value;
    if (json.containsKey('value')) {
      value = FlutterWidgetPropertyValue.fromJson(
          jsonDecoder, '$jsonPath.value', json['value']);
    }
    return FlutterSetWidgetPropertyValueParams(id, value: value);
  } else {
    throw jsonDecoder.mismatch(
        jsonPath, 'flutter.setWidgetPropertyValue params', json);
  }
}