flutter 输入框设置圆角+无边框

相较于css 的圆角和边框是分开的
flutter TextField的圆角是在border 上
所以,只能在外面包一层,设置圆角,然后去掉输入框的边框

					Container(
                      margin: const EdgeInsets.only(left: 10),
                      decoration: BoxDecoration(
                          color: Colors.white60,
                          border: Border.all(color: Colors.white60, width: 0.5),
                          borderRadius: BorderRadius.circular((20.0))),
                      child: const TextField(
                          decoration: InputDecoration(
                              hintText: "请输入用户名",
                              prefixIcon: Icon(Icons.search),
                              contentPadding: EdgeInsets.only(top: 4, left: 10),
                              border: InputBorder.none)),
                    )

版权声明:本文为m0_56823974原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。