Adaptive Widgets Flutter
Bring adaptive and responsive UI to life effortlessly with the adaptive_widgets_flutter
package! 🌟 This package empowers you to create platform-specific UI components that seamlessly adapt to Android and iOS, ensuring a consistent and polished user experience.
With adaptive_widgets_flutter
, you can build beautiful, functional, and adaptive UI elements with ease. Here's what you get:
✨ Key Features
- Refreshable ScrollView 🌀
A pull-to-refresh scroll view that adapts its behavior to the platform. - Alert Dialog ⚠️
Fully customizable platform-specific alert dialogs. - Bottom Action Sheet 🛠️
Native-style bottom action sheets for user actions. - Date Picker 📅
Intuitive and native platform-style date pickers. - Time Picker ⏰ (New!)
Select times with a platform-adaptive interface.
🛠 Usage Examples
1. Refreshable ScrollView
Effortlessly create a scrollable view with pull-to-refresh functionality.
AdaptiveRefreshableScrollView(
padding: const EdgeInsets.all(20),
onRefresh: () async {
await Future.delayed(const Duration(seconds: 2));
},
slivers: [
// Your Sliver widgets go here
],
);
🎥 GIF Previews:
iOS:
Android:
2. Alert Dialog
Display platform-native alert dialogs with ease.
CupertinoButton.filled(
onPressed: () async {
await AdaptiveWidgets.showDialog(
context,
title: 'Sample Title',
content: 'Sample Content',
actionButtons: [
AdaptiveDialogButtonBuilder(
text: 'OK',
onPressed: (context) {
Navigator.of(context).pop();
},
),
],
);
},
child: const Text('Show Dialog'),
);
📸 Screenshots:
iOS:
Android:
3. Bottom Action Sheet
Create platform-specific bottom action sheets for user actions.
CupertinoButton.filled(
onPressed: () async {
final actionButtons = [
AdaptiveBottomSheetButtonBuilder(
child: const Text('Action 1'),
onPressed: (context) => Navigator.of(context).pop('action 1'),
),
AdaptiveBottomSheetButtonBuilder(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.adaptive.share),
const SizedBox(width: 10),
const Text('Share'),
],
),
),
AdaptiveBottomSheetButtonBuilder(child: const Text('Cancel'), isCancelAction: true),
AdaptiveBottomSheetButtonBuilder(child: const Text('Action 3')),
];
final result = await AdaptiveWidgets.showBottomActionSheet(
context,
actionButtons: actionButtons,
title: const Text('Sample Title'),
message: const Text('Sample Message'),
);
debugPrint(result);
},
child: const Text('Show Bottom Action Sheet'),
);
📸 Screenshots:
iOS:
Android:
4. Date Picker
Pick dates with a native platform-style interface.
CupertinoButton.filled(
onPressed: () async {
await AdaptiveWidgets.showDatePicker(context);
},
child: const Text('Show Date Picker'),
);
📸 Screenshots:
iOS:
Android:
5. Time Picker (New!)
A modern and native time picker for seamless time selection.
CupertinoButton.filled(
onPressed: () async {
await AdaptiveWidgets.showTimePicker(context);
},
child: const Text('Show Time Picker'),
);
🎥 GIF Previews:
iOS:
Android:
🚀 Get Started
Integrate adaptive_widgets_flutter
into your project and elevate your UI to new heights. Visit the documentation for detailed guidance.
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
Libraries
- adaptive_widgets
- bottom_action_sheet/adaptive_bottom_action_sheet
- bottom_action_sheet/android_bottom_action_sheet
- bottom_action_sheet/ios_bottom_action_sheet
- date_picker/adaptive_date_picker
- date_picker/android_date_picker
- date_picker/ios_date_picker
- dialog/adaptive_dialog
- dialog/android_dialog
- dialog/button/adaptive_dialog_action
- dialog/ios_dialog
- refreshable_scroll_view/adaptive_refreshable_scroll_view
- refreshable_scroll_view/android_refreshable_scroll_view
- refreshable_scroll_view/ios_refreshable_scroll_view
- time_picker/adaptive_time_picker
- time_picker/android_time_picker
- time_picker/ios_time_picker