Flutter TextField怎样去除下划线及有焦点时颜色

修改方法
只有把
enabledBorder: new UnderlineInputBorder
focusedBorder: new UnderlineInputBorder
设置为 borderSide: BorderSide.none, 即可,修改焦点时颜色都可以在这里定义

      Container(
                  padding: EdgeInsets.only(left: 18.0, right: 18.0),
                  height: 150.0,
                  child: new TextField(
                    controller: _mnemonicController,
                    keyboardType: TextInputType.text,
                    maxLength: 150,
                    onChanged: (value) {
                      setState(() {});
                    },
                    autofocus: false,
                    decoration: InputDecoration(
                      enabledBorder: new UnderlineInputBorder( //没有焦点时
                        borderSide: BorderSide.none,
                      ),
                      focusedBorder: new UnderlineInputBorder(  //有焦点时
                        borderSide: BorderSide.none,
                      ),
                      contentPadding:
                          EdgeInsets.symmetric(vertical: 10, horizontal: 10),
                      hintText:
                          S.of(context).string_wallet_enter_receive_amount,
                      counterText: '',
                    ),
                  ),
                ),
上一篇:用Java编写一个简单的乘法计算器


下一篇:Flutter 实现不同样式(有样式) 的TextField (可自定义),类似微博#话题#、@用户,(给TextField加TextSpan)