Search code snippets, questions, articles...

Add background image to container in Flutter

The code can be used to add an image in the background of the Container widget in Flutter.
Container(
    decoration: BoxDecoration(
        image: DecorationImage(
            image: NetworkImage('https://placeimg.com/500/500/any'),
            fit: BoxFit.cover,
        ),
    ),
)
Was this helpful?
0 Comments