auto_responsive_ui 0.0.1
auto_responsive_ui: ^0.0.1 copied to clipboard
Smart responsive scaling engine for Flutter with adaptive layout support.
๐ auto_responsive_ui #
A smart, adaptive responsive engine for Flutter โ not just scaling, but intelligent UI adjustment based on device type and screen size.
โจ Why auto_responsive_ui? #
Every Flutter developer faces this problem:
โ UI looks perfect on one device โ Breaks on small phones โ Looks oversized on tablets โ Too much manual MediaQuery logic
Existing solutions only scale blindly.
๐ auto_responsive_ui solves this with intelligent scaling + device awareness.
๐ฅ Key Features #
-
๐ฑ Device Type Detection
- Small Phone
- Phone
- Large Phone
- Tablet
-
โ๏ธ Smart Scaling (Not Linear)
- Prevents UI from becoming too small or too large
- Uses min/max clamp for stability
-
๐ฏ Figma-Based Design Support
- Build UI exactly based on your design dimensions
-
โจ Clean Extensions API
- No boilerplate
- Super easy to use
-
๐งฑ Safe Initialization
- No need to manually handle screen calculations
๐ฆ Installation #
Add this to your pubspec.yaml:
dependencies:
auto_responsive_ui: ^0.0.1
๐ Getting Started #
1. Wrap Your App #
return ResponsiveBuilder(
config: const ResponsiveConfig(
designWidth: 375,
designHeight: 812,
),
child: MaterialApp(
home: MyHomePage(),
),
);
2. Use Extensions Anywhere #
Padding(
padding: EdgeInsets.all(16.w),
child: Text(
"Hello Flutter",
style: TextStyle(fontSize: 18.r),
),
)
๐ Available Extensions #
| Extension | Description |
|---|---|
.w |
Scales width |
.h |
Scales height |
.r |
Scales text/font |
๐ฑ Device Type Usage #
if (ResponsiveEngine.deviceType == DeviceType.tablet) {
return GridView(...);
} else {
return ListView(...);
}
โ๏ธ Configuration #
ResponsiveConfig(
designWidth: 375,
designHeight: 812,
minScale: 0.85,
maxScale: 1.25,
)
๐ง How It Works #
Unlike traditional packages:
โ Linear scaling โ breaks UI โ Adaptive scaling โ clamps values within safe range
It calculates:
- Screen size
- Device category
- Safe scaling ratio
Then applies optimized scaling across your UI.
๐ฅ Why Not Other Packages? #
| Feature | auto_responsive_ui | Typical Packages |
|---|---|---|
| Smart scaling | โ | โ |
| Device awareness | โ | โ |
| Clamp protection | โ | โ |
| Clean API | โ | โ ๏ธ |
| Figma alignment | โ | โ ๏ธ |
๐งช Example Use Cases #
- E-commerce apps
- Logistics apps
- Admin dashboards
- Startup MVPs
- Pixel-perfect UI builds
๐ธ Demo (Add your GIF here) #
Tip: Add screenshots of:
- Small phone
- Large phone
- Tablet
๐ ๏ธ Roadmap #
- โ Orientation-aware scaling
- โ Auto layout switching (Grid/List)
- โ Debug overlay
- โ Figma plugin integration
๐ค Contributing #
Contributions are welcome! Feel free to open issues or submit PRs.
๐ License #
MIT License
๐ก Author #
Built with โค๏ธ for Flutter developers who are tired of broken UI across devices.