Created
June 12, 2019 10:35
-
-
Save ShivamGoyal1899/4cfc0bc3e3583ec8db59d8c9acd7778a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<Album> createAlbum(CreateAlbumRequest request) async { | |
return http | |
.post( | |
'https://photoslibrary.googleapis.com/v1/albums', | |
body: jsonEncode(request), | |
headers: await _authHeaders, | |
) | |
.then( | |
(Response response) { | |
if (response.statusCode != 200) { | |
print(response.reasonPhrase); | |
print(response.body); | |
} | |
return Album.fromJson(jsonDecode(response.body)); | |
}, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment