Comments (13)
![image](https://private-user-images.githubusercontent.com/16376401/333184583-0e67cd94-ddae-41d9-b212-be1d3f3e8862.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY1MDM4NzAsIm5iZiI6MTcxNjUwMzU3MCwicGF0aCI6Ii8xNjM3NjQwMS8zMzMxODQ1ODMtMGU2N2NkOTQtZGRhZS00MWQ5LWIyMTItYmUxZDNmM2U4ODYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTIzVDIyMzI1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwYjVjZWE5YjdhMWIxY2QzZDgzNzA0NzA0ZWMwMDJkZDVkNGRlYWE3NjBmZGIyZmU1ZTQ4MWZjMDVkNDRlODEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.KJ0DT8zTEfN1lcrI7zUDmtfm3BUY-hdI4prFv6zMUxI)
from flutter_screenutil.
@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
from flutter_screenutil.
@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?
from flutter_screenutil.
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
from flutter_screenutil.
@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 typeIs 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
)
from flutter_screenutil.
@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 typeIs 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.
from flutter_screenutil.
@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
from flutter_screenutil.
@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 typeIs 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.
from flutter_screenutil.
@applebest You can also use .r
instead of .w
and .h
if you want the minimum value of width/height viewport, in any case
from flutter_screenutil.
@applebest您也可以使用
.r
而不是.w
,.h
如果您想要宽度/高度视口的最小值,无论如何
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.
from flutter_screenutil.
You can use this code, wrap ScreenUtilInit
with LayoutBuilder
and pass designSize
according to orientation
from flutter_screenutil.
![]()
You can use this code, wrap
ScreenUtilInit
withLayoutBuilder
and passdesignSize
according to orientation
Please send another picture, it was not uploaded, thank you
from flutter_screenutil.
It's yours
from flutter_screenutil.
Related Issues (20)
- [Question] - Support for web ? HOT 2
- Lib doesn't work starting from Flutter 3.16 on mobile: all screen util values became invalid HOT 6
- 5.9.0 cause app crash HOT 2
- How to automatically adjust the font size with changes in screen size HOT 2
- How do I use this correctly to fit for iPad with a iPhone design? HOT 1
- LateInitializationError: Field '_minTextAdapt@941084504' has not been initialized. HOT 11
- Display problems on tablets and mobile devices HOT 3
- The getter 'physicalGeometry' isn't defined for the type 'FlutterView'. HOT 5
- 是否有支持鸿蒙系统的计划 HOT 1
- How to display well on different devices with different ratio? HOT 2
- Landscape mode, font size increases causing overflow HOT 5
- BorderRadiusExtension and RadiusExtension named wrong HOT 2
- some text widgets in build mode is missing HOT 15
- i update to flutter 3.19.5 the package dosen't work any more HOT 7
- ScreenUtils is best Utils for Flutter developer. HOT 1
- 5.9.0 oppo colorOS 14.0 Android14列表item有时会空白 HOT 3
- flutter_screenutil 5.9.0, Android phones can run with the screen turned off and wiget will be lost HOT 2
- 关于我使用ScreenUtilInit这种方式初始化,builder会调用两次,导致跳转页面会多生成一个 HOT 7
- u
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_screenutil.