import 'dart:html'; void main() { CanvasElement canvas = new Element.tag("canvas"); canvas.height = 500; canvas.width = 500; document.body.children.add(canvas); var ctx = canvas.getContext("2d"); ctx.fillText("hello canvas", 50, 50); ctx.beginPath(); ctx.fillStyle = 'rgb(192, 80, 77)'; ctx.fillRect(50, 50,200,200); ctx.closePath(); ctx.fill(); }