Pick Value onTap in CupertinoPicker and CupertinoDatePicker
544
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)
Comments
-
SardorbekR over 1 year
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
-
meditat over 3 yearsif you tap on an item, it will lead to scroll to that position, so the onSelectedItemChanged will be invoked.
-
SardorbekR over 3 years@meditat Please, could you clarify your answer? (tapping on an item is not invoking onSelectedItemChanged function)
-
-
Iván Yoed about 3 yearsIt is indeed not working. Me as well tried to figure out a way, but the furthest I got to, was to that github issue.