嘿,我希望标签文本位于 的顶部边框下方onFocusedBorder
,TextFormField
而不是顶部边框之间。我怎样才能做到这一点?嘿,我希望标签文本位于 的顶部边框下方onFocusedBorder
,TextFormField
而不是顶部边框之间。我怎样才能做到这一点?
下面是代码TextFormFeild
下面是代码TextFormFeild
Theme(
data: Theme.of(context).copyWith(primaryColor: Colors.black),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(33)),
child: Container(
color: Colors.white,
height: deviceSize
.height, // Ignore this
child: TextFormField(
style: TextStyle(color: Colors.black), // Text written color
controller: _controller,
cursorColor: Colors.black,
decoration: InputDecoration(
fillColor: Colors.black,
labelText: "What are you looking for?",
labelStyle: TextStyle(
color: Colors.black.withOpacity(0.7),
fontSize: deviceSize.height * 0.4,
),
prefixIcon: IconButton(
color: Colors.black.withOpacity(0.5),
icon: Icon(
Icons.search,
size: deviceSize.height * 0.6,
),
onPressed: () {
// Search functionality here
},
),
suffixIcon: IconButton(
color: Colors.black.withOpacity(0.8),
icon: Icon(
Icons.filter_list,
size: deviceSize.height * 0.6,
),
onPressed: () => _controller.clear(),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(33),
borderSide: BorderSide(
color: Colors.brown,
width: 0.7,
style: BorderStyle.solid),
),
),
),
),
),
),