简体   繁体   English

TextFormField 中的文本消失了

[英]Text in TextFormField goes to vanished

I'm designing a layout in which I've a TextFormField .我正在设计一个布局,其中有一个TextFormField Text in TextFormField vanished. TextFormField文本消失了。 I want text remain on first line.我希望文本保留在第一行。

This is how it looks when I enter text这是我输入文字时的样子

在此处输入图片说明

And this is how it looks when I enter more text这就是我输入更多文本时的样子

在此处输入图片说明

Here is my code这是我的代码

Container(
            margin: EdgeInsets.only(left: 96, right: 96),
            width: 171.0,
            height: 22.0,
            child: TextFormField(
              keyboardType: TextInputType.emailAddress,
              decoration: loginPageInputDecoration(),
            ),
          ),

loginPageInputDecoration登录页面输入装饰

 InputDecoration loginPageInputDecoration() {
  return const InputDecoration(
    border: InputBorder.none,
    fillColor: fTextFieldColor,
    filled: true,
  );
}

Increase height of the Container as per your choice and the issue will be solved根据您的选择增加容器的高度,问题将得到解决

Container(
            margin: EdgeInsets.only(left: 96, right: 96),
            width: 171.0,
            height: 44.0,
            child: TextFormField(
              keyboardType: TextInputType.emailAddress,
              decoration: loginPageInputDecoration(),
            ),
          ),

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

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