Last active
August 27, 2018 05:27
-
-
Save A-Babin/f1dbe7c64b6d20cfacbc763e112c5d16 to your computer and use it in GitHub Desktop.
Dart animation forwards fill mode
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
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