Last active
March 21, 2019 08:53
-
-
Save bapspatil/939cf3764d468e41e021a7600f13c35a to your computer and use it in GitHub Desktop.
API call to get quotes for Kut In.
This file contains hidden or 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<void> getQuote() async { | |
String baseUrl = 'http://api.kanye.rest/'; | |
try { | |
http.Response response = await http.get(baseUrl); | |
var myQuote = Quote.fromJson(jsonDecode(response.body)); | |
setState(() { | |
_quote = myQuote.quote; | |
_gradientColors.shuffle(_random); | |
_colorOne = _gradientColors[0]; | |
_colorTwo = _gradientColors[1]; | |
}); | |
} catch (e) { | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment