pub struct MediaQueryData {Show 27 fields
pub size: Size,
pub device_pixel_ratio: f64,
pub text_scaler: TextScaler,
pub platform_brightness: Brightness,
pub view_insets: EdgeInsets,
pub padding: EdgeInsets,
pub view_padding: EdgeInsets,
pub system_gesture_insets: EdgeInsets,
pub always_use_24_hour_format: bool,
pub accessible_navigation: bool,
pub invert_colors: bool,
pub high_contrast: bool,
pub on_off_switch_labels: bool,
pub disable_animations: bool,
pub reduce_motion: bool,
pub bold_text: bool,
pub supports_announce: bool,
pub navigation_mode: NavigationMode,
pub gesture_settings: DeviceGestureSettings,
pub supports_showing_system_context_menu: bool,
pub line_height_scale_factor_override: Option<f64>,
pub letter_spacing_override: Option<f64>,
pub word_spacing_override: Option<f64>,
pub paragraph_spacing_override: Option<f64>,
pub display_corner_radii: Option<BorderRadius>,
pub caption_style: Option<CaptionStyle>,
pub title_bar_area: Option<TitleBarArea>,
}Expand description
Information about a piece of media (e.g., a window).
For example, the size property contains the width and height of the
current window.
To obtain individual attributes in a MediaQueryData, prefer to use the
attribute-specific functions of MediaQuery over obtaining the entire
MediaQueryData and accessing its members. Querying using MediaQuery::of will cause
your widget to rebuild automatically whenever any field of the MediaQueryData
changes (e.g., if the user rotates their device). Therefore, unless you are concerned
with the entire MediaQueryData object changing, prefer using the specific methods
(for example: MediaQuery::size_of and MediaQuery::padding_of), as it will rebuild
more efficiently.
To obtain the entire current MediaQueryData for a given BuildContext, use the
MediaQuery::of function. This can be useful if you are going to use
copy_with to replace the MediaQueryData with one with an updated
property.
§Insets and Padding
padding relates to view_padding and
view_insets, in the simplest configuration, as the difference
between the two. In cases when the view insets exceed the view padding, like when a
software keyboard is shown below, padding goes to zero rather than a negative value.
Therefore, padding is calculated by taking max(0.0, viewPadding - viewInsets).
MediaQueryData includes three EdgeInsets values: padding,
view_padding, and view_insets. These
values reflect the configuration of the device and are used and optionally consumed by
widgets that position content within these insets. The padding value defines areas that
might not be completely visible, like the display “notch” on the iPhone X. The
view insets value defines areas that aren’t visible at all, typically because they’re
obscured by the device’s keyboard. Similar to view insets, view padding does not
differentiate padding in areas that may be obscured. For example, by using the view
padding property, padding would defer to the iPhone “safe area” regardless of whether a
keyboard is showing.
The view insets and view padding are independent values, they’re measured from the
edges of the MediaQuery widget’s bounds. Together they inform the
padding property. The bounds of the top level MediaQuery created
by WidgetsApp are the same as the window that contains the app.
Widgets whose layouts consume space defined by view_insets,
view_padding, or padding should enclose their
children in secondary MediaQuery widgets that reduce those properties by the same
amount. The remove_padding,
remove_view_padding, and
remove_view_insets methods are useful for this.
Dart’s named constructor arguments are the fluent setters
(MediaQueryData::new().size(size).padding(padding)); copy_with
clones for the same chain.
Fields§
§size: SizeThe size of the media in logical pixels (e.g, the size of the screen).
Logical pixels are roughly the same visual size across devices. Physical pixels are
the size of the actual hardware pixels on the device. The number of physical pixels
per logical pixel is described by the device_pixel_ratio.
Prefer using MediaQuery::size_of over MediaQuery::of.size to get the size,
since the former will only notify of changes in size, while the latter
will notify for all MediaQueryData changes.
For widgets drawn in an Overlay, do not assume that the size of the Overlay is
the size of the MediaQuery’s size. Nested overlays can have different sizes.
§Troubleshooting
It is considered bad practice to cache and later use the size returned by
MediaQuery::size_of(app, context). It will make the application non-responsive and
might lead to unexpected behaviors.
For instance, during startup, especially in release mode, the first returned size
might be Size::ZERO. The size will be updated when the native platform reports
the actual resolution. Using MediaQuery::size_of will ensure that when the size
changes, any widgets depending on the size are automatically rebuilt.
device_pixel_ratio: f64The number of device pixels for each logical pixel of the encompassing view. This number might not be a power of two. Indeed, it might not even be an integer. For example, the Nexus 6 has a device pixel ratio of 3.5.
This property is typically only informational. Overriding this property does not rescale the app as the framework or its rendering pipeline usually does not read this value.
text_scaler: TextScalerThe font scaling strategy to use for laying out textual contents.
If this MediaQueryData is created by the from_view
constructor, this property reflects the platform’s preferred text scaling strategy,
and may change as the user changes the scaling factor in the operating system’s
accessibility settings.
See also:
MediaQuery::text_scaler_of, a method to find and depend on thetext_scalerdefined for aBuildContext.TextPainter, a class that lays out and paints text.
platform_brightness: BrightnessThe current brightness mode of the host platform.
For example, starting in Android Pie, battery saver mode asks all apps to render in a “dark mode”.
Not all platforms necessarily support a concept of brightness mode. Those platforms
will report Brightness::Light in this property.
See also:
MediaQuery::platform_brightness_of, a method to find and depend on the platform brightness defined for aBuildContext.
view_insets: EdgeInsetsThe parts of the display that are completely obscured by system UI, typically by the device’s keyboard.
When a mobile device’s keyboard is visible view_insets.bottom corresponds to the
top of the keyboard.
This value is independent of the padding and
view_padding. View padding is measured from the edges of the
MediaQuery widget’s bounds. Padding is calculated based on the view padding and
view insets. The bounds of the top level MediaQuery created by WidgetsApp are
the same as the window (often the mobile device screen) that contains the app.
padding: EdgeInsetsThe parts of the display that are partially obscured by system UI, typically by the hardware display “notches” or the system status bar.
If you consumed this padding (e.g. by building a widget that envelops or accounts for
this padding in its layout in such a way that children are no longer exposed to this
padding), you should remove this padding for subsequent descendants in the widget
tree by inserting a new MediaQuery widget using the MediaQuery::remove_padding
constructor.
Padding is derived from the values of view_insets and
view_padding.
See also:
SafeArea, a widget that consumes this padding with aPaddingwidget and automatically removes it from theMediaQueryfor its child.
view_padding: EdgeInsetsThe parts of the display that are partially obscured by system UI, typically by the hardware display “notches” or the system status bar.
This value remains the same regardless of whether the system is reporting other obstructions in the same physical area of the screen. For example, a software keyboard on the bottom of the screen that may cover and consume the same area that requires bottom padding will not affect this value.
This value is independent of the padding and
view_insets: their values are measured from the edges of the
MediaQuery widget’s bounds. The bounds of the top level MediaQuery created by
WidgetsApp are the same as the window that contains the app. On mobile devices,
this will typically be the full screen.
system_gesture_insets: EdgeInsetsThe areas along the edges of the display where the system consumes certain input events and blocks delivery of those events to the app.
Starting with Android Q, simple swipe gestures that start within the
system_gesture_insets areas are used by the system
for page navigation and may not be delivered to the app. Taps and swipe gestures that
begin with a long-press are delivered to the app, but simple press-drag-release swipe
gestures which begin within the area defined by
system_gesture_insets may not be.
Apps should avoid locating gesture detectors within the system gesture insets area. Apps should feel free to put visual elements within this area.
This property is currently only expected to be set to a non-default value on Android starting with version Q.
always_use_24_hour_format: boolWhether to use 24-hour format when formatting time.
The behavior of this flag is different across platforms:
- On Android this flag is reported directly from the user settings called “Use 24-hour format”. It applies to any locale used by the application, whether it is the system-wide locale, or the custom locale set by the application.
- On iOS this flag is set to true when the user setting called “24-Hour Time” is set or the system-wide locale’s default uses 24-hour formatting.
- On macOS this flag reflects the current system locale’s time format, which incorporates the “24-Hour Time” preference in System Settings. As on iOS, this only takes effect for the system locale; a custom locale passed to the application will ignore the 24-hour preference.
- On Windows this flag is derived from the user’s “Short time” format in the Region settings; it is true when the configured format uses a 24-hour pattern.
- On Linux this flag reflects the desktop environment’s clock-format setting where
available (for example,
org.gnome.desktop.interface.clock-formaton GNOME). On desktops that do not expose such a setting, it defaults to true (24-hour). - On Web this flag is always false.
Whether the user is using an accessibility service like TalkBack or VoiceOver to interact with the application.
When this setting is true, features such as timeouts should be disabled or have minimum durations increased.
invert_colors: boolWhether the operating system is currently inverting the colors of the platform.
This flag indicates that the underlying OS is already performing a global color inversion at the screen level. It does not mean the framework will automatically invert its own layout painting.
Instead, this flag allows the application to react to the inversion. For example, by selectively re-inverting images, maps, or video playback so that they display with natural colors instead of looking like a film negative.
This flag is currently only updated on iOS devices.
high_contrast: boolWhether the platform is requesting a high contrast between foreground and background content.
On iOS, this corresponds to the “Increase Contrast” setting in Settings -> Accessibility. On Android, this corresponds to the “High contrast text” or similar accessibility settings.
This flag indicates that the operating system is already performing high-contrast adjustments or expects the application to adjust its color palette to meet higher accessibility standards.
This flag is currently only updated on iOS devices running iOS 13+ and Android devices running API 34+.
on_off_switch_labels: boolWhether the user requested to show on/off labels inside switches on iOS, via Settings -> Accessibility -> Display & Text Size -> On/Off Labels.
disable_animations: boolWhether the platform is requesting that animations be disabled or reduced as much as possible.
This corresponds to Android’s “Remove animations” accessibility setting.
On iOS, reduced motion is exposed separately via
reduce_motion and does not set this flag.
Manually overriding this value in a MediaQuery widget will not affect framework
animations (for example those driven by AnimationController). However, it can still
be useful for testing or for custom widgets that explicitly read
disable_animations.
When implementing custom explicit animations, you should check this property and adjust behavior accordingly (for example, by reducing duration or skipping non-essential animations when it is true).
reduce_motion: boolWhether the platform is requesting that animations be reduced or replaced with cross-fades in preference to motion effects.
This corresponds to the iOS “Reduce Motion” accessibility setting.
Unlike disable_animations, this flag does not
automatically alter framework animations such as those controlled via
AnimationController. Instead, it is intended to be read by widgets that want to
tone down or replace non-essential motion, for example by substituting a cross-fade
for a slide transition.
When implementing custom animations, you should check this property and adjust behavior accordingly; for example, by preferring a fade over movement when it is true.
bold_text: boolWhether the platform is requesting that text be drawn with a bold font weight.
supports_announce: boolWhether accessibility announcements (like SemanticsService.sendAnnouncement) are
supported on the current platform.
Returns false on platforms where announcements are deprecated or unsupported by the
underlying platform.
Returns true on platforms where such announcements are generally supported without
discouragement. (iOS, web etc)
Describes the navigation mode requested by the platform.
Some user interfaces are better navigated using a directional pad (DPAD) or arrow keys, and for those interfaces, some widgets need to handle these directional events differently. In order to know when to do that, these widgets will look for the navigation mode in effect for their context.
For instance, in a television interface, NavigationMode::Directional should be
set, so that directional navigation is used to navigate away from a text field using
the DPAD. In contrast, on a regular desktop application with the
navigation_mode set to NavigationMode::Traditional,
the arrow keys are used to move the cursor instead of navigating away.
The NavigationMode values indicate the type of navigation to be used in a widget
subtree for those widgets sensitive to it.
gesture_settings: DeviceGestureSettingsThe gesture settings for the view this media query is derived from.
This contains platform specific configuration for gesture behavior, such as touch slop. These settings should be favored for configuring gesture behavior over the framework constants.
Whether showing the system context menu is supported.
For example, on iOS 16.0 and above, the system text selection context menu may be shown instead of the framework-drawn context menu in order to avoid the iOS clipboard access notification when the “Paste” button is pressed.
line_height_scale_factor_override: Option<f64>Overrides the height of the text, as a multiple of the font size.
None when the platform has not set an override for text height.
See also:
Text,SelectableText, andEditableText, all of whoseTextStyle.heightandStrutStyle.heightare overridden by this.
letter_spacing_override: Option<f64>Overrides the amount of space (in logical pixels) to add between each letter in a piece of text.
A negative value can be used to bring the letters closer.
None when the platform has not set an override for text letter spacing.
word_spacing_override: Option<f64>Overrides the amount of space (in logical pixels) to add at each sequence of white-space (i.e. between each word) in a piece of text.
A negative value can be used to bring the words closer.
None when the platform has not set an override for text word spacing.
paragraph_spacing_override: Option<f64>The amount of space (in logical pixels) to add following each paragraph in a piece of text.
None when the platform has not set an override for text paragraph spacing.
display_corner_radii: Option<BorderRadius>The radii of the display corners in logical pixels.
This is currently populated only on Android API 31+. On earlier Android versions,
iOS, and other platforms, this value is None.
caption_style: Option<CaptionStyle>How the user’s system-wide settings say subtitles and captions look, which a
SubtitleView merges into each cue it draws.
If this MediaQueryData is created by the from_view
constructor, this property is the platform’s caption settings’ style, and changes as
the user changes them; None where the platform keeps no caption settings, as Linux
and the web keep none.
See also:
MediaQuery::maybe_caption_style_of, a method to find and depend on the caption style defined for aBuildContext.
title_bar_area: Option<TitleBarArea>The strip along the top that the system’s window buttons sit in, in logical pixels, for a title bar to draw its items beside them: on an iPad window, the close, minimize and zoom buttons at its top left.
padding and view_padding already reach below the
strip, so content laid out within them is clear of the buttons; only a widget that draws
in the strip itself reads this. Removing the top padding removes it too, since what is laid
out below the top is not in the strip.
If this MediaQueryData is created by the from_view constructor,
this property is the view’s title bar area, and changes as the window enters or leaves full
screen; None while no buttons are over the view.
See also:
MediaQuery::title_bar_area_of, a method to find and depend on the title bar area defined for aBuildContext.
Implementations§
Source§impl MediaQueryData
impl MediaQueryData
Sourcepub fn new() -> MediaQueryData
pub fn new() -> MediaQueryData
Creates data for a media query with explicit values.
In a typical application, calling this constructor directly is rarely needed.
Consider using from_view to create data based on a view, or
copy_with to create a new copy of MediaQueryData with
updated properties from a base MediaQueryData.
Sourcepub fn from_view(
app: &App,
view: &dyn EmbedderView,
platform_data: Option<&MediaQueryData>,
) -> MediaQueryData
pub fn from_view( app: &App, view: &dyn EmbedderView, platform_data: Option<&MediaQueryData>, ) -> MediaQueryData
Creates data for a MediaQuery based on the given view.
If provided, the platform_data is used to fill in the platform-specific aspects of
the newly created MediaQueryData. If platform_data is None, the platform
(app.platform(), Dart’s view.platformDispatcher) is consulted to construct the
platform-specific data.
Data which is exposed directly on the view is considered view-specific. Data which is only exposed via the platform is considered platform-specific.
Callers of this method should ensure that they also register for notifications so
that the MediaQueryData can be updated when any data used to construct it changes
(Dart’s WidgetsBindingObserver.didChangeMetrics, didChangeAccessibilityFeatures,
didChangeTextScaleFactor, and didChangePlatformBrightness, which wait with the
observer). The last three notifications are only relevant if no platform_data is
provided. If platform_data is provided, callers should ensure to call this method
again when it changes to keep the constructed MediaQueryData updated.
The platform here reports its brightness, its system context menu support, and the
user’s caption style: the accessibility features, the 24-hour format, the text scale
factor, and the text style overrides, as well as the view’s system gesture insets and
display corner radii, keep their defaults until the embedder exposes them (see
PORTING.md).
In general, MediaQuery::of, and its associated “…Of” methods, are the
appropriate way to obtain MediaQueryData from a widget. This from_view
constructor is primarily for use in the implementation of the framework itself.
See also:
MediaQuery::from_view, which constructsMediaQueryDatafrom a provided view, makes it available to descendant widgets, and sets up the appropriate notification listeners to keep the data updated.
Sourcepub fn size(self, size: Size) -> MediaQueryData
pub fn size(self, size: Size) -> MediaQueryData
Dart MediaQueryData(size:).
Sourcepub fn device_pixel_ratio(self, device_pixel_ratio: f64) -> MediaQueryData
pub fn device_pixel_ratio(self, device_pixel_ratio: f64) -> MediaQueryData
Dart MediaQueryData(devicePixelRatio:).
Sourcepub fn text_scaler(self, text_scaler: TextScaler) -> MediaQueryData
pub fn text_scaler(self, text_scaler: TextScaler) -> MediaQueryData
Dart MediaQueryData(textScaler:).
Sourcepub fn platform_brightness(
self,
platform_brightness: Brightness,
) -> MediaQueryData
pub fn platform_brightness( self, platform_brightness: Brightness, ) -> MediaQueryData
Dart MediaQueryData(platformBrightness:).
Sourcepub fn padding(self, padding: EdgeInsets) -> MediaQueryData
pub fn padding(self, padding: EdgeInsets) -> MediaQueryData
Dart MediaQueryData(padding:).
Sourcepub fn view_insets(self, view_insets: EdgeInsets) -> MediaQueryData
pub fn view_insets(self, view_insets: EdgeInsets) -> MediaQueryData
Dart MediaQueryData(viewInsets:).
Sourcepub fn system_gesture_insets(
self,
system_gesture_insets: EdgeInsets,
) -> MediaQueryData
pub fn system_gesture_insets( self, system_gesture_insets: EdgeInsets, ) -> MediaQueryData
Dart MediaQueryData(systemGestureInsets:).
Sourcepub fn view_padding(self, view_padding: EdgeInsets) -> MediaQueryData
pub fn view_padding(self, view_padding: EdgeInsets) -> MediaQueryData
Dart MediaQueryData(viewPadding:).
Sourcepub fn always_use_24_hour_format(
self,
always_use_24_hour_format: bool,
) -> MediaQueryData
pub fn always_use_24_hour_format( self, always_use_24_hour_format: bool, ) -> MediaQueryData
Dart MediaQueryData(alwaysUse24HourFormat:).
Dart MediaQueryData(accessibleNavigation:).
Sourcepub fn invert_colors(self, invert_colors: bool) -> MediaQueryData
pub fn invert_colors(self, invert_colors: bool) -> MediaQueryData
Dart MediaQueryData(invertColors:).
Sourcepub fn high_contrast(self, high_contrast: bool) -> MediaQueryData
pub fn high_contrast(self, high_contrast: bool) -> MediaQueryData
Dart MediaQueryData(highContrast:).
Sourcepub fn on_off_switch_labels(self, on_off_switch_labels: bool) -> MediaQueryData
pub fn on_off_switch_labels(self, on_off_switch_labels: bool) -> MediaQueryData
Dart MediaQueryData(onOffSwitchLabels:).
Sourcepub fn disable_animations(self, disable_animations: bool) -> MediaQueryData
pub fn disable_animations(self, disable_animations: bool) -> MediaQueryData
Dart MediaQueryData(disableAnimations:).
Sourcepub fn reduce_motion(self, reduce_motion: bool) -> MediaQueryData
pub fn reduce_motion(self, reduce_motion: bool) -> MediaQueryData
Dart MediaQueryData(reduceMotion:).
Sourcepub fn bold_text(self, bold_text: bool) -> MediaQueryData
pub fn bold_text(self, bold_text: bool) -> MediaQueryData
Dart MediaQueryData(boldText:).
Sourcepub fn supports_announce(self, supports_announce: bool) -> MediaQueryData
pub fn supports_announce(self, supports_announce: bool) -> MediaQueryData
Dart MediaQueryData(supportsAnnounce:).
Dart MediaQueryData(navigationMode:).
Sourcepub fn gesture_settings(
self,
gesture_settings: DeviceGestureSettings,
) -> MediaQueryData
pub fn gesture_settings( self, gesture_settings: DeviceGestureSettings, ) -> MediaQueryData
Dart MediaQueryData(gestureSettings:).
Dart MediaQueryData(supportsShowingSystemContextMenu:).
Sourcepub fn line_height_scale_factor_override(
self,
line_height_scale_factor_override: f64,
) -> MediaQueryData
pub fn line_height_scale_factor_override( self, line_height_scale_factor_override: f64, ) -> MediaQueryData
Dart MediaQueryData(lineHeightScaleFactorOverride:).
Sourcepub fn letter_spacing_override(
self,
letter_spacing_override: f64,
) -> MediaQueryData
pub fn letter_spacing_override( self, letter_spacing_override: f64, ) -> MediaQueryData
Dart MediaQueryData(letterSpacingOverride:).
Sourcepub fn caption_style(self, caption_style: CaptionStyle) -> MediaQueryData
pub fn caption_style(self, caption_style: CaptionStyle) -> MediaQueryData
The user’s caption style; MediaQueryData has no counterpart in Dart.
Sourcepub fn title_bar_area(self, title_bar_area: TitleBarArea) -> MediaQueryData
pub fn title_bar_area(self, title_bar_area: TitleBarArea) -> MediaQueryData
The strip the window buttons sit in; MediaQueryData has no counterpart in Dart.
Sourcepub fn word_spacing_override(self, word_spacing_override: f64) -> MediaQueryData
pub fn word_spacing_override(self, word_spacing_override: f64) -> MediaQueryData
Dart MediaQueryData(wordSpacingOverride:).
Sourcepub fn paragraph_spacing_override(
self,
paragraph_spacing_override: f64,
) -> MediaQueryData
pub fn paragraph_spacing_override( self, paragraph_spacing_override: f64, ) -> MediaQueryData
Dart MediaQueryData(paragraphSpacingOverride:).
Sourcepub fn display_corner_radii(
self,
display_corner_radii: BorderRadius,
) -> MediaQueryData
pub fn display_corner_radii( self, display_corner_radii: BorderRadius, ) -> MediaQueryData
Dart MediaQueryData(displayCornerRadii:).
Sourcepub fn orientation(&self) -> Orientation
pub fn orientation(&self) -> Orientation
The orientation of the media (e.g., whether the device is in landscape or portrait mode).
Sourcepub fn copy_with(&self) -> MediaQueryData
pub fn copy_with(&self) -> MediaQueryData
Creates a copy of this media query data but with the given fields replaced with the
new values: chain the field setters on the result
(data.copy_with().text_scaler(TextScaler::NO_SCALING)).
Sourcepub fn apply_text_style_overrides(
&self,
line_height_scale_factor_override: Option<f64>,
letter_spacing_override: Option<f64>,
word_spacing_override: Option<f64>,
paragraph_spacing_override: Option<f64>,
) -> MediaQueryData
pub fn apply_text_style_overrides( &self, line_height_scale_factor_override: Option<f64>, letter_spacing_override: Option<f64>, word_spacing_override: Option<f64>, paragraph_spacing_override: Option<f64>, ) -> MediaQueryData
Creates a copy of this media query data but with the
line_height_scale_factor_override, letter_spacing_override,
word_spacing_override, and paragraph_spacing_override replaced with the given
values.
If an argument is None, then this MediaQueryData is returned with the
corresponding override set to None.
See also:
MediaQuery::apply_text_style_overrides, which uses this method to apply text style overrides to the ambientMediaQuery.
Sourcepub fn apply_display_corner_radii(
&self,
display_corner_radii: Option<BorderRadius>,
) -> MediaQueryData
pub fn apply_display_corner_radii( &self, display_corner_radii: Option<BorderRadius>, ) -> MediaQueryData
Creates a copy of this media query data but with the display_corner_radii replaced
with the given value.
If the argument is None, then this MediaQueryData is returned with the
display_corner_radii set to None.
Sourcepub fn remove_padding(
&self,
remove_left: bool,
remove_top: bool,
remove_right: bool,
remove_bottom: bool,
) -> MediaQueryData
pub fn remove_padding( &self, remove_left: bool, remove_top: bool, remove_right: bool, remove_bottom: bool, ) -> MediaQueryData
Creates a copy of this media query data but with the given paddings
replaced with zero.
If all four of the remove_left, remove_top, remove_right, and remove_bottom
arguments are false, then this MediaQueryData is returned unmodified.
See also:
MediaQuery::remove_padding, which uses this method to removepaddingfrom the ambientMediaQuery.SafeArea, which both removes the padding from theMediaQueryand adds aPaddingwidget.remove_view_insets, the same thing but forview_insets.remove_view_padding, the same thing but forview_padding.
Sourcepub fn remove_view_insets(
&self,
remove_left: bool,
remove_top: bool,
remove_right: bool,
remove_bottom: bool,
) -> MediaQueryData
pub fn remove_view_insets( &self, remove_left: bool, remove_top: bool, remove_right: bool, remove_bottom: bool, ) -> MediaQueryData
Creates a copy of this media query data but with the given
view_insets replaced with zero.
If all four of the remove_left, remove_top, remove_right, and remove_bottom
arguments are false, then this MediaQueryData is returned unmodified.
See also:
MediaQuery::remove_view_insets, which uses this method to removeview_insetsfrom the ambientMediaQuery.remove_padding, the same thing but forpadding.remove_view_padding, the same thing but forview_padding.
Sourcepub fn remove_view_padding(
&self,
remove_left: bool,
remove_top: bool,
remove_right: bool,
remove_bottom: bool,
) -> MediaQueryData
pub fn remove_view_padding( &self, remove_left: bool, remove_top: bool, remove_right: bool, remove_bottom: bool, ) -> MediaQueryData
Creates a copy of this media query data but with the given
view_padding replaced with zero.
If all four of the remove_left, remove_top, remove_right, and remove_bottom
arguments are false, then this MediaQueryData is returned unmodified.
See also:
MediaQuery::remove_view_padding, which uses this method to removeview_paddingfrom the ambientMediaQuery.remove_padding, the same thing but forpadding.remove_view_insets, the same thing but forview_insets.
Trait Implementations§
Source§impl Clone for MediaQueryData
impl Clone for MediaQueryData
Source§impl Debug for MediaQueryData
impl Debug for MediaQueryData
Source§impl Default for MediaQueryData
impl Default for MediaQueryData
Source§fn default() -> MediaQueryData
fn default() -> MediaQueryData
Source§impl Display for MediaQueryData
Dart’s MediaQueryData.toString, which a MediaQuery dump prints.
impl Display for MediaQueryData
Dart’s MediaQueryData.toString, which a MediaQuery dump prints.