Last active
September 8, 2019 03:57
-
-
Save icatalud/b12e8f4fe57df5d5f6aa092030433bd4 to your computer and use it in GitHub Desktop.
TransitionImage class and fetchImage function added
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
fetchAndUpdateImage([String url = 'https://picsum.photos/300/200']) async { | |
final response = await http.get(url); | |
floop['image'] = TransitionImage(Image.memory(response.bodyBytes)); | |
} | |
class TransitionImage extends FloopWidget { | |
final Image image; | |
const TransitionImage(this.image); | |
@override | |
Widget build(BuildContext context) { | |
return Opacity(opacity: transition(1500), child: image); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment