I have a SingleChildScrollView widget whose child is a Form widget in Flutter. Whenever I made some changes to the radio buttons or switches inside the form and calling setState() method, the view scrolls to the top. How can I avoid this behavior?
相关问题
- Laravel Option Select - Default Issue
- HTML form is not sending $_POST values
- How to use Control.FromHandle?
- Use JS/jQuery to scroll a div's content that h
- Jscrollpane - Fires a function when isAtBottom
相关文章
- Observatory server failed to start - Fails to crea
- Flutter error retrieving device properties for ro.
- Show a different value from an input that what wil
- Adding Shadows at the bottom of a container in flu
- How can I detect/watch “dirty-status” of an angula
- SwiftUI automatically scroll to bottom in ScrollVi
- Flutter. Check if a file exists before loading it
- Flutter - http.get fails on macos build target: Co
I would recommend passing through a custom ScrollController when constructing your SingleChildScrollView widget.
ScrollController has a property called 'keepScrollOffset' which you need to set to true.
From the documentation at https://docs.flutter.io/flutter/widgets/ScrollController-class.html
keepScrollOffset → bool Each time a scroll completes, save the current scroll offset with PageStorage and restore it if this controller's scrollable is recreated. [...] final