How to implement this type of blur effect in flutter

Issue

enter image description here

I am trying to find the solution for this type of effect for 1 day in youtube, websites, official website of flutter but I do not find like this. Any one knew how to implement this blurry effect at the edge of the corner of Container Widget?

Solution

ShaderMask(
 shaderCallback: (Rect bounds) {
   return LinearGradient(
     colors: [Colors.white.withOpacity(0.05),Colors.white],
     stops: [0.1, 1],
     tileMode: TileMode.mirror,
     begin: Alignment.topCenter,
     end: Alignment.bottomCenter
   ).createShader(bounds);
 },
 child: Column(
   mainAxisSize: MainAxisSize.min,
   children: [
     Container(
       width: 50,height: 50,
       color: Colors.red,
     ),
     Container(
       width: 50,height: 50,
       color: Colors.blue,
     ),
     Container(
       width: 50,height: 50,
       color: Colors.black,
     ),
     Container(
       width: 50,height: 50,
       color: Colors.red,
     ),
     Container(
       width: 50,height: 50,
       color: Colors.blue,
     ),
     Container(
       width: 50,height: 50,
       color: Colors.black,
     ),
   ],
 )
)

enter image description here

Answered By – Mehdi

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published