When I use the TextField Widget with enabled parameter set tofalse, the border disappears.
Flexible(
child:
TextField(
onTap: () {
Future<DateTime> dateTime = _buildDataHoraInicial(context);
dateTime.then((date){
_dataHoraInicial = date;
_dataTempoInicialController.text = date.toIso8601String();
print(_dataHoraInicial);
});
},
controller: _dataTempoInicialController,
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(vertical: 15.0),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xfff7b733))),
prefixIcon: Icon(
Icons.calendar_today,
color: Color(0xfff7b733),
size: 16.0,
),
suffixIcon: Icon(Icons.access_time,
color: Color(0xfff7b733), size: 16.0),
border: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xfff7b733))),
labelText: 'Data e Hora de Início',
fillColor: Colors.white,
hintStyle: TextStyle(color: Colors.white),
labelStyle: TextStyle(
fontSize: 16.0, color: const Color(0xfff7b733))),
),
),
image of the TextField Widget
How can I use TextField Widget with enabled parameter set to true keeping the border?
To solve this problem I added the disabledBorder parameter from the InputDecoration and set it to OutlineInputBorder(borderSide: BorderSide(color: Color(0xfff7b733)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With