flutter/examples/raw/circle.sky
Adam Barth 854f083f1b Clean up examples directory
1) Merge input example into widgets example
2) Move single-file, non-fn examples into a "raw" directory
3) Rename stocks-fn and widgets-fn to stocks and widgets

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1005393006
2015-03-26 14:32:40 -07:00

25 lines
538 B
Plaintext

<sky>
<style>
div {
height: 200px;
background-color: lightblue;
}
</style>
<div id="canvas" />
<script>
import 'dart:math' as math;
import 'dart:sky';
void main() {
var element = document.getElementById('canvas');
element.requestPaint((PaintingContext context) {
Paint paint = new Paint();
paint.setARGB(128, 0, 255, 0);
double radius = math.min(context.width, context.height) / 2.0;
context.drawCircle(context.width / 2.0, context.height / 2.0, radius, paint);
context.commit();
});
}
</script>
</sky>