Skip to content

ReactiveImagePicker: how to make deleteDialogBuilder? #156

@Dionnie

Description

@Dionnie

I tried many approach, the image still stays when I confirm delete on dialog.

  deleteDialogBuilder: (context, onConfirm) {
        return showDialog<void>(
          context: context,
          barrierDismissible: false, // User must tap button to dismiss dialog
          builder: (BuildContext dialogContext) {
            return AlertDialog(
              title: const Text('Delete File'),
              content:
                  const Text('Are you sure you want to delete this file?!!'),
              actions: <Widget>[
                TextButton(
                  child: const Text('Cancel'),
                  onPressed: () {
                    Navigator.of(dialogContext).pop(); // Dismiss the dialog
                  },
                ),
                TextButton(
                  child: const Text('Delete'),
                  onPressed: () {
// Call the onDelete callback
                       onConfirm(SelectedFile.image());

                    Navigator.of(dialogContext).pop(); // Dismiss the dialog
                  },
                ),
              ],
            );
          },
        );
      },

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions