@@ -129,7 +129,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
129
129
final EdgeInsets viewInsets =
130
130
EdgeInsets .fromViewPadding (View .of (context).viewInsets, View .of (context).devicePixelRatio);
131
131
final double actualVisibleScreenHeight =
132
- (widget.screenSize? .height ?? MediaQuery .of (context).size .height) - viewInsets.bottom;
132
+ (widget.screenSize? .height ?? MediaQuery .sizeOf (context).height) - viewInsets.bottom;
133
133
final hasSpaceInBottom = (actualVisibleScreenHeight - bottomPosition) >= height;
134
134
return widget.tooltipPosition ??
135
135
(hasSpaceInTop && ! hasSpaceInBottom ? TooltipPosition .top : TooltipPosition .bottom);
@@ -189,7 +189,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
189
189
if (widget.position != null ) {
190
190
final width = widget.container != null ? _customContainerWidth.value : tooltipWidth;
191
191
double leftPositionValue = widget.position! .getCenter () - (width * 0.5 );
192
- if ((leftPositionValue + width) > MediaQuery .of (context).size .width) {
192
+ if ((leftPositionValue + width) > MediaQuery .sizeOf (context).width) {
193
193
return null ;
194
194
} else if ((leftPositionValue) < _kDefaultPaddingFromParent) {
195
195
return _kDefaultPaddingFromParent;
@@ -205,10 +205,10 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
205
205
final width = widget.container != null ? _customContainerWidth.value : tooltipWidth;
206
206
207
207
final left = _getLeft ();
208
- if (left == null || (left + width) > MediaQuery .of (context).size .width) {
208
+ if (left == null || (left + width) > MediaQuery .sizeOf (context).width) {
209
209
final rightPosition = widget.position! .getCenter () + (width * 0.5 );
210
210
211
- return (rightPosition + width) > MediaQuery .of (context).size .width
211
+ return (rightPosition + width) > MediaQuery .sizeOf (context).width
212
212
? _kDefaultPaddingFromParent
213
213
: null ;
214
214
} else {
@@ -232,7 +232,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
232
232
final calculatedLeft = _getLeft ();
233
233
var left = calculatedLeft == null ? 0 : (widget.position! .getCenter () - calculatedLeft);
234
234
var right = _getLeft () == null
235
- ? (MediaQuery .of (context).size .width - widget.position! .getCenter ()) - (_getRight () ?? 0 )
235
+ ? (MediaQuery .sizeOf (context).width - widget.position! .getCenter ()) - (_getRight () ?? 0 )
236
236
: 0 ;
237
237
final containerWidth = widget.container != null ? _customContainerWidth.value : tooltipWidth;
238
238
@@ -246,7 +246,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
246
246
double _getAlignmentY () {
247
247
var dy = isArrowUp
248
248
? - 1.0
249
- : (MediaQuery .of (context).size .height / 2 ) < widget.position! .getTop ()
249
+ : (MediaQuery .sizeOf (context).height / 2 ) < widget.position! .getTop ()
250
250
? - 1.0
251
251
: 1.0 ;
252
252
return dy;
@@ -559,7 +559,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
559
559
final textPainter = TextPainter (
560
560
text: TextSpan (text: text, style: style),
561
561
maxLines: 1 ,
562
- textScaleFactor : MediaQuery .of (context).textScaleFactor ,
562
+ textScaler : MediaQuery .textScalerOf (context),
563
563
textDirection: TextDirection .ltr,
564
564
)..layout ();
565
565
return textPainter.size;
@@ -573,7 +573,7 @@ class _ToolTipWidgetState extends State<ToolTipWidget> with TickerProviderStateM
573
573
574
574
double ? _getArrowRight (double arrowWidth) {
575
575
if (_getLeft () != null ) return null ;
576
- return (MediaQuery .of (context).size .width - widget.position! .getCenter ()) -
576
+ return (MediaQuery .sizeOf (context).width - widget.position! .getCenter ()) -
577
577
(_getRight () ?? 0 ) -
578
578
(arrowWidth / 2 );
579
579
}
0 commit comments