Orientação gerada a partir de informações públicas. Apenas para referência.
Awesome Dialog é um pacote do Flutter que permite aos desenvolvedores exibir diálogos visualmente atraentes com animações suaves para vários tipos de alertas, como INFO, PERGUNTA, AVISO, SUCESSO e ERRO. Projetado para simplicidade, permite integração rápida com poucas linhas de código. O pacote suporta múltiplas plataformas, incluindo Android, iOS, Web, macOS, Windows e Linux, tornando-o ideal para aplicativos multiplataforma. Com temas personalizáveis e efeitos de animação embutidos, ele melhora a experiência do usuário sem exigir configurações complexas.
Casos de uso
Exibindo alertas do aplicativo
Exibindo diálogos de confirmação
Melhorando o feedback do usuário
Criando mensagens de sucesso ou erro
Adicionando notificações animadas
Principais recursos
Tipos de diálogos pré-definidos
Animações suaves
Suporte multiplataforma
Configuração mínima
Aparência personalizável
Temas embutidos
Indicado para
Desenvolvedores iniciantes do Flutter
Aplicativos que precisam de feedback visual
Projetos multiplataforma
Melhorias simples na interface
Prototipagem rápida
Considerações
Personalização limitada além do estilo básico
Pode exigir estilos adicionais para designs avançados
Depende de biblioteca externa de animação
Não adequado para interfaces modais complexas
Desempenho de animação em dispositivos de baixa gama
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
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.
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 onDismissCallback(type) and can be dismissed at any time using dismiss() public method.
AwesomeDialog Class
Dart attribute
Datatype
Description
Default Value
dialogType
DialogType
Set DialogType example: DialogType.info, this create an animated Header.
Null
customHeader
Widget
Create your own header(if this is set DiaologType is ignored.)
Null
width
double
The maximum width of the dialog, especially useful in web flutter, or landscape mode
MediaQuery.of(context).size.width.
title
String
Set the title of dialog.
Null
desc
String
Set the description text of the dialog.
Null
body
Widget
Create your own Widget for body, if this property is set title and description will be ignored.
Null
context
BuildContext
@required
Null
btnOkText
String
Text of positive button
'Ok'
btnOkIcon
IconData
Icon of positive button
Null
btnOkOnPress
Function
Function that handle click of positive Button, closing the dialog is handled internally.
Null
btnOkColor
Color
Color of positive Button
Color(0xFF00CA71)
btnOk
Widget
Allows to create a custom button, if this property is different from null then btnOkText, btnOkIcon, btnOkOnPress, btnOkColor will be ignored
null
btnCancelText
String
Text of negative button
'Cancel'
btnCancelIcon
IconData
Icon of negative button
Null
btnCancelOnPress
Function
Function that handle click of negative Button, closing the dialog is handled internally.
Null
btnCancelColor
Color
Color of negative Button
Colors.red
btnCancel
Widget
Allows to create a custom button, if this property is different from null then btnCancelText, btnCancelIcon, btnCancelOnPress, btnCancelColor will be ignored
null
buttonsBorderRadius
BorderRadiusGeometry
Allows to customize buttons border radius
BorderRadius.all(Radius.circular(100))
dismissOnTouchOutside
bool
Dismiss dialog on touch overlay
true
onDismissCallback
Function
Dismiss callback function
Null
animType
AnimType
Type of dialogue enter animation
AnimType.SCALE
alignment
AlignmentGeometry
dialogue alignment gravity
Alignment.center
useRootNavigator
bool
Use the root navigator instead than the local. This is useful when the default cancel go to the previous screen instead to just close the dialog
false
headerAnimationLoop
bool
headerAnimationLoop control the loop for animation header
true
padding
EdgeInsetsGeometry
The padding of dialog elements
EdgeInsets.only(left: 5, right: 5),
autoHide
Duration
Hide the Dialog after this Duration
null
keyboardAware
bool
Control if add or not the Padding EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom).
true
dismissOnBackKeyPress
bool
control if AwesomeDialog is dismissible by back button.