getScreenSize static method

SFScreenSize getScreenSize(
  1. BuildContext context
)

Détermine la taille de l'écran en fonction de la largeur

Implementation

static SFScreenSize getScreenSize(BuildContext context) {
  final width = MediaQuery.of(context).size.width;
  if (width >= largeDesktopBreakpoint) return SFScreenSize.largeDesktop;
  if (width >= desktopBreakpoint) return SFScreenSize.desktop;
  if (width >= tabletBreakpoint) return SFScreenSize.tablet;
  return SFScreenSize.mobile;
}