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
- ๐ Atomic Replace (v3.2.0):
PopOverlay.replacePopfor atomically replacing an overlay - ๐งน Advanced Dismiss (v3.2.0):
dismissAllPopswithincludeInvisibleandexceptparameters - ๐ Query Helpers (v3.2.0):
isVisibleById,getVisiblePops,getInvisiblePops,visibleCount,invisibleCount - โจ๏ธ Escape Key Control (v3.2.0):
shouldDismissOnEscapeKeyflag per popup - ๐๏ธ Visibility Callback (v3.2.0):
onMadeVisiblecallback onPopOverlayContent - ๐ฑ๏ธ Drag Callbacks (v3.2.0):
onDragStart,onDragEndcallbacks anddragBoundsconstraint - ๐จ FrameDesign Enhancements (v3.2.0):
subtitle,titleBarColor,bottomBarColor,headerTrailingWidgets
Installation
Add this to your package's pubspec.yaml file:
dependencies:
pop_overlay: ^3.2.1
Then run:
flutter pub get
Usage
โ No setup required (auto-installs)
pop_overlay now self-installs its activator into the root overlay. You do not need to wrap your widget tree anymore.
Migration note:
PopOverlay.addPop(...)now accepts an optionalBuildContextfor deterministic root-overlay resolution.
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(),
shouldDismissOnBackgroundTap: true,
dismissBarrierColor: Colors.black.withValues(alpha: 0.5),
shouldAnimatePopup: true,
),
);
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, {BuildContext? context})- Add a popup (optionally providing a context for deterministic overlay resolution)removePop(String id)- Remove a popup by IDdismissPop(String id)- Dismiss a popup respecting its settingsremoveMultiplePops(List<String> ids)- Remove multiple overlays at onceclearAll()- Clear all active popupsdismissAllPops({bool includeInvisible, List<String> except})- Dismiss all popups with optional filtersreplacePop(PopOverlayContent content, {BuildContext? context})- Atomically replace an existing overlay by IDisVisibleById(String id)- Check if a popup is currently visiblegetVisiblePops()- Get list of all visible popup IDsgetInvisiblePops()- Get list of all invisible popup IDsvisibleCount- Number of currently visible popupsinvisibleCount- Number of currently invisible popups
PopOverlayContent
Configuration class for individual popups.
Parameters (selected):
id(String) - Unique identifier for the popupwidget(Widget) - Content widget to displayisDraggeable(bool) - Enable drag functionality (default: true)frameDesign(FrameDesign?) - Optional Frame design templateshouldDismissOnBackgroundTap(bool) - Allow dismissal by tapping outside (default: true)dismissBarrierColor(Color?) - Background overlay colorshouldAnimatePopup(bool) - Enable animations (default: true)duration(Duration?) - Auto-dismiss after a durationshouldDismissOnEscapeKey(bool) - Dismiss popup when Escape key is pressed (default: true)onMadeVisible(VoidCallback?) - Callback fired when the popup becomes visibleonDragStart(VoidCallback?) - Callback fired when drag beginsonDragEnd(VoidCallback?) - Callback fired when drag endsdragBounds(Rect?) - Constrain drag movement within specified bounds
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 callbacksubtitle(String?) - Subtitle displayed below the titletitleBarColor(Color?) - Custom color for the title barbottomBarColor(Color?) - Custom color for the bottom barheaderTrailingWidgets(List
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
Libraries
- pop_overlay
- pop_overlay package