Flutter: Stepper is not scrolling when added inside ListView

后端 未结 2 1501
轻奢々
轻奢々 2021-01-05 19:19

I have ListView which contains - 1. Banner Image 2. Container with some Text 3. Container with Some more Text 4. Container consist of Stepper.

I\'m unable to scrol

2条回答
  •  被撕碎了的回忆
    2021-01-05 19:49

    If the stepper is contained within another scrollable, you can set stepper physics to ClampingScrollPhysics

    Stepper(physics: ClampingScrollPhysics(), //remaing stepper code
    

    in your case you are using listview which is scrollable, by setting stepper physics to ClampingScrollPhysics() the parent widget (listview) will have the controller of stepper scroll

    Edit: as @asubanovsky stated in the comment, you can use NeverScrollableScrollPhysics() as well to be more precise for removing the scroll behavior of the current widget and let the parent widget handle it

提交回复
热议问题