Skip to content

Instantly share code, notes, and snippets.

@icatalud
Last active September 8, 2019 03:57
Show Gist options
  • Save icatalud/b12e8f4fe57df5d5f6aa092030433bd4 to your computer and use it in GitHub Desktop.
Save icatalud/b12e8f4fe57df5d5f6aa092030433bd4 to your computer and use it in GitHub Desktop.
TransitionImage class and fetchImage function added
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