Created
April 5, 2018 00:55
-
-
Save timsneath/f2ac261c33d2af24851dc59b71266da4 to your computer and use it in GitHub Desktop.
Adding support for dismissible jokes
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
_refreshAction() { | |
setState(() { | |
_response = http.read(dadJokeApi, headers: httpHeaders); | |
}); | |
} | |
... | |
if (decoded['status'] == 200) { | |
_displayedJoke = decoded['joke']; | |
return new Padding( | |
padding: const EdgeInsets.all(16.0), | |
child: new Dismissible( | |
key: new Key("joke"), | |
direction: DismissDirection.horizontal, | |
onDismissed: (direction) { | |
_refreshAction(); | |
}, | |
child: new Text(_displayedJoke, style: jokeTextStyle), | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment