main.dart
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(primarySwatch: Colors.green),
home: Scaffold(
appBar: AppBar(
title: const Text("Flutter - Container Clip Behavior")
),
body: bodyContent()
)
)
);
}
bodyContent(){
return Container(
width: double.infinity,
height: 225,
margin: const EdgeInsets.all(12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24)
),
clipBehavior: Clip.antiAliasWithSaveLayer,
child: Image.network(
"https://picsum.photos/800",
fit: BoxFit.cover
)
);
}
More flutter tutorials
- flutter – Card elevation
- flutter – Card shadow
- flutter – Card padding
- flutter – How to make a Card clickable
- flutter – Card circle shape
- flutter – Card rounded image padding
- flutter – Card clip behavior
- flutter – Container decoration image
- flutter – How to use InkResponse
- flutter – Column items equal height
- flutter – Column items stretch horizontally
- flutter – Column height wrap content
- flutter – Row alignment
- flutter – Row center
- flutter – Row width