admin管理员组文章数量:1391836
The title may be a bit meaningless, I couldn't think of a better title. I'm sorry. In Flutter, I want to make a TextFormField
like this:
I want to make a customizable TextFormField
. This TextFormField
should have an array field in the form of customTextPatterns. In the array, the key part is the regex pattern, the value part is the way to show the content that matches the pattern.
For example, I want to be able to give the Container
> Text
widget instead of the text corresponding to the ^(0|[1-9][0-9]*)$
pattern (this is the number one regex pattern). Just like in the screenshot. In addition, for example, if the user writes a link, the Container
> Text
widget should be shown again. For example, if the user typed something like this in TextFormField
:
“Hello, is a very nice site!”, the background of the link will be colored and the writing style will be different. Of course, if the user starts deleting, the link should be completely deleted. i.e. if the user hits the delete button at the end of stackoverflow
, the link should be completely deleted along with the Container
.
How can I make such a custom TextFormField
widget? I searched and thought for a long time but unfortunately I couldn't think of a solution.
I am grateful in advance for your support. :)
The title may be a bit meaningless, I couldn't think of a better title. I'm sorry. In Flutter, I want to make a TextFormField
like this:
I want to make a customizable TextFormField
. This TextFormField
should have an array field in the form of customTextPatterns. In the array, the key part is the regex pattern, the value part is the way to show the content that matches the pattern.
For example, I want to be able to give the Container
> Text
widget instead of the text corresponding to the ^(0|[1-9][0-9]*)$
pattern (this is the number one regex pattern). Just like in the screenshot. In addition, for example, if the user writes a link, the Container
> Text
widget should be shown again. For example, if the user typed something like this in TextFormField
:
“Hello, https://stackoverflow is a very nice site!”, the background of the link will be colored and the writing style will be different. Of course, if the user starts deleting, the link should be completely deleted. i.e. if the user hits the delete button at the end of stackoverflow
, the link should be completely deleted along with the Container
.
How can I make such a custom TextFormField
widget? I searched and thought for a long time but unfortunately I couldn't think of a solution.
I am grateful in advance for your support. :)
Share Improve this question edited Mar 12 at 6:39 DarkBee 15.5k8 gold badges72 silver badges118 bronze badges asked Mar 12 at 5:45 Burak ŞanlıBurak Şanlı 351 silver badge4 bronze badges 1- Type "richtext editor" into the pub search. Many possible packages. – Randal Schwartz Commented Mar 12 at 6:01
1 Answer
Reset to default 1Try using rich_editor or flutter_quill package
本文标签: flutterHow to put text in a square in TextFormFieldStack Overflow
版权声明:本文标题:flutter - How to put text in a square in TextFormField? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744768838a2624210.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论