Search code snippets, questions, articles... Chrome Extension

Add box shadow to container in flutter

new Container(
    height: 200.0,
    decoration: new BoxDecoration(
        boxShadow: [
          color: Colors.white, //background color of box
          BoxShadow(
            color: Colors.red,
            blurRadius: 25.0, // soften the shadow
            spreadRadius: 5.0, //extend the shadow
            offset: Offset(
              15.0, // Move to right 10  horizontally
              15.0, // Move to bottom 10 Vertically
            ),
          )
        ],
    ),
    child: new Text("Hello world"),
);
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

The code snippet shows how to add box-shadow to a Container widget in Flutter. The code will add a shadow of red color to the Container widget.

Was this helpful?
0 Comments
Join Devsheet Ask a Question