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.