In this post, I will be explaining how to change Flutter RaisedButton disabled color using practical code implementation and with a step by step explanation of how to change Flutter RaisedButton disabled color so you can also change it in your own Flutter app projects with ease.
What is Flutter RaisedButton Disabled Color?
Flutter RaisedButton disabled color as the name suggests, it is the disable button background color. We will see what the default Flutter RaisedButton disabled color is and also how to change it, the reason why you are reading this post. So let’s right get into implementing the customization of Flutter RaisedButton disabled color with a proper Flutter example.
Default Flutter RaisedButton Disabled Color
To see the default Flutter RaisedButton disabled color, we first have to define a Flutter RaisedButton and make it disable which is explained in detail in my previous post, click here if you are interested in it as well. See the below code:
RaisedButton( onPressed: null, child: Text( 'Flutter Raised Button Disabled Color', ), )
Change Flutter RaisedButton Disabled Color
In order to change the default Flutter RaisedButton disabled color, we have to use the disabled color constructor of the Flutter RaisedButton. It takes color so we have passed it a green color for demonstration. See the below code:
RaisedButton( onPressed: null, disabledColor: Colors.green.shade300, child: Text( 'Custom Raised Button Disabled Color', ), )
In conclusion, you now know what Flutter RaisedButton disabled color is and how to make use of it. I invite your valuable feedback on this post. Please feel free to also explore the other articles I have covered relating to Flutter widgets, Flutter app development, Flutter animations, and Flutter templates with source code and much more. Thanks for reading this article.