AdaptiveContextExtension extension
Extension methods on BuildContext for easy access to adaptive features.
These extensions provide a convenient way to access device info, screen metrics, and responsive values from any widget.
- on
Properties
- bottomBarHeight → double
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the bottom bar height (bottom safe area).no setter - deviceInfo → AdaptiveDeviceInfo
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the current AdaptiveDeviceInfo for this context.no setter - deviceType → DeviceType
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the current DeviceType.no setter - isDesktop → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the current device is a desktop.no setter - isFoldable → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the current device is a foldable.no setter - isLandscape → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the device is in landscape orientation.no setter - isLg → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the screen is large.no setter - isMd → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the screen is medium.no setter - isPhone → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the current device is a phone.no setter - isPortrait → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the device is in portrait orientation.no setter - isSm → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the screen is small.no setter - isTablet → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the current device is a tablet.no setter - isXl → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the screen is extra large.no setter - isXs → bool
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the screen is extra small.no setter - orientation → Orientation
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the current orientation.no setter - pixelRatio → double
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the device pixel ratio.no setter - safeAreaPadding → EdgeInsets
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the full safe area padding.no setter - screenHeight → double
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the screen height in logical pixels.no setter - screenSize → ScreenSize
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the current ScreenSize category.no setter - screenWidth → double
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the screen width in logical pixels.no setter - statusBarHeight → double
-
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets the status bar height (top safe area).no setter
Methods
-
adaptive<
T> ({required T phone, T? tablet, T? desktop, T? foldable}) → T -
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets a value based on the current device type. -
adaptiveOrientation<
T> ({required T phonePortrait, T? phoneLandscape, T? tabletPortrait, T? tabletLandscape, T? desktopPortrait, T? desktopLandscape}) → T -
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets a value based on device type AND orientation. -
between(
DeviceType start, DeviceType end) → bool -
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the screen is between two device types (inclusive). -
equals(
DeviceType type) → bool -
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the screen is the same as the given device type. -
largerThan(
DeviceType type) → bool -
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the screen is larger than the given device type. -
orientationValue<
T> ({required T portrait, required T landscape}) → T -
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets a value based on the current orientation. -
responsive<
T> ({required T xs, T? sm, T? md, T? lg, T? xl}) → T -
Available on BuildContext, provided by the AdaptiveContextExtension extension
Gets a value based on the current screen size. -
smallerThan(
DeviceType type) → bool -
Available on BuildContext, provided by the AdaptiveContextExtension extension
Returns true if the screen is smaller than the given device type.