guojiex / flutter_app_cse Goto Github PK
View Code? Open in Web Editor NEWA flutter demo, that uses google custom search api as backend
A flutter demo, that uses google custom search api as backend
What is the current mechanism to add or modify API Key ?
Related document about how to get refinement results:
https://developers.google.com/custom-search/docs/xml_results#results_xml_tag_label
Both 'nextPage' and 'previousPage' are provided by json response. We can use these two fields to decided and load pages.
So that we can add additional things, like refinement, 'find more on google', before the result gridview or listview.
Currently the font size is the same for pixel and pixel tablet, which is really small for tablet.
Should use this:
https://pub.dartlang.org/packages/flutter_screenutil
Currently CSE image search will return different results for the same page, if there are different resolution images from that page. We should not show duplicate images.
Consider to use https://docs.flutter.io/flutter/package-async_async/AsyncMemoizer-class.html ?
This is also the solution(for us) to flutter/flutter#26759
Now each time I do a search, CSE json api is called twice.
The image link from API response could be 500. Find a way to filter it.
And put all the result cards in side.
{
"kind": "customsearch#search",
"url": {
"type": "application/json",
"template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json"
},
"queries": {
"request": [
{
"title": "Google Custom Search - asdjfkhasdjfhasdjfhaj",
"totalResults": "0",
"searchTerms": "asdjfkhasdjfhasdjfhaj",
"count": 10,
"inputEncoding": "utf8",
"outputEncoding": "utf8",
"safe": "off",
"cx": "013098254965507895640:zjg6lv-gsvg"
}
]
},
"searchInformation": {
"searchTime": 0.258838,
"formattedSearchTime": "0.26",
"totalResults": "0",
"formattedTotalResults": "0"
},
"spelling": {
"correctedQuery": "asdjf khasdjfh asdjf haj",
"htmlCorrectedQuery": "\u003cb\u003e\u003ci\u003easdjf khasdjfh asdjf haj\u003c/i\u003e\u003c/b\u003e"
}
}
To bypass nextPage/previousPage button.
Since we are using SearchDelegate, and SearchDelegate doesn't provide next page render trigger, I have to use infinite scroll like view to workaround.
htmlTitle and htmlSnippet are provided by Custom Search JSON API. but now we just use the plain text returned.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.