Created
October 11, 2019 11:47
-
-
Save av/dc1df6b6b948439d6938bc2c400dd57b to your computer and use it in GitHub Desktop.
Flutter: tough_bikes BikeButtonPainter
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
class BikeButtonPainter extends CustomPainter { | |
final fillPaint = Paint()..color = Colors.grey; | |
@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)); | |
canvas.drawRect( | |
fillRect, | |
fillPaint, | |
); | |
} | |
@override | |
bool shouldRepaint(CustomPainter oldDelegate) => false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment