QueryExtensionRequest.fromJson constructor

QueryExtensionRequest.fromJson(
  1. Object? j
)

Implementation

factory QueryExtensionRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return QueryExtensionRequest(
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    contents: switch (json['contents']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Content.fromJson(i)],
      _ => throw const FormatException('"contents" is not a list'),
    },
  );
}