madari-oss/lib/utils/grid.dart
Madari Developers 16fe4a653f Project import generated by Copybara.
GitOrigin-RevId: 829626e92d5dba6a4586d1e7c4bd1615ec396e88
2025-01-02 18:46:26 +00:00

31 lines
849 B
Dart

import 'package:flutter/material.dart';
double getGridResponsivePadding(BuildContext context) {
final width = MediaQuery.of(context).size.width;
if (width < 600) return 8.0;
if (width < 1200) return 16.0;
return 24.0;
}
int getGridResponsiveColumnCount(BuildContext context) {
final width = MediaQuery.of(context).size.width;
if (width < 600) return 3;
if (width < 900) return 5;
if (width < 1200) return 5;
if (width < 1800) return 6;
if (width < 2000) return 6;
return 10;
}
double getGridResponsiveSpacing(BuildContext context) {
final width = MediaQuery.of(context).size.width;
if (width < 600) return 8.0;
if (width < 1200) return 16.0;
return 24.0;
}
double getGridResponsiveAspectRatio(BuildContext context) {
final width = MediaQuery.of(context).size.width;
if (width < 600) return 1.2;
return 1.5;
}