saltedpotatos
Committed by GitHub

Rudimentary fix for devicePixelRatio (#365)

Tries to mirror changes made in flutter/flutter PR 126535 for devicePixelRatio

Does not mirror changes made to scroll_position.dart

  @override
  double get devicePixelRatio => context.devicePixelRatio;
@@ -392,6 +392,8 @@ class SheetState extends State<SheetScrollable> @@ -392,6 +392,8 @@ class SheetState extends State<SheetScrollable>
392 392
393 @override 393 @override
394 void didChangeDependencies() { 394 void didChangeDependencies() {
  395 + _devicePixelRatio = MediaQuery.maybeDevicePixelRatioOf(context) ??
  396 + View.of(context).devicePixelRatio;
395 _updatePosition(); 397 _updatePosition();
396 super.didChangeDependencies(); 398 super.didChangeDependencies();
397 } 399 }
@@ -560,6 +562,10 @@ class SheetState extends State<SheetScrollable> @@ -560,6 +562,10 @@ class SheetState extends State<SheetScrollable>
560 TickerProvider get vsync => this; 562 TickerProvider get vsync => this;
561 563
562 @override 564 @override
  565 + double get devicePixelRatio => _devicePixelRatio;
  566 + late double _devicePixelRatio;
  567 +
  568 + @override
563 @protected 569 @protected
564 void setIgnorePointer(bool value) { 570 void setIgnorePointer(bool value) {
565 if (_shouldIgnorePointer == value) return; 571 if (_shouldIgnorePointer == value) return;