Flutter 颤振中三边圆形文本输入字段和一侧矩形
我需要添加一个文本字段,它有三个圆形边和一个右上角的矩形边。 我正试图用OutlineInputBorder实现这一点,它给了我边界。 然而,我需要实现这个设计 由于我没有足够的声誉,我不允许添加图像。 如果有人帮我的话会有帮助的Flutter 颤振中三边圆形文本输入字段和一侧矩形,flutter,textinput,Flutter,Textinput,我需要添加一个文本字段,它有三个圆形边和一个右上角的矩形边。 我正试图用OutlineInputBorder实现这一点,它给了我边界。 然而,我需要实现这个设计 由于我没有足够的声誉,我不允许添加图像。 如果有人帮我的话会有帮助的 new Theme( data: new ThemeData( primaryColor: Colors.blue, ), child: TextFormField(
new Theme(
data: new ThemeData(
primaryColor: Colors.blue,
),
child: TextFormField(
style: new TextStyle(
color: Color(0xff651515),
),
autofocus: false,
obscureText: false,
keyboardType: TextInputType.text,
decoration: InputDecoration(
filled: true,
border: new OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10))
),
fillColor: Colors.black12,
labelText: TextDisplayConstants.EMAIL,
labelStyle: TextStyle(
color: Color(0xffa4a4a4),
fontSize: 14,
),
),[enter image description here][1]
),
),
尝试一下这个:
演示:
示例代码:
OutlineInputBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),
bottomRight: Radius.circular(10),
topRight: Radius.circular(0)),
)
只需在Textformfield代码中替换边框
border: new OutlineInputBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(0),
),
),
在需要矩形边框的一侧添加半径.circular(0),例如,bottomRight:Radius.circular(0)
TextFormField
TextFormField(
style: new TextStyle(
color: Color(0xff651515),
),
autofocus: false,
obscureText: false,
keyboardType: TextInputType.text,
decoration: InputDecoration(
filled: true,
border: new OutlineInputBorder(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(20),topLeft: Radius.circular(20),topRight: Radius.circular(20))
),
fillColor: Colors.black12,
labelStyle: TextStyle(
color: Color(0xffa4a4a4),
fontSize: 14,
),
)
),
而且,如果有人需要使用颜色作为边框,你可以使用像------borderSide:borderSide(颜色:Colors.transparent)。
TextFormField(
style: new TextStyle(
color: Color(0xff651515),
),
autofocus: false,
obscureText: false,
keyboardType: TextInputType.text,
decoration: InputDecoration(
filled: true,
border: new OutlineInputBorder(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(20),topLeft: Radius.circular(20),topRight: Radius.circular(20))
),
fillColor: Colors.black12,
labelStyle: TextStyle(
color: Color(0xffa4a4a4),
fontSize: 14,
),
)
),