Search code examples
fluttershadow

How can I make a shadow with a material design card?


This is the result that I would like to have :

enter image description here


Solution

  • Make a custom card

    ///custom cards
    
      Widget card(String image) {
        return  Container(
            child:  Image.asset(
                  image,
                  fit: BoxFit.cover,
                ),
    
            decoration: BoxDecoration(
              border: Border.all(color: Colors.blue, width: 2.0),
              color: Colors.white,
              borderRadius: BorderRadius.all(
                Radius.circular(5.0),
              ),
              boxShadow: <BoxShadow>[
                new BoxShadow(
                  color: Colors.blue,
                  blurRadius: 3.0,
                  offset: new Offset(0.0, 3.0),
                ),
              ],
            ),
            margin: EdgeInsets.all(5.0),
            height: 150.0,
            width: 100.0,
    
        );
      }
    

    Box Shadow is what you need. I hope this will help.