cool_alert

A Flutter package to display animated alert dialogs

Usage

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

import 'package:cool_alert/cool_alert.dart';

Image

Screenshot  Gif

Example

CoolAlert.show(
   context: context,
   type: CoolAlertType.success,
   text: "Your transaction was successful!",
);

CoolAlert Class

AttributeData typeDescriptionDefault Value
contextBuildContext@requiredNull
typeCoolAlertType@required - Type of alert dialog, ex: CoolAlertType.success for success dialogsNull
titleStringSet a custom title for dialogBased on the CoolAlertType selected
textStringSet the description text of the dialog.Null
widgetWidgetSet any you expect widget of the dialog.Null
confirmBtnTextStringText of confirm button'Ok'
confirmBtnTapFunctionFunction that handle click of confirm button() => Navigator.pop(context)
confirmBtnColorColorColor of confirm ButtonTheme.of(context).primaryColor
cancelBtnTextStringText of cancel button'Cancel'
cancelBtnTapFunctionFunction that handle click of cancel button() => Navigator.pop(context)
barrierDismissibleboolDismiss dialog on touch overlaytrue
animTypeCoolAlertAnimTypeType of dialogue enter animationCoolAlertAnimType.scale
backgroundColorColorBackground color of the animationColor(0xFF515C6F)
confirmBtnTextStyleTextStyleConfirm button text themeTextStyle(color: Colors.white, fontWeight:FontWeight.w600,fontSize: 18.0)
cancelBtnTextStyleTextStyleCancel button text themeTextStyle(color: Colors.grey, fontWeight:FontWeight.w600,fontSize: 18.0)
flareAssetStringCustom flare asset"animation.flr"
flareAnimationNameStringThe name of the flare animation to play"play"
lottieAssetStringCustom lottie asset"animation.json"
autoCloseDurationDurationDetermines how long the dialog stays open for before closingNull
widthdoubleDialog widthMediaQuery.of(context).size.width
loopAnimationbooleanDetermines if the animation should loop or notfalse

Libraries

cool_alert