BreakpointSpec class interface
A contract for defining layout breakpoints based on screen width.
This interface class
ensures that any implementing class or enum
provides a breakpoint value, which represents the minimum screen width
(in logical pixels) at which the breakpoint becomes active.
Typically used with ResponsiveBreakpointTheme to adapt layouts responsively.
Example:
enum MyBreakpoints implements BreakpointSpec {
sm(breakpoint: 600),
md(breakpoint: 960),
lg(breakpoint: 1280);
@override
final double breakpoint;
const MyBreakpoints({required this.breakpoint});
}
- Available extensions
Constructors
- BreakpointSpec.new({required double breakpoint})
-
Creates a BreakpointSpec with a required
breakpoint
value.const
Properties
- breakpoint → double
-
The minimum width (in logical pixels) at which this breakpoint applies.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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 <(
BreakpointSpec other) → bool -
Available on BreakpointSpec, provided by the BreakpointComparison extension
Returnstrue
if this breakpoint is less thanother
. -
operator <=(
BreakpointSpec other) → bool -
Available on BreakpointSpec, provided by the BreakpointComparison extension
Returnstrue
if this breakpoint is less than or equal toother
. -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
BreakpointSpec other) → bool -
Available on BreakpointSpec, provided by the BreakpointComparison extension
Returnstrue
if this breakpoint is greater thanother
. -
operator >=(
BreakpointSpec other) → bool -
Available on BreakpointSpec, provided by the BreakpointComparison extension
Returnstrue
if this breakpoint is greater than or equal toother
.