【发布时间】:2021-11-23 13:35:48
【问题描述】:
我想在包含主题标签(#)时更改输入文本颜色,而不更改不包含主题标签的其他文本颜色
TextFormField(
minLines: 1,
maxLines:
5, // allow user to enter 5 line in textfield
keyboardType: TextInputType
.multiline, // user keyboard will have a button to move cursor to next line
controller:
postController.captionController,
decoration: const InputDecoration.collapsed(
hintText: 'caption',
hintStyle: TextStyle(
fontSize: 15,
)
),
style: const TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.bold),
validator: (value) {
return postController
.validateCaption(value!);
},
),
【问题讨论】:
-
我觉得你的问题和这个类似:stackoverflow.com/questions/57839668/…
标签: flutter textformfield