Flutter TextFormField 文本在溢出时隐藏

2024-02-25

当我达到极限时文本表单字段文字消失... 我尝试了多个配置但仍然不起作用,我不知道为什么。

Dialog(
        shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(6.0)), //this right here
        child: Container(
            height: 400.0,
            child: Column(children: <Widget>[
              Expanded(
                child: new Align(
                    alignment: FractionalOffset.center,
                    child: Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: <Widget>[
                          Icon(Icons.account_circle, color: Colors.blue),
                          Text('Test')
                        ])),
              ),
              Expanded(
                  child: new Padding(
                padding: EdgeInsets.only(left: 10, right: 10, top: 10),
                child: new Align(
                    alignment: FractionalOffset.centerLeft,
                    child: TextFormField(
                        initialValue: _inputs[0],
                        onChanged: (text) {
                          _inputs[0] = text;
                          checkOkEnabled();
                        },
                        autocorrect: false,
                        decoration: InputDecoration(
                            border: OutlineInputBorder(),
                            labelText: 'Mme  / M',
                            hintText: 'test'))),
              )),]))))

Same problem on two device : enter image description here

And Error字段也以奇怪的方式隐藏。

The Expanded是在一个容器高度为400。


in InputDecoration, add isDense: true and contentPadding: EdgeInsets.zero

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Flutter TextFormField 文本在溢出时隐藏 的相关文章

随机推荐