43 lines
1.0 KiB
Dart
43 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:mymuseum_visitapp/constants.dart';
|
|
|
|
class ProductPoster extends StatelessWidget {
|
|
const ProductPoster({
|
|
Key? key,
|
|
required this.size,
|
|
required this.image,
|
|
}) : super(key: key);
|
|
|
|
final Size size;
|
|
final String image;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
margin: EdgeInsets.symmetric(vertical: kDefaultPadding),
|
|
// the height of this container is 80% of our width
|
|
height: size.width * 0.8,
|
|
|
|
child: Stack(
|
|
alignment: Alignment.bottomCenter,
|
|
children: <Widget>[
|
|
Container(
|
|
height: size.width * 0.7,
|
|
width: size.width * 0.7,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
shape: BoxShape.circle,
|
|
),
|
|
),
|
|
Image.asset(
|
|
image,
|
|
height: size.width * 0.75,
|
|
width: size.width * 0.75,
|
|
fit: BoxFit.cover,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|