Here is my code,I'd like to set a background color, transparent to my button.
I'd like to add background color to both Raised Button in my code. I also tried wrapping it with a Container and then applying container's background transparent, but it didn't work.
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
FadeAnimation(
3.4,
SizedBox(
width: double.infinity,
height: 44,
child: RaisedButton(
color: Colors.white,
onPressed: navigateToSignUp,
child: Text(
'Sign Up',
style:
TextStyle(color: Colors.blueGrey, fontSize: 24),
),
),
),
),
SizedBox(height: 10),
FadeAnimation(
3.4,
SizedBox(
width: double.infinity,
height: 44,
child: RaisedButton(
color: Colors.white,
onPressed: navigateToSignIn,
child: Text(
'Sign In',
style: TextStyle(color: Colors.grey, fontSize: 24),
),
),
),
),
You can use Opacity
with black
Color
Like this :
color: Colors.black.withOpacity(0.05), //set this opacity as per your requirement
It will look much more Attractive
Try flat button:
FlatButton(
color: Colors.transparent,
splashColor: Colors.black26,
onPressed: () {
print('done');
},
child: Text(
'Click Me!',
style: TextStyle(color: Colors.lightBlue),
),
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With