I'm using TextField widget in AppBar()
there is one problem , as you can see I cannot set cursor color when textfield focused
usually, textfield cursor blinks when it focused.
I set cursor color property , every color property in appbar, textfield but it doesn't work even textfield hint text doens't work too.
appBar: AppBar(
title: Card(
margin: EdgeInsets.only(
top: common_gap * 1.5, bottom: common_gap * 1.5),
child: TextField(
cursorColor: Constants.kPrimaryOrange,
controller: _controller,
focusNode: _focusNode,
onChanged: (value) {
setState(() {
_searchText = value;
});
},
decoration: InputDecoration(
prefixIcon: Icon(
Icons.search,
size: 20,
),
suffixIcon: _controller.text.length != 0
? IconButton(
icon: Icon(
Icons.cancel,
size: 20,
color: _searchText == ''
? Colors.transparent
: Colors.black87,
),
onPressed: () {
setState(() {
_controller.clear();
_searchText = '';
_focusNode.unfocus();
});
},
)
: Container(),
),
),
can you tell me how to fix this ??