MediaQueryData constructor
- Size size = Size.zero,
- double devicePixelRatio = 1.0,
- @Deprecated('Use textScaler instead. ' 'Use of textScaleFactor was deprecated in preparation for the upcoming nonlinear text scaling support. ' 'This feature was deprecated after v3.12.0-2.0.pre.') double textScaleFactor = 1.0,
- TextScaler textScaler = _kUnspecifiedTextScaler,
- Brightness platformBrightness = Brightness.light,
- EdgeInsets padding = EdgeInsets.zero,
- EdgeInsets viewInsets = EdgeInsets.zero,
- EdgeInsets systemGestureInsets = EdgeInsets.zero,
- EdgeInsets viewPadding = EdgeInsets.zero,
- bool alwaysUse24HourFormat = false,
- bool invertColors = false,
- bool highContrast = false,
- bool onOffSwitchLabels = false,
- bool disableAnimations = false,
- bool boldText = false,
- DeviceGestureSettings gestureSettings = const DeviceGestureSettings(touchSlop: kTouchSlop),
- List<
DisplayFeature> displayFeatures = const <ui.DisplayFeature>[], - bool supportsShowingSystemContextMenu = false,
Creates data for a media query with explicit values.
In a typical application, calling this constructor directly is rarely needed. Consider using MediaQueryData.fromView to create data based on a dart:ui.FlutterView, or MediaQueryData.copyWith to create a new copy of MediaQueryData with updated properties from a base MediaQueryData.
Implementation
const MediaQueryData({
this.size = Size.zero,
this.devicePixelRatio = 1.0,
@Deprecated(
'Use textScaler instead. '
'Use of textScaleFactor was deprecated in preparation for the upcoming nonlinear text scaling support. '
'This feature was deprecated after v3.12.0-2.0.pre.',
)
double textScaleFactor = 1.0,
TextScaler textScaler = _kUnspecifiedTextScaler,
this.platformBrightness = Brightness.light,
this.padding = EdgeInsets.zero,
this.viewInsets = EdgeInsets.zero,
this.systemGestureInsets = EdgeInsets.zero,
this.viewPadding = EdgeInsets.zero,
this.alwaysUse24HourFormat = false,
this.accessibleNavigation = false,
this.invertColors = false,
this.highContrast = false,
this.onOffSwitchLabels = false,
this.disableAnimations = false,
this.boldText = false,
this.navigationMode = NavigationMode.traditional,
this.gestureSettings = const DeviceGestureSettings(touchSlop: kTouchSlop),
this.displayFeatures = const <ui.DisplayFeature>[],
this.supportsShowingSystemContextMenu = false,
}) : _textScaleFactor = textScaleFactor,
_textScaler = textScaler,
assert(
identical(textScaler, _kUnspecifiedTextScaler) || textScaleFactor == 1.0,
'textScaleFactor is deprecated and cannot be specified when textScaler is specified.',
);