scrollbar的Textfield?
我不是要用滚动条制作一个文字场,但是有一个特定的设计,但是我不能摩得这个标准,如果有人有解决方案,我搜索包裹或解决方案,但我没有一个解决方案,所以我在这里问也许有人可以帮助我。
有一张我试图达到的照片。
这就是我所拥有的。
我的代码,
MediaQuery.removePadding(
context: context,
removeTop: true,
child: Scrollbar(
radius: const Radius.circular(5),
interactive: true,
isAlwaysShown: true,
trackVisibility: true,
controller: scrollController,
child: TextField(
scrollController: scrollController,
scrollPhysics: const BouncingScrollPhysics(),
scrollPadding: EdgeInsets.zero,
感谢Advance。
i wan't to made a textfield with a scrollbar, but with a specific design, but i cannot moove this bar, if someone have the solution, i search a package or some solution but i don't have one, so i ask here maybe someone can help me.
There is a picture of what i try to reach.
and this is what i have.
My code,
MediaQuery.removePadding(
context: context,
removeTop: true,
child: Scrollbar(
radius: const Radius.circular(5),
interactive: true,
isAlwaysShown: true,
trackVisibility: true,
controller: scrollController,
child: TextField(
scrollController: scrollController,
scrollPhysics: const BouncingScrollPhysics(),
scrollPadding: EdgeInsets.zero,
Thanks by advence.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
SINGLECHILDSCROLLVIEW
创建自己的scrollableTexfield
,例如:小部件有两个参数可以提供
占位符
和textedingedingcontroller
。在代码中,我使用
textfield
具有多个输入行,并且在文本更改时,我更新了拇指位置。FrameCallback
用于确保在选择ALL和DELETE操作之后进行更新。定位的
小部件用于可视化拇指和跟踪。可以这样使用。我在小部件本身之外添加了一些
装饰
,但是可以嵌入其中。You could create own
ScrollableTexField
usingSingleChildScrollView
like this:The widget has two parameters to provide
Placeholder
andTextEditingController
.In the code I use
TextField
with multiple lines of input and on change of the text I update the thumb position.PostFrameCallback
is used to ensure that thumb would be updates after for example select all and delete operation.Positioned
widgets are used to visual the Thumb and Track.It can be used like this. I added some
Decoration
outside of the widget itself, but it can be embedded inside.