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
- flutter – Card rounded image padding
- flutter – Card clip behavior
- flutter – Container clip behavior
- flutter – How to use InkResponse
- flutter – Column items equal height
- flutter – Column items stretch horizontally
- flutter – Column height wrap content
- flutter – Column vertical direction
- flutter – Row space between
- flutter – Row height
- flutter – Row alignment
- flutter – Row center
- flutter – Row width
- flutter – Row center vertically
- flutter – Row background color