responsive_adaptive_ui 0.0.1
responsive_adaptive_ui: ^0.0.1 copied to clipboard
A Flutter package for responsive and adaptive UIs (percent sizes, breakpoints, adaptive widgets).
Perfect π A killer README.md is what will make your package shine on pub.dev and get more adoption.
Hereβs a ready-to-use structure for your package responsive_adaptive_ui:
π± responsive_adaptive_ui #
Make your Flutter apps responsive and adaptive across all screen sizes and platforms with a single package π.
β¨ Features #
β Responsive sizing β Use percentage-based width, height, padding, margin β Responsive text β Auto-scale text between min & max size β Adaptive widgets β Platform-aware UI (Android, iOS, Web, Desktop) β Responsive layouts β Breakpoints for mobile, tablet, desktop β Accessibility friendly β Respects system font scaling β All-in-one β No need for multiple packages like ScreenUtil, responsive_builder, or platform_widgets
π¦ Installation #
Add this to your pubspec.yaml:
dependencies:
responsive_adaptive_ui: ^0.0.1
π Getting Started #
1. Initialize #
MaterialApp(
builder: (context, child) {
Responsive.init(context);
return child!;
},
home: const HomePage(),
);
2. Responsive Sizing #
Container(
width: Responsive.w(50), // 50% of screen width
height: Responsive.h(20), // 20% of screen height
color: Colors.blue,
);
Padding(
padding: Responsive.padding(left: 5, top: 2), // % based padding
child: const Text("Responsive padding"),
);
3. Responsive Text #
ResponsiveText(
"Hello World",
min: 14,
max: 28,
style: const TextStyle(color: Colors.black),
);
4. Adaptive Widgets #
AdaptiveButton(
onPressed: () {},
child: const Text("Adaptive Button"),
);
- Android β ElevatedButton
- iOS β CupertinoButton
- Web/Desktop β OutlinedButton
5. Responsive Layouts (Breakpoints) #
ResponsiveBuilder(
mobile: (_) => const Text("Mobile Layout"),
tablet: (_) => const Text("Tablet Layout"),
desktop: (_) => const Text("Desktop Layout"),
);
π Comparison with Other Packages #
| Feature | ScreenUtil | responsive_builder | platform_widgets | responsive_adaptive_ui |
|---|---|---|---|---|
| Percentage-based sizing | β | β | β | β |
| Responsive text | β οΈ Limited | β | β | β (min/max scaling) |
| Breakpoints (layouts) | β | β | β | β |
| Adaptive widgets | β | β | β | β |
| Accessibility friendly | β | β | β | β |
| All-in-one solution | β | β | β | β |
π Example Project #
Check the example/ folder for a ready-to-run demo app showing:
- Login page (responsive)
- Dashboard (adaptive widgets)
- Text scaling on small vs large screens
π οΈ Roadmap #
- β Add more adaptive widgets (Switch, Slider, Dialogs)
- β Add customizable breakpoints
- β Add dark mode adaptive styles
- β Add orientation support
π€ Contributing #
Contributions are welcome!
- Open an issue if you find a bug
- Open a PR if you have a new feature
π License #
This project is licensed under the MIT License - see the LICENSE file for details.