TailwindBreakpoint enum
Defines responsive breakpoints based on the Tailwind CSS system.
These breakpoints represent minimum screen widths (in logical pixels) and are used to adapt UI layouts responsively, similar to Tailwind's utility-first design approach.
Implements BreakpointSpec so it integrates with utilities like ResponsiveBreakpointTheme.
Tailwind Breakpoint Ranges:
sm
: ≥640pxmd
: ≥768pxlg
: ≥1024pxxl
: ≥1280pxxxl
: ≥1536px (corresponds to Tailwind's2xl
)
Note: Dart enums cannot start with a digit, so
2xl
is namedxxl
.
Example:
final current = ResponsiveBreakpointTheme.of<TailwindBreakpoint>(context);
if (current >= TailwindBreakpoint.lg) {
// Render large screen layout
}
- Inheritance
- Implemented types
- Available extensions
Values
- xs → const TailwindBreakpoint
-
Small screen: <640px
const TailwindBreakpoint(breakpoint: 0)
- sm → const TailwindBreakpoint
-
Small screen: ≥640px
const TailwindBreakpoint(breakpoint: 640)
- md → const TailwindBreakpoint
-
Medium screen: ≥768px
const TailwindBreakpoint(breakpoint: 768)
- lg → const TailwindBreakpoint
-
Large screen: ≥1024px
const TailwindBreakpoint(breakpoint: 1024)
- xl → const TailwindBreakpoint
-
Extra large screen: ≥1280px
const TailwindBreakpoint(breakpoint: 1280)
- xxl → const TailwindBreakpoint
-
Extra extra large screen: ≥1536px (Tailwind's
2xl
)const TailwindBreakpoint(breakpoint: 1536)
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
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - 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
.
Constants
-
values
→ const List<
TailwindBreakpoint> - A constant List of the values in this enum, in order of their declaration.