my_responsive_ui 1.0.3+4
my_responsive_ui: ^1.0.3+4 copied to clipboard
A Flutter package for creating responsive UIs with easy to use extensions and utilities.
My Responsive UI #
A Flutter package that makes it easy to create responsive UIs across different screen sizes.
Features #
- Easy to use extensions for responsive dimensions (.h, .w, .sp, .r).
- Built-in spacing utilities (vs, hs).
- Safe dimension calculations with min/max boundaries.
- Orientation change support.
- Memory leak prevention
- Support for portrait mode.
- Responsive layout based on screen size.
- Support for screen size adaptation on both iOS and Android platforms.
Getting started #
Add this to your package's pubspec.yaml file:
dependencies:
my_responsive_ui: [current version]
Usage #
- Wrap your app with ResponsiveInitializer:
void main() {
runApp(
MaterialApp(
home: ResponsiveInitializer(
baseHeight: 812, // Design height
baseWidth: 375, // Design width
child: MyApp(),
),
),
);
}
- Use responsive extensions:
Container(
height: 200.h, // Responsive height
width: 300.w, // Responsive width
padding: EdgeInsets.all(16.r),
child: Text(
'Hello',
style: TextStyle(fontSize: 16.sp),
),
)
- Use spacing utilities:
Column(
children: [
Text('First'),
vs(20), // Vertical space
Text('Second'),
],
)
Socials #
If you have any feedback, suggestions, or issues, feel free to contact us. Your thoughts are highly appreciated.