Skip to content

Commit 68d9890

Browse files
committed
Update docs.
1 parent af6be48 commit 68d9890

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/component/no_result_card.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
}

lib/search_data_source.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import "package:googleapis_auth/auth_io.dart" as auth;
99
import 'package:googleapis/customsearch/v1.dart' as customsearch;
1010
import '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.
7171
class 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
}

0 commit comments

Comments
 (0)