FilledStacks / responsive_builder

A set of widgets to make responsive UI building in flutter more readable
MIT License
497 stars 80 forks source link

Sizedbox in how to set responsive height and width and text fontSize responsive #25

Closed ashishoffice closed 3 years ago

ashishoffice commented 3 years ago

Can you explain me

FilledStacks commented 3 years ago

I don't know what you're asking but I'll throw some random facts at you:

  1. You can use the getValueForScreenType<T> to return a different value based on the screen its on.
SizedBox(
width: getValueForScreenType<double>(
                      context: context,
                      mobile: 30,
                      tablet: 60,
                    ),
)

The above will return a SizedBox with width 30 on a mobile device and 60 on a tablet sized device.

  1. You can use screenUtil for your font sizing functionality
  2. You can use the MediaQuery if you want your SizedBox to react with the screen size changing.