getResponsivePadding static method

EdgeInsets getResponsivePadding(
  1. BuildContext context
)

Get responsive padding based on screen size

Implementation

static EdgeInsets getResponsivePadding(BuildContext context) {
  final screenWidth = MediaQuery.of(context).size.width;

  if (screenWidth > 600) {
    return const EdgeInsets.all(24);
  } else if (screenWidth > 400) {
    return const EdgeInsets.all(20);
  } else {
    return const EdgeInsets.all(16);
  }
}