creating responsive widget kinda isMobile?Fontsize 12 : fontsize 24 or use sizer package,what is the best responsive method for web,tablet,mobile?
CodePudding user response:
the best place to find FLUTTER solutions/documentations is the official flutter/dart websites.
For this question:
Creating responsive and adaptive apps
CodePudding user response:
flutter documentation did give some solution but , not effective for all purposes
AspectRatio
CustomSingleChildLayout
CustomMultiChildLayout
FittedBox
FractionallySizedBox
LayoutBuilder
MediaQuery
MediaQueryData
OrientationBuilder
if we using one by one , all methods have it's own defects . mobile side and tablet side it will work , but in the case of windows and web , it won't.
if we combine these methods , also get some responsive issue , because of all methods are depend on the device height ,device width ,device aspectRatio , device Offset ,
also so much plugins are available but they have defects too , in the case of flutter_screenutil
it depend on width , height . so if changes in one of the property it won't count. that means it won't change layout in web
so i am using this way combine 4 methods together
flutter_screenutil , LayoutBuilder , MediaQuery , AspectRatio
by using this way we can achieve,maintain the 3 layouts in one code
please use wisely according to your use case