Codelessly / ResponsiveFramework

Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
https://codelessly.com
MIT License
1.25k stars 150 forks source link

Error null when defaultValue on ResponsiveValue not specified #171

Closed Hasuki69 closed 6 months ago

Hasuki69 commented 6 months ago

image

before upgrading to the latest version, i can ignore the defaultValue. now i should specify the defaultValue with mediaquery width or it will error null.

i look at the code and find that you use defaultValue when the getValue is null, but you make the defaultValue nullable where its mean both can be null and cause the error when defaultValue not specified. image

dmacinator commented 6 months ago

Try "ResponsiveValue<double?>" instead. Seems to fix it for me.

Hasuki69 commented 6 months ago

Try "ResponsiveValue<double?>" instead. Seems to fix it for me.

thanks for replying, it's work 👍