Skip to content

Instantly share code, notes, and snippets.

@IsmailAlamKhan
Created July 12, 2021 08:11
Show Gist options
  • Save IsmailAlamKhan/b55e0ef8f2666c2d5617fea8f3310178 to your computer and use it in GitHub Desktop.
Save IsmailAlamKhan/b55e0ef8f2666c2d5617fea8f3310178 to your computer and use it in GitHub Desktop.
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