Skip to content

Instantly share code, notes, and snippets.

@tgfjt
Created December 16, 2019 08:30
Show Gist options
  • Save tgfjt/50e8c2d2331d38a3bab83d7c11ac7108 to your computer and use it in GitHub Desktop.
Save tgfjt/50e8c2d2331d38a3bab83d7c11ac7108 to your computer and use it in GitHub Desktop.
<h1 id="header"></h1>
import 'dart:html';
import 'dart:convert';
void main() async {
var raw = await HttpRequest.getString('https://swapi.co/api/people/1');
var ruke = jsonDecode(raw);
var $header = querySelector('#header');
$header.text = ruke["name"];
}
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: absolute;
width: 100%;
height: 100%;
background-color: #303f41;
}
h1 {
color: #f0f0f0;
font-family: serif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment