In this tutorial, we’ll learn how to properly change Flutter textfield enabled outline border color by using a practical Flutter code example.
Outline
- Introduction: Flutter Textfield Enabled Outline Border Color
- Default Enabled Outline Border Color
- Change Flutter Textfield Enabled Outline Border Color
- Custom Flutter Textfield Enabled Outline Border Color Source Code
- Conclusion
Introduction: Flutter Textfield Enabled Outline Border Color
Enabled border of textfield is shown when the textfield is not focused/tapped. When we use outline border then it covers all the border sides of the textfield.
Don’t worry, I will now implement it using proper example so you can have a better idea of what outline border is and how can we change Flutter textfield enabled outline border color.
Default Enabled Outline Border Color
- For that we have to implement a simple Flutter textfield widget.
- After that, we’ve to use the decoration constructor of the Flutter textfield, then pass it input decoration class.
- Finally, we’ve to pass the outline input border class to its enabled border constructor. See the below code:
TextField( decoration: InputDecoration( enabledBorder: OutlineInputBorder() ), )

Change Flutter Textfield Enabled Outline Border Color
For that we have to use the same process mentioned above and after that we have to use the border side constructor of the outline input border class and pass it the border side widget. Then by using the color constructor of border side class, we can change the color of the outline border of enabled Flutter textfield. See the below code:
enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.red))

Custom Flutter Textfield Enabled Outline Border Color Source Code
import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Homepage(), ); } } class Homepage extends StatelessWidget { @override Widget build(BuildContext context) { return SafeArea( child: Scaffold( body: Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 40), child: TextField( decoration: InputDecoration( enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.red))), ))))); } }
Conclusion
To conclude this tutorial, now you’ve a detailed and in-depth practical knowledge of how to change Flutter textfield enabled outline border color. I’d love to have your feedback on this post.
I’d also love to see you visit my other tutorials on Flutter app development and Python programming as well. Thank you for reading this post.
You might also like:
Flutter Textformfield Focused Underline Border Thickness Customization
How To Set Flutter Textformfield Only Numbers [Detailed Flutter Example Code]
[Solved] Flutter Build Apk Not Working With Image Picker
Flutter Textformfield Enabled Underline Border Thickness Customization
Flutter Textfield Focused Underline Border Thickness Customization
Flutter Textfield Enabled Underline Border Thickness Customization
How To Change Flutter Textformfield Hint Text Weight [Easy Flutter Guide]
How To Change Flutter Textfield Error Text Size [Detailed Flutter Guide]
How To Change Flutter Textformfield Error Text Color [Detailed Flutter Guide]
How To Set Flutter Carousel Slider Duration [Easy Flutter Code Examples]
How To Change Flutter Textfield Hint Text Weight [Easy Flutter Guide]
How To Change Flutter Textfield Underline Thickness [Detailed Flutter Guide]