Opacity — A Flutter Widget — WalkingTree Technologies

Removing a widget in Flutter is really simple and easy. You just have to rebuild the tree without it. But what if you want the widget to disappear but still take up space on the screen so that it doesn’t disrupt the rest of the layout? Well to solve this, you can try the Opacity widget.

How does it work?

In the code above, the blue widget has been wrapped inside the Opacity widget, with its opacity set to 0.0. This will make the widget completely transparent, i.e. the widget will exist at its place, but you won’t be able to see it. Anything between 0.0 and 1.0 makes the widget partially transparent.

Not just this, you can animate the opacity of the widget also by simply wrapping it inside the AnimatedOpacity widget and setting its opacity and duration.

For more information on the Opacity widget and to see the Flutter’s Widget of the Week video.

Originally published at https://walkingtree.tech on May 5, 2020.

--

--

--

WalkingTree is an IT software and service provider recognized for its passion for technology.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to enforce logged in community user context from Einstein Bot

pollen — A command-line tool for interacting with TheHive

Meet the Kotlin community at Dynatrace

Precise Method and Constant Invalidation in TruffleRuby

The Narrow Road

Conference Management Application — Salesforce project (Part 1 : Initial Application creation &…

Bombs away! Adding another enemy to the game.

Getting Started with building your first Alexa Skill

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
WalkingTree Technologies

WalkingTree Technologies

WalkingTree is an IT software and service provider recognized for its passion for technology.

More from Medium

A Peep into the Benefits of Flutter

Dart Platforms

Spotify Interface || My First app on Flutter!

Bringing Life To Your Flutter Application