show static method

void show(
  1. BuildContext context, {
  2. Curve? curve,
  3. String? title,
  4. String? subtitle,
  5. bool showCancelButton = false,
  6. SweetAlertOnPress? onPress,
  7. Color? cancelButtonColor,
  8. Color? confirmButtonColor,
  9. String? cancelButtonText,
  10. String? confirmButtonText,
  11. 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
                ),
              ),
            ),
          );
        });
  }

}