feat: support custom AutoScrollController for Scrollbar compatibility#232
Open
MTsung wants to merge 5 commits into
Open
feat: support custom AutoScrollController for Scrollbar compatibility#232MTsung wants to merge 5 commits into
MTsung wants to merge 5 commits into
Conversation
|
Maybe add null check to @override
void dispose() {
clearState();
if (widget.controller == null) _controller.dispose();
_tocController?.jumpToIndexCallback = null;
super.dispose();
}As well as a way to remove controller from controller: widget.autoScrollController != null &&
widget.physics != NeverScrollableScrollPhysics()
? null
: _controller,This is what I did to make scroll position syncing between edit and preview mode, but also be able to use table of contents jump to index |
I have same problem of syncing position, just providing the controller fix the issue and be sure not disposing if controller provided. |
Author
fix: controller should call dispose outside
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
遇到問題
想使用 Scrollbar 或 RawScrollbar 顯示捲軸時出現錯誤訊息
修改方式
參考 Stack Overflow 69853729,允許從外部傳入 AutoScrollController。
修改後使用範例
截圖