ResponsiveScreen class
Provides information about the current screen.
This class determines the screen type based on the device width and the configured breakpoints.
Constructors
- ResponsiveScreen(ResponsiveScreenSettings settings, [BuildContext? context])
- Creates a new ResponsiveScreen with the given settings and optional BuildContext.
Properties
- context ↔ BuildContext
-
Returns the current BuildContext.
getter/setter pair
- hasContext → bool
-
Returns whether a BuildContext is currently attached.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
The height of the screen.
no setter
- isDesktop → bool
-
Whether the screen type is ScreenType.desktop.
no setter
- isPhone → bool
-
Whether the screen type is ScreenType.phone.
no setter
- isTablet → bool
-
Whether the screen type is ScreenType.tablet.
no setter
- isWatch → bool
-
Whether the screen type is ScreenType.watch.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screenType → ScreenType
-
The current screen type based on the device width.
no setter
- settings → ResponsiveScreenSettings
-
final
- width → double
-
The width of the screen.
no setter
Methods
-
isDesktopOf(
BuildContext context) → bool -
Returns whether the screen for
contextis ScreenType.desktop. -
isPhoneOf(
BuildContext context) → bool -
Returns whether the screen for
contextis ScreenType.phone. -
isTabletOf(
BuildContext context) → bool -
Returns whether the screen for
contextis ScreenType.tablet. -
isWatchOf(
BuildContext context) → bool -
Returns whether the screen for
contextis ScreenType.watch. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
responsiveValue<
T> ({T? mobile, T? tablet, T? desktop, T? watch}) → T? - Returns a value based on the current screen type.
-
responsiveValueOf<
T> (BuildContext context, {T? mobile, T? tablet, T? desktop, T? watch}) → T? -
Returns a value based on the screen type of the given
context. -
screenTypeOf(
BuildContext context) → ScreenType -
Calculates the ScreenType for the given
context. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited