main.dart
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(primarySwatch: Colors.blueGrey),
home: Scaffold(
appBar: AppBar(
title: const Text("Card Rounded Corners Image")
),
body: bodyContent()
)
)
);
}
bodyContent(){
return SizedBox(
width: double.infinity,
height: 250,
child: Card(
elevation: 8,
margin: const EdgeInsets.all(16),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(24))
),
clipBehavior: Clip.antiAliasWithSaveLayer,
child: Image.network(
"https://picsum.photos/600",
fit: BoxFit.cover
)
)
);
}
More flutter tutorials
- flutter – How to use LimitedBox
- flutter – How to use GridView
- flutter – How to create horizontal GridView
- flutter – GridView horizontal scroll
- flutter – GridView extent
- flutter – GridView child aspect ratio
- flutter – Card elevation
- flutter – Card shadow
- flutter – How to make a Card clickable
- flutter – Card circle shape
- flutter – Card circle image
- flutter – Card circle image padding
- flutter – Container decoration image
- flutter – Container clip behavior
- flutter – How to use InkResponse