Skip to content

Instantly share code, notes, and snippets.

@turnersr
Created December 23, 2013 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save turnersr/8090726 to your computer and use it in GitHub Desktop.
Save turnersr/8090726 to your computer and use it in GitHub Desktop.
Day 2, use of the the cascade operator.
import 'dart:html';
import 'dart:math';
void main() {
init_palau_flag();
}
void init_palau_flag() {
palau_flag();
}
void palau_flag(){
CanvasElement palau_canvas = querySelector("#palau_flag");
CanvasRenderingContext2D context = palau_canvas.context2D;
int width = palau_canvas.width;
int height = palau_canvas.height;
palau_canvas..width = width
..height = height;
context..fillStyle = "#4AADD6"
..fillRect(0,0,width,height);
context..fillStyle = "#FFDE00"
..arc(width/2.3, height/2, 40, 0, 2 * PI,false)
..fill();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment