You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@applebest Great idea, package used by many users including web and desktop that they are needing resize by width rather than orientation. You can use fontSizeResolver though (FontSizeResolver.[your_factor-radius in this case] or any other function), maybe conditionnaly based on device type
@applebest Great idea, package used by many users including web and desktop that they are needing resize by width rather than orientation. You can use fontSizeResolver though (FontSizeResolver.[your_factor-radius in this case] or any other function), maybe conditionnaly based on device type
Is it possible to add a parameter to the initialization method to control via a variable whether or not the design ratio needs to be refreshed based on orientation?
There is no screen rotation on the web and desktop, so there is no problem using width adaptation. On mobile phones and tablets, the screen rotation will be chaotic. Can the frame adapt? grateful
@applebest Great idea, package used by many users including web and desktop that they are needing resize by width rather than orientation. You can use fontSizeResolver though (FontSizeResolver.[your_factor-radius in this case] or any other function), maybe conditionnaly based on device type
Is it possible to add a parameter to the initialization method to control via a variable whether or not the design ratio needs to be refreshed based on orientation?
See Docs, fontSizeResolver parameter, in your case you can pass FontSizeResolvers.radius instead of default (FontSizeResolvers.width)
@applebest Great idea, package used by many users including web and desktop that they are needing resize by width rather than orientation. You can use fontSizeResolver though (FontSizeResolver.[your_factor-radius in this case] or any other function), maybe conditionnaly based on device type
Is it possible to add a parameter to the initialization method to control via a variable whether or not the design ratio needs to be refreshed based on orientation?
See Docs, fontSizeResolver parameter, in your case you can pass FontSizeResolvers.radius instead of default (FontSizeResolvers.width)
FontSizeResolvers.radius only solves the font adaptation problem, the width and height of the widget are adapted using .w.h, when the screen is rotated . .w.h still uses the vertical scaling, I need to change the scaling according to the horizontal/vertical switch, because the width and height change when the screen is rotated.
@applebest This is expected, you should use your own code then with Flutter's LayoutBuilder widget, this package will not re-invent what is already built-in in flutter
@applebest Great idea, package used by many users including web and desktop that they are needing resize by width rather than orientation. You can use fontSizeResolver though (FontSizeResolver.[your_factor-radius in this case] or any other function), maybe conditionnaly based on device type
Is it possible to add a parameter to the initialization method to control via a variable whether or not the design ratio needs to be refreshed based on orientation?
See Docs, fontSizeResolver parameter, in your case you can pass FontSizeResolvers.radius instead of default (FontSizeResolvers.width)
FontSizeResolvers.radius only solves the font adaptation problem, the width and height of the widget are adapted using .w.h, when the screen is rotated . .w.h still uses the vertical scaling, I need to change the scaling according to the horizontal/vertical switch, because the width and height change when the screen is rotated.
This is not a default for all developers, mobile developers also they want to calculate box width based on actual width of viewport whether landscape or portrait, so this custom feature will not be coded in this library. You should take a look at LayoutBuilder for this behaviour.
Some public widgets use a lot of .w and .h when laying out. In landscape mode, I still want the public widgets to have good layout performance when rotating, so use .r This means that a lot of layout code needs to be modified based on rotation.
Activity
applebest commentedon May 23, 2024
Mounir-Bouaiche commentedon May 23, 2024
@applebest Great idea, package used by many users including web and desktop that they are needing resize by width rather than orientation. You can use fontSizeResolver though (
FontSizeResolver.[your_factor-radius in this case]or any other function), maybe conditionnaly based on device typeapplebest commentedon May 23, 2024
Is it possible to add a parameter to the initialization method to control via a variable whether or not the design ratio needs to be refreshed based on orientation?
applebest commentedon May 23, 2024
There is no screen rotation on the web and desktop, so there is no problem using width adaptation. On mobile phones and tablets, the screen rotation will be chaotic. Can the frame adapt? grateful
Mounir-Bouaiche commentedon May 23, 2024
See Docs, fontSizeResolver parameter, in your case you can pass
FontSizeResolvers.radiusinstead of default (FontSizeResolvers.width)applebest commentedon May 23, 2024
FontSizeResolvers.radiusonly solves the font adaptation problem, the width and height of the widget are adapted using.w.h, when the screen is rotated ..w.hstill uses the vertical scaling, I need to change the scaling according to the horizontal/vertical switch, because the width and height change when the screen is rotated.Mounir-Bouaiche commentedon May 23, 2024
@applebest This is expected, you should use your own code then with Flutter's
LayoutBuilderwidget, this package will not re-invent what is already built-in in flutterMounir-Bouaiche commentedon May 23, 2024
This is not a default for all developers, mobile developers also they want to calculate box width based on actual width of viewport whether landscape or portrait, so this custom feature will not be coded in this library. You should take a look at
LayoutBuilderfor this behaviour.Mounir-Bouaiche commentedon May 23, 2024
@applebest You can also use
.rinstead of.wand.hif you want the minimum value of width/height viewport, in any caseapplebest commentedon May 23, 2024
Some public widgets use a lot of
.wand.hwhen laying out. In landscape mode, I still want the public widgets to have good layout performance when rotating, so use.rThis means that a lot of layout code needs to be modified based on rotation.Mounir-Bouaiche commentedon May 23, 2024
You can use this code, wrap
ScreenUtilInitwithLayoutBuilderand passdesignSizeaccording to orientationapplebest commentedon May 23, 2024
Please send another picture, it was not uploaded, thank you
Mounir-Bouaiche commentedon May 23, 2024
It's yours