NumberPicker icon indicating copy to clipboard operation
NumberPicker copied to clipboard

Flutter 2.5 Web AlertDialog + numberpicker

Open nwnwnwnwnw opened this issue 4 years ago • 4 comments

Flutter 2.5 Web the numberpicker's scroll in AlertDialog is not working any more

nwnwnwnwnw avatar Sep 16 '21 05:09 nwnwnwnwnw

same issues :(.

anh-ht avatar Nov 08 '21 08:11 anh-ht

Any fix regarding this? its showing value in onchange but doesn't update state variables.

Muhammad-Hammad avatar Nov 11 '21 12:11 Muhammad-Hammad

wrap the NumberPicker with ScrollConfiguration and provide the behavior property. By default Scroll View mouse drag gesture is disabled in Flutter.

https://docs.flutter.dev/release/breaking-changes/default-scroll-behavior-drag

ScrollConfiguration(
  behavior: ScrollConfiguration.of(context).copyWith(dragDevices: {
    // enable touch and mouse gesture
    PointerDeviceKind.touch,
    PointerDeviceKind.mouse,
  }),
  child: NumberPicker(),
);

deepak786 avatar Dec 30 '21 11:12 deepak786

Check this answer: https://stackoverflow.com/questions/69608373/flutter-numberpicker-in-alertdialog-doesnt-work-properly

The StateFulBuilder seems to fix the issue!

darkwilly08 avatar Jan 07 '22 12:01 darkwilly08