Created
July 22, 2018 18:19
-
-
Save fyodorio/45f62b7c9b3fc3ca662e4d5631a06c05 to your computer and use it in GitHub Desktop.
My First Dart Web App
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
<div class="app"> | |
<h1 class="header">My Great Dart Web App</h1> | |
<div class="button">DO THE THING</div> | |
<div class="output"></div> | |
</div> |
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 counter = 0; | |
doTheJob() { | |
counter++; | |
querySelector('.output').text = 'The Thing Is Done ${counter} Time(s)'; | |
} | |
querySelector('.button').onClick.listen((e) => doTheJob()); | |
} |
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
.app { | |
height: 100vh; | |
background-color: #ff8b8b; | |
padding: 10px; | |
color: white; | |
} | |
.header, .button, .output { | |
text-align: center; | |
font-family: 'Open Sans', sans-serif; | |
} | |
.button { | |
font-size: 20px; | |
margin: 20px auto 20px; | |
padding: 10px; | |
border-radius: 5px; | |
cursor: pointer; | |
background-color: #32b67a; | |
width: 50%; | |
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1); | |
user-select: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment