smart_popup 2.0.1 smart_popup: ^2.0.1 copied to clipboard
A versatile Flutter alert dialog with videos, images, animations, countdown timer, and Loading state for buttons etc.
Smart Popup #
Smart Popup is a customizable alert dialog widget for Flutter applications. It offers various features, including support for Image and Video, custom widgets, animations, countdown timers,loading button and responsive design. This widget is highly configurable to fit a wide range of use cases in your application.
Features #
Media Support:
Display images or videos within the dialog, providing rich content experiences.Customizable Dialog:
Easily adjust the title, description, and buttons to fit your app's needs.Animations:
Choose from various animation types (fade, scale, slide) to create engaging transitions.Countdown Timer:
Integrate a countdown timer to add urgency to user interactions.Loading Indicators:
Show loading states on buttons to inform users of ongoing processesClose Button:
Hidable close buttonCustom Widgets:
Include additional custom widgets within the dialog for enhanced functionality.Responsive Design:
The widget adapts to different screen sizes, ensuring a seamless experience on both mobile and desktop platforms.
Examples #
Installation #
Add this package to your pubspec.yaml
file:
dependencies:
smart_popup: ^latest_version
Usage #
To use the Smart Popup, simply create an instance of the widget and configure the desired properties, such as media paths, title, description, button texts, and animations.
showDialog(
context: context,
builder: (context) => SmartPopup(
title: "Alert Title",
subTitle: "This is an alert message.",
firstButtonText: "Confirm",
secondButtonText: "Cancel",
firstButtonTap: () {
Navigator.of(context).pop();
},
secondButtonTap: () {
Navigator.of(context).pop();
},
// Do not pass image and video simultaneously; pass one at a time.
//imagePath: "assets/images/your_image.png",
videoPath: "assets/videos/your_video.mp4",
videoVolume: 100,
videoPlayBackSpeed: 2.5,
timerDelay: 10,
animationType: AnimationType.scale,
),
);