getContextualScreenSize function
ScreenSize
getContextualScreenSize({
- required BuildContext context,
- Orientation? orientation,
- LayoutSize defaultSize = LayoutSize.mobile,
- ScreenSizeSettings sizes = const ScreenSizeSettings.portrait(),
Gets type of screen size based on BuildContext
sizes
defaults to ScreenSizeSettings.portrait()
defaultSize
defaults to LayoutSize.mobile
orientation
is mostly needed for ResponsiveLayoutBuilder
context
must not be null
Implementation
ScreenSize getContextualScreenSize({
required BuildContext context,
Orientation? orientation,
LayoutSize defaultSize = LayoutSize.mobile,
ScreenSizeSettings sizes = const ScreenSizeSettings.portrait(),
}) {
return getScreenSize(
width: MediaQuery.of(context).size.width,
defaultSize: defaultSize,
orientation: orientation,
sizes: sizes,
);
}