Created with <3 with dartpad.dev.
Last active
August 17, 2022 14:04
-
-
Save Quingsley/eb390f051ca4e9741e55d97534ec6910 to your computer and use it in GitHub Desktop.
more-streams
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>more-streams</title> | |
<link rel="stylesheet" href="styles.css"> | |
<script type="application/dart" src="main.dart"></script> | |
</head> | |
<body> | |
<button>Click Me</button> | |
</body> | |
</html> |
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(){ | |
final btnElement = querySelector('button'); | |
btnElement?.onClick.timeout( | |
Duration(seconds: 1), | |
onTimeout:(sink) => sink.addError('Too slow'), | |
).listen( | |
(event){}, | |
onError:(err)=>print(err) | |
); | |
} | |
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
body { | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
} | |
h1 { | |
color: white; | |
font-family: Arial, Helvetica, sans-serif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment