flutter container image code example

Example 1: image in container flutter

Container(
      height: 120.0,
      width: 120.0,
      decoration: BoxDecoration(
        image: DecorationImage(
          image: AssetImage(
              'assets/assets/alucard.jpg'),
          fit: BoxFit.fill,
        ),
        shape: BoxShape.circle,
      ),
    )

Example 2: how to add image from assets inside as a decoration image in container

new Container(
  width: 100.00,
  height: 100.00,
  decoration: new BoxDecoration(
  image: new DecorationImage(
      image: ExactAssetImage('assets/example.png'),
      fit: BoxFit.fitHeight,
      ),
  ));

Example 3: container decoration box flutter

new Container(
  margin: const EdgeInsets.all(15.0),
  padding: const EdgeInsets.all(3.0),
  decoration: BoxDecoration(
    border: Border.all(color: Colors.blueAccent)
  ),
  child: Text("My Awesome Border"),
)

Example 4: box decoration s flutter

new Center(  child: new Container(    decoration: new BoxDecoration(      color: Colors.purple,      gradient: new LinearGradient(        colors: [Colors.red, Colors.cyan],        begin: Alignment.centerRight,        end: new Alignment(0.8, 0.0),        tileMode: TileMode.mirror      ),    ),    child: new FlutterLogo(      size: 200.0,    )  ),);