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
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:
- Tapping items is not working in CupertinoPicker
- ListWheelScrollView children do not respond on gesture (onTap) events
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)