horizontalPadding static method

double horizontalPadding(
  1. BuildContext context
)

Gets the horizontal padding applied to the header based on the screen width.

If the screen is small, the padding is 12.0, otherwise it defaults to kPageDefaultVerticalPadding

Implementation

static double horizontalPadding(BuildContext context) {
  assert(debugCheckHasMediaQuery(context));
  final screenWidth = MediaQuery.sizeOf(context).width;
  final isSmallScreen = screenWidth < 640.0;
  final horizontalPadding =
      isSmallScreen ? 12.0 : kPageDefaultVerticalPadding;
  return horizontalPadding;
}