Some relative stuff

This commit is contained in:
2024-05-11 23:27:01 +03:00
parent 57ff8a59e8
commit 75bfc7ea6b
10 changed files with 200 additions and 19 deletions

View File

@@ -14,12 +14,20 @@ class ProductCard extends StatelessWidget {
required this.onTap,
});
double getCardHeight({required BuildContext context}) {
if (MediaQuery.of(context).size.width > 600) {
return 200;
}
return 100;
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: ConstrainedBox(
constraints: const BoxConstraints(minHeight: 200),
constraints: BoxConstraints(
minHeight: 80, maxHeight: getCardHeight(context: context)),
child: Card(
elevation: 3,
color: Theme.of(context).scaffoldBackgroundColor,