cool_alert_two 0.1.0 copy "cool_alert_two: ^0.1.0" to clipboard
cool_alert_two: ^0.1.0 copied to clipboard

A Flutter package to display animated alert dialogs such as success, error, warning, confirm or even a loading dialog.

cool_alert_two #

A Flutter package to display animated alert dialogs.

NOTE: this is a forked version of the original cool_alert plugin which was no longer being actively maintained at the time of writing!

Cool Alert Two includes various bug fixes and improvements that I use in my own projects and which I am aiming to maintain as a public fork. Feel free to contribute!

Usage #

To use this package, add cool_alert_two as a dependency in your pubspec.yaml file. And add this import to your file.

import 'package:cool_alert_two/cool_alert_two.dart';

Image #

Screenshot  Gif

Example #
   context: context,
   type: CoolAlertType.success,
   text: "Your transaction was successful!",

CoolAlertTwo Class #

Attribute Data type Description Default Value
context BuildContext @required Null
type CoolAlertType @required - Type of alert dialog, ex: CoolAlertType.success for success dialogs Null
title String Set a custom title for dialog Based on the CoolAlertType selected
text String Set the description text of the dialog. Null
widget Widget Set any you expect widget of the dialog. Null
confirmBtnText String Text of confirm button 'Ok'
confirmBtnTap Function Function that handle click of confirm button () => Navigator.pop(context)
confirmBtnColor Color Color of confirm Button Theme.of(context).primaryColor
cancelBtnText String Text of cancel button 'Cancel'
cancelBtnTap Function Function that handle click of cancel button () => Navigator.pop(context)
barrierDismissible bool Dismiss dialog on touch overlay true
animType CoolAlertAnimType Type of dialogue enter animation CoolAlertAnimType.scale
backgroundColor Color Background color of the animation Color(0xFF515C6F)
confirmBtnTextStyle TextStyle Confirm button text theme TextStyle(color: Colors.white, fontWeight:FontWeight.w600,fontSize: 18.0)
cancelBtnTextStyle TextStyle Cancel button text theme TextStyle(color: Colors.grey, fontWeight:FontWeight.w600,fontSize: 18.0)
flareAsset String Custom flare asset "animation.flr"
flareAnimationName String The name of the flare animation to play "play"
lottieAsset String Custom lottie asset "animation.json"
autoCloseDuration Duration Determines how long the dialog stays open for before closing Null
width double Dialog width MediaQuery.of(context).size.width
loopAnimation boolean Determines if the animation should loop or not false
pub points



A Flutter package to display animated alert dialogs such as success, error, warning, confirm or even a loading dialog.

Repository (GitHub)
View/report issues


API reference




flare_flutter, flutter, lottie, vector_math


Packages that depend on cool_alert_two