Added optional param for scrollController #139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear code reviewers,
I am submitting this pull request to add a scroll controller to our trimmer listview widget in Flutter.
The scroll controller is an essential aspect of any scrolling widget, as it allows us to control the position and movement of the listview. In particular, for a trimmer listview, having a scroll controller is crucial to implement features such as adjusting the visible items, or moving to a specific item in the list based on user input.
The scroll controller provides several parameters that can be used to customize the scrolling behavior of the listview, such as:
initialScrollOffset
: sets the initial scroll offset when the listview is first displayed.keepScrollOffset
: determines whether the scroll offset is preserved when the widget is rebuilt.debugLabel
: sets a label for the scroll controller, useful for debugging purposes.By adding a scroll controller to our trimmer listview, we can ensure that the scrolling behavior is consistent, smooth, and easily adjustable. It also enables us to add new functionality that requires a precise control over the scrolling.
Additionally, I would like to bring to your attention that when using the
updateTrim(x, 1.0)
method, the scroll position may not be modified as expected. To overcome this issue, we need to manually update the scroll position using thejumpTo
oranimateTo
methods provided by the scrollController.Here's an example of how to use these methods to ensure that the scroll position is updated correctly:
I hope you will find this change useful and I look forward to your feedback.
Best regards,