OpenFlutter / flutter_screenutil

Flutter screen adaptation, font adaptation, get screen information
https://pub.dartlang.org/packages/flutter_screenutil
Apache License 2.0
3.85k stars 486 forks source link

Different design sizes for different screens #497

Closed RomanSoviak closed 1 year ago

RomanSoviak commented 1 year ago

I had design for screens with the following resolution: 375x812. So I added:

    ScreenUtil.init(
                  context,
                  designSize: Size(375, 812),
                  minTextAdapt: true,
                );

Now we have a new designer and she makes new screens with another screen resolution: 375x667,

I want to make new screen uses new resoltion and the old ones designSize: 375x812, How can I make to do it?

Mounir-Bouaiche commented 1 year ago

Duplicate of #469

yuktaatreya commented 4 months ago

Duplicate of #469

This is not a duplicate, in #469 updating the design size based on the condition updates the design size for the entire app. You cannot update the design size for just one screen. eg: If I add ScreenUtil.init(context, designSize: const Size(375, 812)); in the build method for one widget, rest of the widgets in the tree also get the updated design size. Need a way to define design size for only the child widget.