Skip to content

Instantly share code, notes, and snippets.

@marti1125
Created January 21, 2019 03:11
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 marti1125/7f6a4bc908a8ddc9865ad4e602a37710 to your computer and use it in GitHub Desktop.
Save marti1125/7f6a4bc908a8ddc9865ad4e602a37710 to your computer and use it in GitHub Desktop.
Rectangle
import 'dart:math';
class Rectangle {
int width;
int height;
Point origin;
Rectangle({this.origin = const Point(0, 0), this.width = 0, this.height = 0});
@override
String toString() =>
'Origin: (${origin.x}, ${origin.y}), width: $width, height: $height';
}
main() {
print(Rectangle(origin: const Point(10, 20), width: 100, height: 200));
print(Rectangle(origin: const Point(10, 10)));
print(Rectangle(width: 200));
print(Rectangle());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment