Button and button text transparencies

Hello.

New to Flutter and working on my first app so playing around to learn how the objects work together. I am using the button object and its text field to label the button and when I lower the opacity level of the button’s background color, the button’s text is also lowered. Is there a way for the button text to stay at full opacity while the background 's opacity is lowered? If not, what is the best way to accomplish this.

You probably are using Opacity(child: Button). This will apply the opacity to the whole widget inside opacity.

If you with to only change the button colour to a semi-trasparent one, use button colour (which has a style, just like Text):

FilledButton(
  onPressed: () {},
  style: FilledButton.styleFrom(backgroundColor: Colors.red.withAlpha(128)),
  child: const Text("Hi"),
);