awesome_dialog 1.2.0

Flutter Android iOS web

Flutter package to show beautiful dialogs with animations as simply as possible.

awesome_dialog #

A new Flutter package project for simple and awesome dialogs

Usage #

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

import 'package:awesome_dialog/awesome_dialog.dart';

Image #

alt text

Example #

AwesomeDialog(
            context: context,
            dialogType: DialogType.INFO,
            animType: AnimType.BOTTOMSLIDE,
            title: 'Dialog Title',
            desc: 'Dialog description here.............',
            btnCancelOnPress: () {},
            btnOkOnPress: () {},
            )..show();

Custom Body #

If the body is specified, then title and description will be ignored, this allows to further customize the dialogue.

AwesomeDialog(
            context: context,
            animType: AnimType.SCALE,
            dialogType: DialogType.INFO,
            body: Center(child: Text(
                    'If the body is specified, then title and description will be ignored, this allows to further customize the dialogue.',
                    style: TextStyle(fontStyle: FontStyle.italic),
                  ),),
            title: 'This is Ignored',
            desc:   'This is also Ignored',
            btnOkOnPress: () {},
                 )..show();

Custom Button #

To use custom buttons, just specify the buttonOk or btnCancel widget, all text parameters icon etc will be ignored.

Dissmiss and Callback #

AwesomeDialog has onDissmissCallback() and can be dissmissed at any time using dissmiss() public method.

AwesomeDialog Class #

Dart attributeDatatypeDescriptionDefault Value
dialogTypeDialogTypeSet DialogType example: DialogType.INFO, this create an animated Header.Null
customHeaderWidgetCreate your own header(if this is set DiaologType is ignored.)Null
widthdoubleThe maximum width of the dialog, especially useful in web flutter, or landscape modeMediaQuery.of(context).size.width.
titleStringSet the title of dialog.Null
descStringSet the description text of the dialog.Null
bodyWidgetCreate your own Widget for body, if this property is set title and description will be ignored.Null
contextBuildContext@requiredNull
btnOkTextStringText of positive button'Ok'
btnOkIconIconDataIcon of positive buttonNull
btnOkOnPressFunctionFunction that handle click of postive Button, closing the dialog is handled internally.Null
btnOkColorColorColor of postive ButtonColor(0xFF00CA71)
btnOkWidgetAllows to create a custom button, if this property is different from null then btnOkText, btnOkIcon, btnOkOnPress, btnOkColor will be ignorednull
btnCancelTextStringText of negative button'Cancel'
btnCancelIconIconDataIcon of negative buttonNull
btnCancelOnPressFunctionFunction that handle click of negative Button, closing the dialog is handled internally.Null
btnCancelColorColorColor of negative ButtonColors.red
btnCancelWidgetAllows to create a custom button, if this property is different from null then btnCancelText, btnCancelIcon, btnCancelOnPress, btnCancelColor will be ignorednull
dismissOnTouchOutsideboolDissmiss dialog on touch overlaytrue
onDissmissCallbackFunctionDissmiss callback funtionNull
animTypeAnimTypeType of dialogue enter animationAnimType.SCALE
aligmentAlignmentGeometrydialogue aligment gravityAlignment.center
useRootNavigatorboolUse the root navigator instead than the local. This is useful when the defaut cancel go to the previous screen instead to just close the dialogfalse
headerAnimationLoopboolheaderAnimationLoop control the loop for animation headertrue
paddingEdgeInsetsGeometryThe padding of dialog elemetsEdgeInsets.only(left: 5, right: 5),
autoHideDurationHide the Dialog after this Durationnull
keyboardAwareboolControl if add or not the Padding EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom).true
dismissOnBackKeyPressboolcontrol if AwesomeDialog is dissmisable by back button.true
210
likes
110
pub points
96%
popularity

Flutter package to show beautiful dialogs with animations as simply as possible.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

marcos930807@gmail.com

License

BSD (LICENSE)

Dependencies

flare_flutter, flutter, simple_animations

More

Packages that depend on awesome_dialog