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.
constfactory
-
MediaQuery.any(List<
MediaQuery> queries) -
Combines multiple media queries into a single rule.
constfactory
- MediaQuery.not(MediaQuery query)
-
Creates a media query that negates the given query, returning
true
if the query would otherwise returnfalse
.constfactory - 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.
constfactory
- MediaQuery.raw(String query)
-
Creates a media query from a custom string.
constfactory
- 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.
constfactory
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