pSym function

EdgeInsets pSym({
  1. required dynamic w,
  2. required dynamic h,
})

Context-less global helpers for padding/margin

Implementation

EdgeInsets pSym({required w, required h}) {
  if (!ResponsiveConfig.initialized) {
    throw Exception(
        "ResponsiveConfig not initialized. Call ResponsiveConfig.init(context) first.");
  }
  return EdgeInsets.symmetric(
    horizontal: w * (ResponsiveConfig.width / ResponsiveConfig.baseWidth),
    vertical: h * (ResponsiveConfig.height / ResponsiveConfig.baseHeight),
  );
}