By WalkingTree May 05, 2020
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?
final widgets = [
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.
In recent times, due to the effects of the pandemic, a mask detecting app is in great need….
Theming is styling an application so that its look and feel matches your personal design aesthetic or that…
In this blog, we have collated the important Flutter best practices that should be kept in mind for…
In the last blog and webinar on State Management in Flutter, we learned about managing state using Stateful…
In this week’s blog on plugins, we will look at a very special requirement – OCR(Optical Character Recognition)…