Responsive class

Information about the current device's screen size and form factor.

Annotations

Constructors

Responsive({required Size size, required bool isMobile, required bool isSmallerTablet, required bool isTablet, required bool isDesktop})
Creates a Responsive instance.
const
Responsive.fromContext(BuildContext context)
Creates a Responsive instance from the given context.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isDesktop bool
Whether the device is a desktop.
final
isMobile bool
Whether the device is considered a mobile phone.
final
isMobileOrSmallerTablet bool
Convenience getter for mobile or small tablet.
no setter
isSmallerTablet bool
Whether the device is a small tablet.
final
isTablet bool
Whether the device is a tablet.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size Size
The absolute size of the screen.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

isDesktopContext(BuildContext context) bool
Returns true if the current context is desktop.
isMobileContext(BuildContext context) bool
Returns true if the current context is mobile.
isSmallerTabletContext(BuildContext context) bool
Returns true if the current context is a smaller tablet.
isTabletContext(BuildContext context) bool
Returns true if the current context is a tablet.
of(BuildContext context) Responsive
Retrieves the Responsive data from the nearest ResponsiveScope.