TextSearchResponse.fromJson constructor

TextSearchResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory TextSearchResponse.fromJson(Map<String, dynamic> json) {
  return TextSearchResponse(
    status: json['status'],
    htmlAttributions: json['html_attributions'] != null
        ? (json['html_attributions'] as List<dynamic>).cast<String>()
        : null,
    nextPageToken: json['next_page_token'],
    debugLog: json['debug_log'] != null
        ? DebugLog.fromJson(json['debug_log'])
        : null,
    results: json['results'] != null
        ? json['results']
            .map<SearchResult>((json) => SearchResult.fromJson(json))
            .toList()
        : null,
  );
}