2024-12-28 12:41:57 -05:00

31 lines
844 B
Dart

import 'package:flutter/material.dart';
enum SizeAxis { width, height }
class CardImage extends StatelessWidget {
const CardImage({super.key, required this.image, this.padding, this.size});
final ImageProvider<Object> image;
final EdgeInsets? padding;
final Map<SizeAxis, double>? size;
@override
Widget build(BuildContext context) {
return Padding(
padding: padding ?? const EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Container(
width: size?[SizeAxis.width] ?? 60,
height: size?[SizeAxis.height] ?? 60,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: image,
// color: Colors.blue,
),
borderRadius: BorderRadius.all(Radius.elliptical(8, 8)),
),
));
}
}