ResponsiveBreakpointTheme<T extends BreakpointSpec> class

A theme extension that allows customizing and resolving breakpoints based on screen width, using MediaQuery.

T must implement BreakpointSpec, which defines a breakpoint value (e.g. for screen width breakpoints like sm, md, lg).

Inheritance

Constructors

ResponsiveBreakpointTheme.new({required List<T> breakpoints})
Creates a ResponsiveBreakpointTheme with a required list of breakpoints.
const

Properties

breakpoints List<T>
List of breakpoints sorted by width (ascending).
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Type
Required for theme extension to identify the type.
no setteroverride

Methods

copyWith({List<T>? breakpoints}) ResponsiveBreakpointTheme<T>
Creates a copy of the theme with optionally updated breakpoints.
override
lerp(covariant ResponsiveBreakpointTheme<T>? other, double t) ResponsiveBreakpointTheme<T>
Defines how to interpolate between two ResponsiveBreakpointThemes.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveBreakpoint(BuildContext context) → T
Resolves the appropriate breakpoint for the current screen width based on MediaQuery.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

of<T extends BreakpointSpec>(BuildContext context) → T
Static helper to get the resolved breakpoint of type T from the current BuildContext.