如何隐藏文本框边框后面的东西?

How to hide the things behind the textfield border?

我正在尝试制作一个带有圆角边框和一些投影的文本字段, 当我使用海拔时它显示了边界外的一些部分,请看一下我附上的图片。

Container(
      child: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Container(
          height: 30.0,
          child: Material(
            elevation: 2.0,
            shadowColor: Colors.grey,
            child: TextField(
              autofocus: false,
              style: TextStyle(
                  color: Colors.black,
              ),
              decoration: kTextFieldDecorationCircular,
              onChanged: (value){
                searchWord = value;
              },
              onEditingComplete: searchTheWord,
            ),
          ),
        ),
      ),
    );

const kTextFieldDecorationCircular = InputDecoration(
  contentPadding: EdgeInsets.all(2.0),
  filled: true,
  fillColor: Colors.white,
  prefixIcon: Icon(Icons.search, color: Colors.grey,),
  hintText: 'Search',
  hintStyle: TextStyle(color: Colors.grey),
  border: OutlineInputBorder(
      borderRadius: BorderRadius.all(Radius.circular(50.0)),
  ),
);

这是我的代码。 提前谢谢你。

您可以将此添加到您的 Material 小部件:

borderRadius: BorderRadius.all(Radius.circular(50.0)),