Skip to content

Instantly share code, notes, and snippets.

@fyodorio
Created July 22, 2018 18:19
Show Gist options
  • Save fyodorio/45f62b7c9b3fc3ca662e4d5631a06c05 to your computer and use it in GitHub Desktop.
Save fyodorio/45f62b7c9b3fc3ca662e4d5631a06c05 to your computer and use it in GitHub Desktop.
My First Dart Web App
<div class="app">
<h1 class="header">My Great Dart Web App</h1>
<div class="button">DO THE THING</div>
<div class="output"></div>
</div>
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());
}
.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