AwesomeDialog class

Main class for creating a dialog

Constructors

AwesomeDialog({required BuildContext context, DialogType dialogType = DialogType.info, Widget? customHeader, String? title, TextStyle? titleTextStyle, String? desc, TextStyle? descTextStyle, Widget? body, Widget? btnOk, Widget? btnCancel, String? btnOkText, IconData? btnOkIcon, void btnOkOnPress()?, Color? btnOkColor, String? btnCancelText, IconData? btnCancelIcon, void btnCancelOnPress()?, Color? btnCancelColor, void onDismissCallback(DismissType type)?, bool isDense = false, bool dismissOnTouchOutside = true, bool headerAnimationLoop = true, AlignmentGeometry alignment = Alignment.center, AnimType animType = AnimType.scale, EdgeInsetsGeometry? padding, bool useRootNavigator = false, Duration? autoHide, bool keyboardAware = true, bool dismissOnBackKeyPress = true, double? width, BorderRadiusGeometry? dialogBorderRadius, BorderRadiusGeometry? buttonsBorderRadius, bool showCloseIcon = false, Widget? closeIcon, Color? dialogBackgroundColor, BorderSide? borderSide, TextStyle? buttonsTextStyle, bool autoDismiss = true, Color? barrierColor = Colors.black54, bool enableEnterKey = false, double bodyHeaderDistance = 15.0, bool reverseBtnOrder = false, Duration transitionAnimationDuration = const Duration(milliseconds: 300)})
Constructor

Properties

alignment AlignmentGeometry
Alignment of the Dialog
final
animType AnimType
Anim Type can be { scale, leftSlide, rightSlide, bottomSlide, topSlide }
final
autoDismiss bool
Set to false when you want to pass data from custom Navigator.pop
final
autoHide Duration?
For Auto Hide Dialog after some Duration.
final
barrierColor Color?
Color of the barrier around the dialog
final
body Widget?
Create your own Widget for body, if this property is set title and description will be ignored.
final
bodyHeaderDistance double
Sets gap/distance between the top of the body and header when dialogType is DialogType.noHeader
final
borderSide BorderSide?
Set BorderSide of DialogShape
final
btnCancel Widget?
Custom Btn Cancel
final
btnCancelColor Color?
Color of the Cancel Button
final
btnCancelIcon IconData?
Icon to use for the Cancel button
final
btnCancelOnPress → (void Function()?)
Function to execute when Cancel button is pressed
final
btnCancelText String?
Text for the Cancel button
final
btnOk Widget?
Custom Btn OK
final
btnOkColor Color?
Color of the Ok Button
final
btnOkIcon IconData?
Icon to use for the Ok button
final
btnOkOnPress → (void Function()?)
Function to execute when Ok button is pressed
final
btnOkText String?
Text for the Ok button
final
buttonsBorderRadius BorderRadiusGeometry?
Border Radius for built in buttons.
final
buttonsTextStyle TextStyle?
TextStyle for built in buttons.
final
closeIcon Widget?
Custom closeIcon.
final
context BuildContext
@required
final
customHeader Widget?
Widget with priority over DialogType, for a custom header widget
final
desc String?
Set the description text of the dialog.
final
descTextStyle TextStyle?
The TextStyle of the description
final
dialogBackgroundColor Color?
Custom background color for dialog + header
final
dialogBorderRadius BorderRadiusGeometry?
Border Radius for the Dialog
final
dialogType DialogType
Dialog Type can be info, warning, error, success, noHeader
final
dismissOnBackKeyPress bool
Control if Dialog is dismiss by back key.
final
dismissOnTouchOutside bool
Barrier Dismissible
final
enableEnterKey bool
If true, then hitting Enter key will be equivalent to clicking Ok button.
final
hashCode int
The hash code for this object.
no setterinherited
headerAnimationLoop bool
Whenever the animation Header loops or not.
final
isDense bool
This Prop is usefull to Take advantage of screen dimensions
final
keyboardAware bool
Control if add or not the Padding EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom).
final
onDismissCallback → (void Function(DismissType type)?)
Callback to execute after dialog get dismissed
final
padding EdgeInsetsGeometry?
Padding off inner content of Dialog
final
reverseBtnOrder bool
Used to make Ok button appear First than Cancel.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCloseIcon bool
Control if close icon is appear.
final
title String?
Dialog Title
final
titleTextStyle TextStyle?
The TextStyle of the title
final
transitionAnimationDuration Duration
Duration of the transition animation
getter/setter pair
useRootNavigator bool
To use the Rootnavigator
final
width double?
Max with of entire Dialog.
final

Methods

dismiss() → void
Called to dismiss the dialog using the Navigator.pop method or calls the onDismissCallback function if autoDismiss is false
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
show() Future
Shows the dialog using the showGeneralDialog function
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited