1
0
mirror of https://github.com/flutter/samples.git synced 2026-07-15 21:42:27 +00:00

Update desktop_photo_search to use url_launcher's Link (#780)

This commit is contained in:
Brett Morgan
2021-03-20 07:30:56 +11:00
committed by GitHub
parent 873ff4306b
commit 5cb6c39bd7
21 changed files with 456 additions and 525 deletions

View File

@@ -86,13 +86,13 @@ class Unsplash {
// https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download
_log.info('GET ${photo.urls.full}');
final futureBytes = http.readBytes(photo.urls.full, headers: {
final futureBytes = http.readBytes(Uri.parse(photo.urls.full), headers: {
'Accept-Version': 'v1',
'Authorization': 'Client-ID $_accessKey',
});
_log.info('GET ${photo.links.downloadLocation}');
unawaited(http.get(photo.links.downloadLocation, headers: {
unawaited(http.get(Uri.parse(photo.links.downloadLocation), headers: {
'Accept-Version': 'v1',
'Authorization': 'Client-ID $_accessKey',
}));