How to Change the Text Button Color in the Flutter?
How to Change the Text Button Color in the Flutter?
You may use the built-in setColor function from android_material_palette. Note that there is an overload to this method, so you can actually pass the color argument for setting color(s) at one time. Also, note that you need to add the palette dependency in your pubspec.YAML file as follows:
flutter text button
By
PHDinStackoverflow on Apr 20, 2021
TextButton(
onPressed: () {
// Respond to button press
},
child: Text("TEXT BUTTON"),
)1
text button flutter
By
VasteMonde on Mar 18, 2021
TextButton.icon({
Key key,
@required VoidCallback onPressed,
VoidCallback onLongPress,
ButtonStyle style,
FocusNode focusNode,
bool autofocus,
Clip clipBehavior,
@required Widget icon,
@required Widget label
})
// Example:
TextButton.icon(
icon: Icon(Icons.camera),
label: Text('Take A Photo'),
onPressed: () {},
)2
The MSocialButton widget allows the developers to configure its use of color for the background, text, primary & secondary actions, and more. Each button has a default color but can be configured individually by simply replacing them in the code.
Comments
Post a Comment