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

  1. Wrap your app with ResponsiveInitializer:
void main() {
  runApp(
    MaterialApp(
      home: ResponsiveInitializer(
        baseHeight: 812, // Design height
        baseWidth: 375,  // Design width
        child: MyApp(),
      ),
    ),
  );
}
  1. 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),
  ),
)
  1. 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.

LinkedIn Telegram Facebook

Libraries

my_responsive_ui