I created a simple text field with input decoration and Outlineboraderinput
. When I type on that text field I want to change the border color. Below link, you can see my work. What I want is change that blue border to white:
TextFormField( decoration: InputDecoration( labelText: "Resevior Name", fillColor: Colors.white, enabledBorder:OutlineInputBorder( borderSide: const BorderSide(color: Colors.white, width: 2.0), borderRadius: BorderRadius.circular(25.0), ), ), )
To add a border to a TextField/TextFormField in Flutter, you can specify the decoration property and then use the InputDecoration and OutlineInputBorder widget. The OutlineInputBorder widget has the borderSide widget which you can use to pass in the BorderSide widget with width and color parameter to create the border.
Flutter – Change Container Border's Color & Width To change the color and width of Container's border, use its decoration property. Set decoration property with BoxDecoration() object. Set the border property of BoxDecoration() object, with required color and width as per your applications specifications.
Add focusBorder insted of enabledBorder
TextFormField( decoration: InputDecoration( labelText: "Resevior Name", fillColor: Colors.white, focusedBorder:OutlineInputBorder( borderSide: const BorderSide(color: Colors.white, width: 2.0), borderRadius: BorderRadius.circular(25.0), ), ), )
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