Pick Value onTap in CupertinoPicker and CupertinoDatePicker

Issue

onSelectedItemChanged is working perfectly in CupertinoPicker/CupertinoDatePicker

But I also want to pick value when user clicked the value.

Currently, user must scroll in order to pick the value, and as far as I know CupertinoPicker/CupertinoDatePicker doesn’t have onTap, onPressed functions

How can I solve this issue

enter image description here

Solution

Unfortunately, the gesture detection inside CupertinoPicker/CupertinoDatePicker is not supported for now. When you trace the code inside CupertinoPicker, it leads to use ListWheelScrollView at the end and it does not respond to the tap event.

Discussion thread on GitHub:

There is a workaround solution by using package clickable_list_wheel_view (fixed height for the child widget, mentioned here)

Answered By – yellowgray

Answer Checked By – Gilberto Lyons (FlutterFixes Admin)

Leave a Reply

Your email address will not be published.