Skip to content

Instantly share code, notes, and snippets.

@av
Created October 11, 2019 11:47
Show Gist options
  • Save av/dc1df6b6b948439d6938bc2c400dd57b to your computer and use it in GitHub Desktop.
Save av/dc1df6b6b948439d6938bc2c400dd57b to your computer and use it in GitHub Desktop.
Flutter: tough_bikes BikeButtonPainter
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