You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A MacosTextField wrapped with Resizable Pane with expand, no maxlines crashes with the error '''FlutterError (The Scrollbar's ScrollController has no ScrollPosition attached.
A Scrollbar cannot be painted without a ScrollPosition.
The Scrollbar attempted to use the provided ScrollController. This ScrollController should be associated with the ScrollView that the Scrollbar is being applied to.When providing your own ScrollController, ensure both the Scrollbar and the Scrollable widget use the same one.)'''
Hey @robaolana, I can actually reproduce the issue.
ResizablePane has an internal Scrollable so making any widget a child of ResisablePane is some way wrapping it with Scrollable. You are supposed to give the scrollController of the ResizablePane.builder to the main widget which has a scroll behaviour in your widget tree. Since the MacosTextField like material TextField content can be scrolled when it overflows the view port it has a scroll behaviour.
Also it should not crash the app, you should just have the error stack trace in your console when scrolling the content of the MacosTextField but visually everything should seem to be working fine.
Poposal
Try this...
ResizablePane(
minSize:50,
startSize:60,
resizableSide:ResizableSide.top,
maxSize:MediaQuery.of(context).size.height /2.5,
builder: (_, scrollController) {
returnMacosTextField(
//Passing the builder scrollController to the [MacosTextField]
scrollController: scrollController,
prefix:MacosIcon(CupertinoIcons.money_dollar),
placeholder:'Type some text here',
expands:true,
maxLines:null,
showCursor:true,
clearButtonMode:OverlayVisibilityMode.always,
),);
},
)
@GroovinChip, Shouldn't be nice to add a property and maybe a Constructor that would allow the disabling of the scroll behavior of the Resizablepane ?
Sometimes I use scrollable widgets which don't expose their controller, so the only way to avoid this error is to wrap them inside another Scrollable widget which expose his controller.
Description
A MacosTextField wrapped with Resizable Pane with expand, no maxlines crashes with the error '''FlutterError (The Scrollbar's ScrollController has no ScrollPosition attached.
A Scrollbar cannot be painted without a ScrollPosition.
The Scrollbar attempted to use the provided ScrollController. This ScrollController should be associated with the ScrollView that the Scrollbar is being applied to.When providing your own ScrollController, ensure both the Scrollbar and the Scrollable widget use the same one.)'''
Use textfield with generic code like this:
The text was updated successfully, but these errors were encountered: