Skip to content

Instantly share code, notes, and snippets.

@av
Created October 11, 2019 12:39
Show Gist options
  • Save av/7243d53096a6759a8892d0da48ce9545 to your computer and use it in GitHub Desktop.
Save av/7243d53096a6759a8892d0da48ce9545 to your computer and use it in GitHub Desktop.
Flutter: tough_bikes, density
// in BikeButtonPainter
// ...
/// Defines how many lines per unit of area we want
final double density;
/// Expose to outside, allowing to override default value
BikeButtonPainter({
this.density = .1,
});
@override
void paint(Canvas canvas, Size size) {
// ...
var count = fillRect.width * fillRect.height * density;
// ...
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment