Flutter textformfield outline border color customization. In this post, I will be changing Flutter textformfield outline border color using a easy Flutter example code so you can have a practical understanding of how to change Flutter textformfield outline border color. I will also be explaining what the outline border is, its usage in Flutter textformfield and as I said above, how to change the outline border color.
What is Flutter Textformfield Outline Border Color?
Flutter textformfield outline border color is as the name suggests, it is the color of the Flutter textformfield border, when we use outline border then it covers all the border sides of the textformfield. 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 textformfield outline border color.
Default Flutter Textformfield Outline Border Color
Let’s see the default Flutter textformfield outline border color. For that we have to use the decoration constructor of the Flutter textformfield, then pass it input decoration class and by using the enabled and focused border constructors, we can pass the outline input border class. See the below code:
TextFormField( decoration: InputDecoration( enabledBorder: OutlineInputBorder(), focusedBorder: OutlineInputBorder(), ), )

Change Flutter Textformfield Outline Border Color
Now let’s implement the customization of outline border color of Flutter textformfield. 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 class. Using the color constructor of the border class class, we can change the color of the outline border of Flutter textformfield. See the below code:
OutlineInputBorder( borderSide: BorderSide(color: Colors.green))


Custom Flutter Textformfield Design 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 StatefulWidget { @override State<Homepage> createState() => _HomepageState(); } class _HomepageState extends State<Homepage> { @override Widget build(BuildContext context) { return SafeArea( child: Scaffold( body: Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 40), child: TextFormField( style: TextStyle(color: Colors.purple), decoration: InputDecoration( enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(50) .copyWith(bottomRight: Radius.circular(0)), borderSide: BorderSide(color: Colors.purple)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(50) .copyWith(bottomRight: Radius.circular(0)), borderSide: BorderSide(color: Colors.purple)), ), ))), )); } }
Conclusion
In conclusion, now you have an in depth understanding of how to practically change Flutter textformfield outline border color. I would love to hear your thoughts on this post. I also have prepared other informative posts on Flutter app development, Flutter animations, Flutter widgets, amazing Flutter templates, and many more. That’s it for this post, thank you for reading it.