This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
Path path = Path(); | |
// Draws a line from left top corner to right bottom | |
path.lineTo(size.width, size.height); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
Path path = Path(); | |
// Moves starting point to the center of the screen | |
path.moveTo(size.width / 2, size.height / 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
Path path = Path(); | |
// Adds a rectangle | |
path.addRect(Rect.fromLTWH(size.width / 2, size.height / 2, size.width / 4, size.height / 4)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
Path path = Path(); | |
// Adds an oval | |
path.addOval(Rect.fromLTWH(size.width / 2, size.height / 2, size.width / 4, size.height / 4)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
// Method to convert degree to radians | |
num degToRad(num deg) => deg * (Math.pi / 180.0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
Path path = Path(); | |
// Adds a polygon from the starting point to quarter point of the screen and lastly | |
// it will be in the bottom middle. Close method will draw a line between start and end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
Path path = Path(); | |
path.addRRect( | |
RRect.fromRectAndRadius(Rect.fromLTWH(size.width / 2, size.height / 2, size.width / 4, size.height / 4), Radius.circular(16)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
Path path = Path(); | |
path.addRRect( | |
RRect.fromRectAndRadius(Rect.fromLTWH(size.width / 2, size.height / 2, size.width / 4, size.height / 4), Radius.circular(16)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
Path path = Path(); | |
path.moveTo(0, size.height / 2); | |
path.quadraticBezierTo(size.width / 2, size.height, size.width, size.height / 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = Paint() | |
..color = Colors.red | |
..style = PaintingStyle.stroke | |
..strokeWidth = 8.0; | |
// Method to convert degree to radians | |
num degToRad(num deg) => deg * (Math.pi / 180.0); |