Skip to content

Commit 2c88ccd

Browse files
committed
Update document for SearchDataSource.
1 parent f411a04 commit 2c88ccd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/search_data_source.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ class _StaticSearchResponse {
9595
{this.assetPath, this.searchType, this.searchResponseJsonString});
9696
}
9797

98+
/// A fake search data source, that reads data from flutter assests.
99+
///
100+
/// Choose to do the caching in this class, rather than in the
101+
/// [SearchDelegate.showResults]. Because this is controllable by developer,
102+
/// we don't know if the implementation detail about [SearchDelegate] will
103+
/// change or not.
98104
class FakeSearchDataSource implements SearchDataSource {
99105
final Map<String, _StaticSearchResponse> searchResponses = {
100106
'web': _StaticSearchResponse(
@@ -301,6 +307,11 @@ class SearchQuery {
301307
}
302308

303309
/// The search data source that uses Custom Search API.
310+
///
311+
// Choose to do the caching in this class, rather than in the
312+
// [SearchDelegate.showResults]. Because this is controllable by developer,
313+
// we don't know if the implementation detail about [SearchDelegate] will
314+
// change or not.
304315
class CustomSearchDataSource implements SearchDataSource {
305316
final String cx;
306317
final String apiKey;

0 commit comments

Comments
 (0)