Skip to content

onConfirm isn't triggered when use confirm argument same as in onCancel #205

@EhiltonKazuo

Description

@EhiltonKazuo

I tried to use a custom widget button in confirm, but when i create a new widget with confirm argument, the onConfirm doesnt activate.

Here is the simple example

showPickerArray(BuildContext context) {
    Picker(
      adapter: PickerDataAdapter<String>(
        pickerData: [
          [0, 1, 2],
          [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
          [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
        ],
        isArray: true,
      ),
      hideHeader: true,
      selecteds: [2, 0, 3],
      title: Text(label),
      selectedTextStyle: const TextStyle(color: Colors.blue),
      cancel: TextButton(
        onPressed: () {
          Navigator.pop(context);
        },
        child: const Text(
          'Cancelar',
        ),
      ),
      confirm: TextButton(
        onPressed: () {
          Navigator.pop(context);
        },
        child: const Text(
          'Confirmar',
        ),
      ),
      onConfirm: (Picker picker, List value) {
        print(value.toString());
        print(picker.getSelectedValues());
      },
      onCancel: () {
        print('Cancelado');
      },
    ).showDialog(context);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions