07-21-2023, 09:59 PM
- ### Rounded `Card` (without image):
[![enter image description here][1]][1]
```dart
final borderRadius = BorderRadius.circular(24);
Card(
color: Colors.blue, // Backgrond color
shape: RoundedRectangleBorder(borderRadius: borderRadius),
child: InkWell(
borderRadius: borderRadius,
splashColor: Colors.red, // Splash color
onTap: () {},
child: Ink(width: 100, height: 100),
),
)
```
- ### Rounded `Card` (with image):
[![enter image description here][2]][2]
```dart
final borderRadius = BorderRadius.circular(24);
Card(
shape: RoundedRectangleBorder(borderRadius: borderRadius),
child: InkWell(
borderRadius: borderRadius,
splashColor: Colors.brown.withOpacity(0.7), // Splash color
onTap: () {},
child: Ink(
width: 100,
height: 100,
decoration: BoxDecoration(
borderRadius: borderRadius,
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage('assets/chocolate_image.png'), // Background image
),
),
),
),
)
```
[1]:
[2]:
[![enter image description here][1]][1]
```dart
final borderRadius = BorderRadius.circular(24);
Card(
color: Colors.blue, // Backgrond color
shape: RoundedRectangleBorder(borderRadius: borderRadius),
child: InkWell(
borderRadius: borderRadius,
splashColor: Colors.red, // Splash color
onTap: () {},
child: Ink(width: 100, height: 100),
),
)
```
- ### Rounded `Card` (with image):
[![enter image description here][2]][2]
```dart
final borderRadius = BorderRadius.circular(24);
Card(
shape: RoundedRectangleBorder(borderRadius: borderRadius),
child: InkWell(
borderRadius: borderRadius,
splashColor: Colors.brown.withOpacity(0.7), // Splash color
onTap: () {},
child: Ink(
width: 100,
height: 100,
decoration: BoxDecoration(
borderRadius: borderRadius,
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage('assets/chocolate_image.png'), // Background image
),
),
),
),
)
```
[1]:
[2]: