MediaQuery class abstract

Media queries allow you to apply CSS styles depending on a device's media type (such as print vs. screen) or other features or characteristics such as screen resolution or orientation, aspect ratio, browser viewport width or height, user preferences such as preferring reduced motion, data usage, or transparency.

Constructors

MediaQuery.all({Unit? minWidth, Unit? maxWidth, Unit? minHeight, Unit? maxHeight, Orientation? orientation, bool? canHover, String? aspectRatio, ColorScheme? prefersColorScheme, Contrast? prefersContrast})
Creates a media query that matches all media types.
const
factory
MediaQuery.any(List<MediaQuery> queries)
Combines multiple media queries into a single rule.
const
factory
MediaQuery.not(MediaQuery query)
Creates a media query that negates the given query, returning true if the query would otherwise return false.
const
factory
MediaQuery.print({Unit? minWidth, Unit? maxWidth, Unit? minHeight, Unit? maxHeight, Orientation? orientation, bool? canHover, String? aspectRatio, ColorScheme? prefersColorScheme, Contrast? prefersContrast})
Creates a media query that matches print media types.
const
factory
MediaQuery.raw(String query)
Creates a media query from a custom string.
const
factory
MediaQuery.screen({Unit? minWidth, Unit? maxWidth, Unit? minHeight, Unit? maxHeight, Orientation? orientation, bool? canHover, String? aspectRatio, ColorScheme? prefersColorScheme, Contrast? prefersContrast})
Creates a media query that matches screen media types.
const
factory

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

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