pop_overlay 1.0.3
pop_overlay: ^1.0.3 copied to clipboard
A feature-rich package for displaying customizable pop-ups from any given widget. Featuring animated, draggable overlays, with optional background blur effects...
pop_overlay #
A feature-rich Flutter package for displaying customizable pop-up notifications, alerts, and overlay UI elements. Featuring: animated, draggable, overlays/popups, and optional background blur.
Demo #

Features #
- β¨ Multiple Overlays: Display multiple popups simultaneously with automatic stacking and priority management
- π¨ Customizable Animations: Smooth entrance and exit animations with full animation control
- π«οΈ Background Blur Effects: Optional blur overlay with configurable intensity
- π― Tap-to-Dismiss: Background tap dismissal with configurable behavior
- π±οΈ Draggable Popups: Make popups draggable with position tracking using state management
- π Framed Design: Pre-built UI Frame system for consistent popup styling
- β¨οΈ Keyboard Support: Escape key listener for keyboard-based dismissal
- β‘ Performance Optimized: Efficient rendering with smart animation controls
- ποΈ Full Customization: Control colors, sizes, animations, and more
- π± Responsive: Adapts to different screen sizes and orientations
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
pop_overlay: ^1.0.3
Then run:
flutter pub get
Usage #
Basic Pop-up #
import 'package:pop_overlay/pop_overlay.dart';
// Create and show a simple popup
PopOverlay.addPop(
PopOverlayContent(
id: 'my_popup',
widget: Container(
padding: const EdgeInsets.all(16),
child: const Text('Hello, Pop Overlay!'),
),
),
);
// Remove the popup
PopOverlay.removePop('my_popup');
Pop-up with Customization #
PopOverlay.addPop(
PopOverlayContent(
id: 'custom_popup',
widget: MyCustomWidget(),
barrierDismissible: true,
barrierColor: Colors.black.withValues(alpha: 0.5),
animationDuration: const Duration(milliseconds: 300),
),
);
Draggable Pop-up #
PopOverlay.addPop(
PopOverlayContent(
id: 'draggable_popup',
widget: MyContentWidget(),
isDraggeable: true,
),
);
Pop-up with Framed Design #
final template = FrameDesign(
title: 'Settings',
showCloseButton: true,
titlePrefixIcon: Icons.settings,
onSuccess: () => PopOverlay.removePop('settings_popup'),
);
PopOverlay.addPop(
PopOverlayContent(
id: 'settings_popup',
widget: MySettingsWidget(),
frameDesign: template,
isDraggeable: true,
),
);
API Reference #
PopOverlay #
Main static class for managing popups.
addPop(PopOverlayContent content)- Add a popup to the overlayremovePop(String id)- Remove a popup by IDremoveAllPops()- Remove all active popupsgetPop(String id)- Get a popup by ID
PopOverlayContent #
Configuration class for individual popups.
Parameters:
id(String) - Unique identifier for the popupwidget(Widget) - Content widget to displayisDraggeable(bool) - Enable drag functionality (default: false)frameDesign(FrameDesign?) - Optional Frame design templatebarrierDismissible(bool) - Allow dismissal by tapping outside (default: true)barrierColor(Color) - Background overlay coloranimationDuration(Duration) - Animation duration for entrance/exitpositionController(Injected
FrameDesign #
Pre-built Frame template for consistent popup UI.
Parameters:
title(String?) - Popup titleshowCloseButton(bool) - Show close button (default: true)titlePrefixIcon(IconData?) - Icon before titleonSuccess(VoidCallback?) - Success button callback
Advanced Features #
The gif above demonstrates:
- Multiple stacked popups
- Smooth animations
- Draggable functionality
- Design template styling
Performance Optimizations #
The package includes several performance optimizations:
- Smart Animation Control: Animations are disabled during drag operations for smooth performance
- Efficient State Management: Custom drag state controller prevents unnecessary rebuilds
- Lazy Rendering: Overlays are only rendered when needed
- Minimal Dependencies: Lightweight package with carefully selected dependencies
Dependencies #
flutter_animate: Advanced animation effectss_future_button: Button with async supportstates_rebuilder_extended: State managements_widgets: Utility widgetssizer: Responsive sizing
See pubspec.yaml for the complete list.
Examples #
Complete working examples are available in the example/ directory:
- Basic pop-up notification
- Draggable popup with Frame Design template
- Multiple popups with priorities
- Customized animations and styling
Run the example:
cd example
flutter run
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Support #
If you encounter any issues or have feature requests, please file an issue on the GitHub repository.
Made with β€οΈ by SoundSliced Ltd