Skip to content

Use NumberPicker in a AlertDialog #158

@manuelarte

Description

@manuelarte

Hi,

is it possible to use NumberPicker in an alertdialog widget, I have the following code but I can't move the picker:

Future<void> _onClick() async {
    showDialog<void>(context: context, builder: (BuildContext context) {
      return AlertDialog(
          content: NumberPicker(
            value: widget.value,
            minValue: 0,
            maxValue: 40,
            onChanged: (value) {
              setState(() {
                widget.value= value;
              });
            },
          )
      );
    },
    );
  }

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