cool_alert 1.1.0
cool_alert: ^1.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 #

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
139
likes
120
pub points
95%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flare_flutter, flutter, lottie, vector_math

More

Packages that depend on cool_alert