smart_popup 3.0.4 smart_popup: ^3.0.4 copied to clipboard
A versatile Flutter alert dialog with lotties, images, animations, countdown timer, Loading and open duration 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 Lottie, 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 lotties 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 #
Check out the Demo Smart Popup to see Smart Popup in action!
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(
buttonAlignment: ButtonAlignment.horizontal, // Default Horizontal
title: "Smart Popup",
subTitle: "This is a smart popup. It can display alerts and messages",
primaryButtonText: "Ok",
secondaryButtonText: "Cancel",
primaryButtonTap: () {
Navigator.of(context).pop();
},
secondaryButtonTap: () {
Navigator.of(context).pop();
},
// Do not pass popType, Image and lottie simultaneously; pass one at a time.
popType: PopType.info,
// loading: true,
// imagePath: "assets/images/your_image.png", // Both asset and network images are supported
// lottiePath : "assets/images/your_lottie.json" // Both asset and network lotties are supported
// timerDelay: 10,
animationType: AnimationType.scale,
),
);