size_builder 0.0.5
size_builder: ^0.0.5 copied to clipboard
Make a proportion and proportion to the length, width, and diameter of the screens of all kinds to get a responsive design.
size_builder:0.0.5
Features #
Make a proportion and proportion to the length, width, and diameter of the screens of all kinds to get a responsive design.
Getting started #
size_builder: 0.0.5
or
flutter pub add size_builder
How to use #
= > WebAppSize.WH = Web Height
= > WebAppSize.WH = Web Width
= > WebAppSize.WS = Web Size
= > MobileAppSize.MH = Mobile Height
= > MobileAppSize.MW = Mobile Width
= > MobileAppSize.MS = Mobile Size
-------------------------------------------------------------------------------------------
At first, you should to add in first screen class
for Web
WebAppSize().init(context);
for Mobile
MobileAppSize().init(context);
Example #
for Mobile
class HomeLayout extends StatelessWidget {
const HomeLayout({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
MobileAppSize().init(context);
return Scaffold();
}
}
for Web
class HomeLayout extends StatelessWidget {
const HomeLayout({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
WebAppSize().init(context);
return Scaffold();
}
}
you can use it for many things; like:
Container Size #
Container(
height : MobileAppSize.MH_200,
width : MobileAppSize.MW_390,
),
Or #
Container(
height : WebAppSize.WH_200,
width : WebAppSize.WW_390,
),
You can add it for font size
Container(
height : WebAppSize.WH_200,
width : WebAppSize.WW_390,
child :Text('hello flutter',
style: TextStyle(
fontSize: MobileSize.MS_20,
),
)
),