Created
October 11, 2019 12:39
-
-
Save av/7243d53096a6759a8892d0da48ce9545 to your computer and use it in GitHub Desktop.
Flutter: tough_bikes, density
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
// 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