Fade Widgets in Flutter

--

Give your widgets a Faded Effect.

Let’s say we want to fade a widget called WidgetToBeFaded().

We need to wrap it inside ShaderMask() widget. Return LinearGradient().createShader(bounds) inside shaderCallback function;

In Linear Gradient use Black and a Transparent color. Set the blend mode of shader mask to BlendMode.dstIn.

We’re done!! Now the transparency of widget is determined by the Linear Gradient’s transparent color.

I hope this helps. Thanks for reading.

Follow me GitHub, LinkedIn, Twitter.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Manthan Khandale
Manthan Khandale

Responses (2)

Write a response