show static method
void
show(
- BuildContext context, {
- Curve? curve,
- String? title,
- String? subtitle,
- bool showCancelButton = false,
- SweetAlertOnPress? onPress,
- Color? cancelButtonColor,
- Color? confirmButtonColor,
- String? cancelButtonText,
- String? confirmButtonText,
- SweetAlertStyle? style,
Implementation
static void show(BuildContext context,
{Curve? curve,
String? title,
String? subtitle,
bool showCancelButton = false,
SweetAlertOnPress? onPress,
Color? cancelButtonColor,
Color? confirmButtonColor,
String? cancelButtonText,
String? confirmButtonText,
SweetAlertStyle? style}) {
SweetAlertOptions options = new SweetAlertOptions(
showCancelButton: showCancelButton,
title: title,
subtitle: subtitle,
style: style,
onPress: onPress,
confirmButtonColor: confirmButtonColor,
confirmButtonText: confirmButtonText,
cancelButtonText: cancelButtonText,
cancelButtonColor: confirmButtonColor);
if(_state!=null){
_state!.update(options);
}else{
showDialog(
context: context,
builder: (BuildContext context) {
return new Container(
color: Colors.transparent,
child: new Padding(
padding: new EdgeInsets.all(40.0),
child: new Scaffold(
backgroundColor: Colors.transparent,
body: new SweetAlertDialog(
curve: curve,
options:options
),
),
),
);
});
}
}