Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RaisedButton rendered with a semi-transparent gray fill in Flutter

I have a RaisedButton inside a Column, which is inside a Stack

Stack(
   children: [
       PageView(
         children: [...],
       ),
       Column(
         crossAxisAlignment: CrossAxisAlignment.center,
         mainAxisAlignment: MainAxisAlignment.end, 
         children: [
           RaisedButton(
             color: Colors.teal,
             child: Text("Button"),
           ),
           ...
           ),
         ...

However, instead of the button being rendered with a teal fill, it is gray and semi-transparent. Here it is on top of an orange Container.

Is there any way for me to force this button to be teal?

like image 705
Rafael Uchoa Avatar asked Aug 17 '18 16:08

Rafael Uchoa


People also ask

How do you add color to RaisedButton in Flutter?

The color argument is used to Set Change Raised Button Background Color in Flutter iOS Android mobile app. Color can support all the useful formats like Hex color code, ARGB, RGBA and also color constants. We can pass here any color and our Raised button will generated that particular background color.

How do you style an ElevatedButton in Flutter?

The style of this elevated button can be overridden with its style parameter. The style of all elevated buttons in a subtree can be overridden with the ElevatedButtonTheme, and the style of all of the elevated buttons in an app can be overridden with the Theme's ThemeData.elevatedButtonTheme property.


1 Answers

If onPressed is not provided for RaisedButton it will show up as garyed or disabled.

You can set the color to be shown for disabled RaisedButton by providing value for disabledColor

For more details visit this link

like image 129
Thanthu Avatar answered Oct 09 '22 06:10

Thanthu