import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class ComwellCard extends StatelessWidget {
final Widget content;
final double aspectRatio;
final Color backgroundColor;
final double borderRadius;
final String? bottomLeftImage = 'assets/images/co.svg';
final String? topRightImage = 'assets/images/v.svg';
final double imageOpacity;
const ComwellCard({
super.key,
required this.content,
this.aspectRatio = 359 / 212,
this.backgroundColor = sandColor,
this.borderRadius = 15,
this.imageOpacity = 0.2,
});
@override
Widget build(BuildContext context) {
return AspectRatio(
aspectRatio: aspectRatio,
child: Container(
alignment: Alignment.center,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
),
child: Stack(
children: [
if (bottomLeftImage != null)
Align(
alignment: Alignment.bottomLeft,
child: Opacity(
opacity: imageOpacity,
child: SvgPicture.asset(bottomLeftImage!),
),
),
if (topRightImage != null)
Align(
alignment: Alignment.topRight,
child: Opacity(
opacity: imageOpacity,
child: SvgPicture.asset(topRightImage!),
),
),
Align(
alignment: Alignment.center,
child: content,
),
],
),
),
);
}
}