SearchFeaturesResponse.fromJson constructor

SearchFeaturesResponse.fromJson(
  1. Object? j
)

Implementation

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