简体   繁体   中英

Text in TextFormField goes to vanished

I'm designing a layout in which I've a TextFormField . Text in TextFormField vanished. 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(),
            ),
          ),

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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