File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+
3+ class NoResultCard extends StatelessWidget {
4+ @override
5+ Widget build (BuildContext context) {
6+ return new ListTile (
7+ title: new Text ('No Result.' ),
8+ );
9+ }
10+ }
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ import "package:googleapis_auth/auth_io.dart" as auth;
99import 'package:googleapis/customsearch/v1.dart' as customsearch;
1010import 'package:english_words/english_words.dart' ;
1111
12- import 'shared_constant.dart' ;
13-
1412/// A wrapper class for [customsearch.Result] .
1513/// [SearchResult] will use the landing page link to measure if two results are
1614/// the same. This is useful for deduplicating image search result.
@@ -68,6 +66,8 @@ class NextPage {
6866}
6967
7068/// A wrapper class to aggregate all the search result fields that we need.
69+ ///
70+ /// And deduplicate results.
7171class SearchResults {
7272 List <SearchResult > searchResults = List <SearchResult >();
7373 List <Promotion > promotions = List <Promotion >();
@@ -78,6 +78,7 @@ class SearchResults {
7878 var results = new List <SearchResult >();
7979 search.items.forEach ((item) =>
8080 results.add (SearchResult .escapeLineBreakInSnippet (item)));
81+ // Deduplicate search result.
8182 this .searchResults = Set <SearchResult >.from (results).toList ();
8283 }
8384}
You can’t perform that action at this time.
0 commit comments