fromJson static method

ResultField fromJson(
  1. Map<String, Object?> json
)

Implementation

static ResultField fromJson(Map<String, Object?> json) => ResultField(
  json['name']! as String,
  json['type']! as String,
  optional: json['optional'] == true,
  doc: json['doc'] as String?,
  shape: switch (json['shape']) {
    Map<String, Object?> shape => ResultShape.fromJson(shape),
    Map<Object?, Object?> shape => ResultShape.fromJson(
      shape.cast<String, Object?>(),
    ),
    _ => null,
  },
);