Created
October 11, 2019 12:04
-
-
Save av/8ac7a8fc9931425eae6d924af8ea6e29 to your computer and use it in GitHub Desktop.
Flutter: tough_bikes, draw random lines
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) { | |
// This [Rect] will fill the whole canvas we got | |
var fillRect = Rect.fromPoints(Offset.zero, size.bottomRight(Offset.zero)); | |
var count = 100; | |
// Background for our texture | |
canvas.drawRect(fillRect, fillPaint); | |
for (var i = 0; i < count; i++) { | |
canvas.drawLine(randomOffset(size), randomOffset(size), linePaint); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment