简体   繁体   English

Flutter - 如何在带有图标的错误文本上获取文本表单字段

[英]Flutter - How to get text form field on error text with icon

I try to implemnt the validation error message but, Based on on my UI i need to implement the text with icon, i search online i fond errorborder but not icon besed of errortext.我尝试实现验证错误消息,但是,基于我的用户界面,我需要实现带有图标的文本,我在网上搜索我喜欢错误边框,但不是错误文本的图标。 How to implement the validation error text with icon?如何实现带有图标的验证错误文本?

TextField(
                        autocorrect: true,
                        autofocus: false,
                        controller: reasonController,
                        style: textfieldlableStyle,
                        textInputAction: TextInputAction.done,
                        textCapitalization: TextCapitalization.sentences,
                        keyboardType: TextInputType.multiline,
                        maxLines: 10,
                        maxLength: null,
                        decoration: InputDecoration(
                          isDense: true,
                          hintText: "I’m canceling because",
                          hintStyle: TextStyle(
                              fontFamily: "regular",
                              color: MyColors.fieldLabel,
                              fontSize: 16),
                          focusedBorder: null,
                          errorBorder:OutlineInputBorder(
                              borderRadius: BorderRadius.all(Radius.circular(4)),
                              borderSide: BorderSide(
                                width: 1,
                                color: Colors.red,
                              )),
                          errorText: _cancelValidate ? 'Details can\'t be Empty' : null,
                          contentPadding:
                          EdgeInsets.only(bottom: 4, top: 0),
                        )),

I want this type of implementation我想要这种类型的实现

["

你可以在这里使用 unicode<\/p>


errorText: _cancelValidate ? '\u24d8 Details can\'t be Empty' : null,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM