@@ -149,8 +149,8 @@ const double _kMaxRegularTextScaleFactor = 1.4;
149149// Accessibility mode on iOS is determined by the text scale factor that the
150150// user has selected.
151151bool _isInAccessibilityMode (BuildContext context) {
152- final MediaQueryData ? data = MediaQuery .maybeOf (context);
153- return data != null && data.textScaleFactor > _kMaxRegularTextScaleFactor;
152+ final double ? factor = MediaQuery .maybeTextScaleFactorOf (context);
153+ return factor != null && factor > _kMaxRegularTextScaleFactor;
154154}
155155
156156/// An iOS-style alert dialog.
@@ -257,7 +257,7 @@ class CupertinoAlertDialog extends StatelessWidget {
257257 final Curve insetAnimationCurve;
258258
259259 Widget _buildContent (BuildContext context) {
260- final double textScaleFactor = MediaQuery .of (context).textScaleFactor ;
260+ final double textScaleFactor = MediaQuery .textScaleFactorOf (context);
261261
262262 final List <Widget > children = < Widget > [
263263 if (title != null || content != null )
@@ -317,7 +317,7 @@ class CupertinoAlertDialog extends StatelessWidget {
317317 Widget build (BuildContext context) {
318318 final CupertinoLocalizations localizations = CupertinoLocalizations .of (context);
319319 final bool isInAccessibilityMode = _isInAccessibilityMode (context);
320- final double textScaleFactor = MediaQuery .of (context).textScaleFactor ;
320+ final double textScaleFactor = MediaQuery .textScaleFactorOf (context);
321321 return CupertinoUserInterfaceLevel (
322322 data: CupertinoUserInterfaceLevelData .elevated,
323323 child: MediaQuery (
@@ -331,7 +331,7 @@ class CupertinoAlertDialog extends StatelessWidget {
331331 child: LayoutBuilder (
332332 builder: (BuildContext context, BoxConstraints constraints) {
333333 return AnimatedPadding (
334- padding: MediaQuery .of (context).viewInsets +
334+ padding: MediaQuery .viewInsetsOf (context) +
335335 const EdgeInsets .symmetric (horizontal: 40.0 , vertical: 24.0 ),
336336 duration: insetAnimationDuration,
337337 curve: insetAnimationCurve,
@@ -611,12 +611,12 @@ class CupertinoActionSheet extends StatelessWidget {
611611 if (cancelButton != null ) _buildCancelButton (),
612612 ];
613613
614- final Orientation orientation = MediaQuery .of (context).orientation ;
614+ final Orientation orientation = MediaQuery .orientationOf (context);
615615 final double actionSheetWidth;
616616 if (orientation == Orientation .portrait) {
617- actionSheetWidth = MediaQuery .of (context).size .width - (_kActionSheetEdgeHorizontalPadding * 2 );
617+ actionSheetWidth = MediaQuery .sizeOf (context).width - (_kActionSheetEdgeHorizontalPadding * 2 );
618618 } else {
619- actionSheetWidth = MediaQuery .of (context).size .height - (_kActionSheetEdgeHorizontalPadding * 2 );
619+ actionSheetWidth = MediaQuery .sizeOf (context).height - (_kActionSheetEdgeHorizontalPadding * 2 );
620620 }
621621
622622 return SafeArea (
@@ -797,7 +797,7 @@ class _CupertinoDialogRenderWidget extends RenderObjectWidget {
797797 @override
798798 RenderObject createRenderObject (BuildContext context) {
799799 return _RenderCupertinoDialog (
800- dividerThickness: _kDividerThickness / MediaQuery .of (context).devicePixelRatio ,
800+ dividerThickness: _kDividerThickness / MediaQuery .devicePixelRatioOf (context),
801801 isInAccessibilityMode: _isInAccessibilityMode (context) && ! isActionSheet,
802802 dividerColor: CupertinoDynamicColor .resolve (dividerColor, context),
803803 isActionSheet: isActionSheet,
@@ -1464,7 +1464,7 @@ class _CupertinoAlertActionSection extends StatelessWidget {
14641464
14651465 @override
14661466 Widget build (BuildContext context) {
1467- final double devicePixelRatio = MediaQuery .of (context).devicePixelRatio ;
1467+ final double devicePixelRatio = MediaQuery .devicePixelRatioOf (context);
14681468
14691469 final List <Widget > interactiveButtons = < Widget > [];
14701470 for (int i = 0 ; i < children.length; i += 1 ) {
0 commit comments