Created
July 12, 2021 08:11
-
-
Save IsmailAlamKhan/b55e0ef8f2666c2d5617fea8f3310178 to your computer and use it in GitHub Desktop.
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
void main(){ | |
//error | |
const adj = Adjustments(brightness: 1.1); | |
//fine | |
const adj = Adjustments(brightness: 1.0); | |
} | |
class Adjustments { | |
final double brightness; | |
final double hue; | |
final double saturation; | |
final double blur; | |
const Adjustments({ | |
double brightness = 0.0, | |
double hue = 0.0, | |
double saturation = 0.0, | |
double blur = 0.0, | |
}) : brightness = brightness * 100, | |
hue = hue * 100, | |
saturation = saturation * 100, | |
blur = blur * 100, | |
assert(brightness >= 0.0 && brightness <= 1.0), | |
assert(hue >= 0.0 && hue <= 1.0), | |
assert(saturation >= 0.0 && saturation <= 1.0), | |
assert(blur >= 0.0 && blur <= 1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment