Flutter Tutorials

Flutter app development tutorials


flutter – Container decoration image

main.dart


import 'package:flutter/material.dart';

void main() {
  runApp(
      MaterialApp(
          theme: ThemeData(primarySwatch: Colors.indigo),
          home: Scaffold(
              appBar: AppBar(
                  title: const Text("Container Decoration Image")
              ),
              body: bodyContent()
          )
      )
  );
}

bodyContent(){
  return Container(
      width: double.infinity,
      height: 225,
      margin: const EdgeInsets.all(12),
      decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(24),
          image: const DecorationImage(
              image: NetworkImage("https://picsum.photos/600"),
              fit: BoxFit.cover
          )
      )
  );
}

More flutter tutorials



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started