Sweet alert

Sweet alert

Different styles of sweet alerts are prepared by the flutter code in admin panel.

these are sweet alerts that the art_sweetalert package is added in pubspec.yaml 's dependencies
 and is used as:

  onTap: () {
                  ArtSweetAlert.show(
                      context: context,
                      artDialogArgs: ArtDialogArgs(
                          type: ArtSweetAlertType.danger,
                          title: "Oops...",
                          text: "There is a problem :("
                      )
                  );
                },

 

 

onTap: () {
                  ArtSweetAlert.show(
                      context: context,
                      artDialogArgs: ArtDialogArgs(
                          type: ArtSweetAlertType.question,
                          title: "A question?",
                          text: "Show a question message with an icon"
                      )
                  );
                },

   

 

 onTap: () {
                  ArtSweetAlert.show(
                      context: context,
                      artDialogArgs: ArtDialogArgs(
                      type: ArtSweetAlertType.success,
                      title: "A success message!",
                      text: "Show a success message with an icon"
                  ));
                },

 

 

onTap: () async {
                  ArtDialogResponse response = await ArtSweetAlert.show(
                      barrierDismissible: false,
                      context: context,
                      artDialogArgs: ArtDialogArgs(
                          denyButtonText: "Cancel",
                          title: "Are you sure?",
                          text: "You won't be able to revert this!",
                          confirmButtonText: "Yes, delete it",
                          type: ArtSweetAlertType.warning
                      )
                  );

                  if(response==null) {
                    return;
                  }

                  if(response.isTapConfirmButton) {
                    ArtSweetAlert.show(
                        context: context,
                        artDialogArgs: ArtDialogArgs(
                            type: ArtSweetAlertType.success,
                            title: "Deleted!"
                        )
                    );
                    return;
                  }
                },

 

 

 onTap: () async {
                      ArtDialogResponse response = await ArtSweetAlert.show(
                          barrierDismissible: false,
                          context: context,
                          artDialogArgs: ArtDialogArgs(
                            showCancelBtn: true,
                            denyButtonText: "Don't save",
                            title: "Do you want to save the changes?",
                            confirmButtonText: "Save",
                          )
                      );

                      if(response==null) {
                        return;
                      }

                      if(response.isTapConfirmButton) {
                        ArtSweetAlert.show(
                            context: context,
                            artDialogArgs: ArtDialogArgs(
                                type: ArtSweetAlertType.success,
                                title: "Saved!"
                            )
                        );
                        return;
                      }

                      if(response.isTapDenyButton) {
                        ArtSweetAlert.show(
                            context: context,
                            artDialogArgs: ArtDialogArgs(
                                type: ArtSweetAlertType.info,
                                title: "Changes are not saved!"
                            )
                        );
                        return;
                      }

                    },

 

 

 

onTap: () async {
                      ArtSweetAlert.show(
                          context: context,
                          artDialogArgs: ArtDialogArgs(
                              title: "Sweet!",
                              text: "Modal with a custom image.",
                              customColumns: [
                                Container(
                                  margin: EdgeInsets.only(
                                      bottom: 12.0
                                  ),
                                  child: Image.asset(
                                    "assets/images/img2.jpg",

                                  ),

                                )
                              ]

                          )
                      );
                    },