Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
EhiltonKazuo opened this issue Feb 9, 2024 · 0 comments

Comments

@EhiltonKazuo
Copy link

EhiltonKazuo commented Feb 9, 2024

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);
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant