flutter的textField设置圆形边框并且改变边框颜色,如果不修改会显示主题颜色

  return Theme(
      data: new ThemeData(primaryColor: Colors.red, hintColor: Colors.blue),
      child: TextField(
        decoration: InputDecoration(
            contentPadding: EdgeInsets.all(10.0),
            border: OutlineInputBorder(
              borderRadius: BorderRadius.circular(15.0),
//            borderSide: BorderSide(color: Colors.red, width: 3.0, style: BorderStyle.solid)//没什么卵效果
            )),
      ),
    );

给flutter的textField设置圆形边框并且改变边框颜色,如果不修改会显示主题颜色。当然如果你需要的是主题颜色,这个不需要修改

你可能感兴趣的:(Flutter,textField添加边框,textField,textField修改边框颜色)