Flutter Set Change Add Opacity Alpha on Raised Button Example

Opacity also known as Alpha makes the widget or View transparent according to given value between 0.1 to 1. In flutter we would use Opacity widget to make child widget transparent so when they will show on screen they will become lighter or you can say transparent and their below view will be visible as they became transparent. So in this tutorial we would Flutter Set Change Add Opacity Alpha on Raised Button Android iOS Example tutorial.

Contents in this project Flutter Set Change Add Opacity Alpha on Raised Button Android iOS Example Tutorial:

1. Import material.dart package in your app’s main.dart file. This is our main package to import and all of our mainly used widgets is written in this package.

2. Create void main runApp() method and here we would call our main MyApp class.

3. Creating our main MyApp class extends with State less widget.

4. Creating Widget Build area -> Material App -> Scaffold widget -> Center Widget.

5. Creating Opacity widget and put the Raised Button as Child widget inside Opacity widget.

  • opacity : To make the child view transparent. Value should be given between 0.0 to 1. Here 0.0 will not make the child view transparent so pass the value between 0.1 to 1.

6. Complete source code for main.dart file:

Screenshot:

Flutter Set Change Add Opacity Alpha on Raised Button Example

Leave a Reply

Your email address will not be published.