Breakpoint class abstract

An interface to define the conditions that distinguish between types of screens.

Adaptive apps usually display differently depending on the screen type: a compact layout for smaller screens, or a relaxed layout for larger screens. Override this class by defining isActive to fetch the screen property (usually MediaQuery.of) and return true if the condition is met.

Breakpoints do not need to be exclusive because they are tested in order with the last Breakpoint active taking priority.

If the condition is only based on the screen width and/or the device type, use WidthPlatformBreakpoint to define the Breakpoint.

See also:

Implementers

Constructors

Breakpoint()
Returns a const Breakpoint.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

isActive(BuildContext context) bool
A method that returns true based on conditions related to the context of the screen such as MediaQuery.sizeOf(context).width.
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