Skip to content

Instantly share code, notes, and snippets.

@A-Babin
Last active August 27, 2018 05:27
Show Gist options
  • Save A-Babin/f1dbe7c64b6d20cfacbc763e112c5d16 to your computer and use it in GitHub Desktop.
Save A-Babin/f1dbe7c64b6d20cfacbc763e112c5d16 to your computer and use it in GitHub Desktop.
Dart animation forwards fill mode
import 'dart:html';
void main() {
var el = Element.div();
el.style.backgroundColor = "#881003";
el.text = "HELLO WORLD";
el.style.width = "400px";
el.style.height = "400px";
document.body.append(el);
el.onClick.listen((_) {
el.text = "OH NO! I'M FADING AWAY";
el.animate([{"opacity": 0}], {
"duration": 1000,
"fill": "forwards"
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment