Responsive_deva
for better tutorial (https://youtu.be/LvMr7LQih4c)
1. Installation โฌ๏ธ
Add to pubspec.yaml.
dependencies:
...
responsive_deva: any
Usage ๐ป
2. Add the following imports to your Dart code:
import 'package:responsive_deva/responsive_deva.dart';
3. Wrap MaterialApp with ResponsiveDevaStart widget
ResponsiveDevaStart(
builder: (context, orientation, deviceType) {
return MaterialApp();
}
)
Widget Height direct copy form designing software ๐
Container(
width: getHeight(20), //It will take a 20pixel of screen width you can see on XD,Figma and many UI designing software
height: getWidth(20) //It will take a 30pixel of screen height you can see on XD,Figma and many UI designing software
)
Widget Size ๐
Container(
width: 20.w, //It will take a 20% of screen width
height:30.h //It will take a 30% of screen height
)
Padding โน
Padding(
padding: EdgeInsets.symmetric(vertical: 5.h, horizontal: 3.h),
child: Container(),
);
Font size ๐
Text(
'Sizer',style: TextStyle(fontSize: 15.sp),
);
Square Widget ๐ฉ
If you want to make square size widget then give height or width in both height and width.
Container(
width: 30.h, //It will take a 30% of screen height
height: 30.h, //It will take a 30% of screen height
);
Orientation ๐
If you want to support both portrait and landscape orientations
Device.orientation == Orientation.portrait
? Container( // Widget for Portrait
width: 100.w,
height: 20.5.h,
)
: Container( // Widget for Landscape
width: 100.w,
height: 12.5.h,
)
DeviceType ๐ฑ
If you want the same layout to look different in tablet and mobile, use the SizerUtil.deviceType
method:
SizerUtil.deviceType == DeviceType.mobile
? Container( // Widget for Mobile
width: 100.w,
height: 20.5.h,
)
: Container( // Widget for Tablet
width: 100.w,
height: 12.5.h,
)
Contact us
Flutter & Blockchain Developer with approximately 2.6 Year's of experience during this year I am work on Banking app ERP system app E-Commerce application and many more project designing, developing, testing Flutter applications and also work on Solidity smart contract NFT Minting integration with OpenSea, Work on Ether Blockchain and also Creating ethereum wallet like metamask App
--๐ซโก{#MySkills
}โกโก
#Flutter ,
#Solidity,
#Web3 js,
#React js ,
#Express js ,
#JavaScript
If you have seen my profile so please contact me For your Business growth with minimum price ๐ค
๐ฌEmail : sachinrathoreindore8@gmail.com
# Parameters โ๏ธ
* `.h` - Returns a calculated height based on the device
* `.w` - Returns a calculated width based on the device
* `.sp` - Returns a calculated sp based on the device
* `MyUtilityDeva.orientation` - for screen orientation portrait or landscape
* `MyUtilityDeva.deviceType` - for device type mobile or tablet
* `MyUtilityDeva.deviceType` - for device type mobile or tablet
Suggestion
**Orientation**
If you want to give support for both portrait and landscape then make separate widget for both like orientation example.
**DeviceType**
If you want to give support for both mobile and tablet then make separate widget for both like deviceType example.
this flutter packages inspire form "TechnoUrmish" and Praveen thank you for give me ideas