4

is there some way for using NetworkImage as background ?

I need create some box with network image and I need add some widgets over this image.

Thanks for help.

Petr Klein
  • 797
  • 2
  • 9
  • 23

1 Answers1

13

Use the decoration attribute of Container to put the network image. You must also update the container size.

Container(
    decoration: 
         BoxDecoration(
             image: DecorationImage(
                        image: NetworkImage("http://via.placeholder.com/350x150"))))
Zroq
  • 8,002
  • 3
  • 26
  • 37
  • Thanks, I tried only Image.network and its not working. But this working fine :) I found class Stack maybe it will be better. – Petr Klein Jun 15 '18 at 16:21