Skip to content

Commit 959cdb7

Browse files
Remove deprecated TestWindow.textScaleFactorTestValue/TestWindow.clearTextScaleFactorTestValue (#133176)
Part of: flutter/flutter#133171
1 parent 8cbf42a commit 959cdb7

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

packages/flutter_test/lib/src/window.dart

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ class _UnsupportedDisplay implements TestDisplay {
11581158
/// // Fake the desired properties of the TestWindow. All code running
11591159
/// // within this test will perceive the following fake text scale
11601160
/// // factor as the real text scale factor of the window.
1161-
/// testBinding.window.textScaleFactorTestValue = 2.5; // ignore: deprecated_member_use
1161+
/// testBinding.platformDispatcher.textScaleFactorTestValue = 2.5;
11621162
///
11631163
/// // Test code that depends on text scale factor here.
11641164
/// });
@@ -1533,24 +1533,6 @@ class TestWindow implements SingletonFlutterWindow {
15331533
)
15341534
@override
15351535
double get textScaleFactor => platformDispatcher.textScaleFactor;
1536-
/// Hides the real text scale factor and reports the given
1537-
/// [textScaleFactorTestValue] instead.
1538-
@Deprecated(
1539-
'Use WidgetTester.platformDispatcher.textScaleFactorTestValue instead. '
1540-
'This feature was deprecated after v2.11.0-0.0.pre.'
1541-
)
1542-
set textScaleFactorTestValue(double textScaleFactorTestValue) { // ignore: avoid_setters_without_getters
1543-
platformDispatcher.textScaleFactorTestValue = textScaleFactorTestValue;
1544-
}
1545-
/// Deletes any existing test text scale factor and returns to using the real
1546-
/// text scale factor.
1547-
@Deprecated(
1548-
'Use WidgetTester.platformDispatcher.clearTextScaleFactorTestValue() instead. '
1549-
'This feature was deprecated after v2.11.0-0.0.pre.'
1550-
)
1551-
void clearTextScaleFactorTestValue() {
1552-
platformDispatcher.clearTextScaleFactorTestValue();
1553-
}
15541536

15551537
@Deprecated(
15561538
'Use WidgetTester.platformDispatcher.platformBrightness instead. '

packages/flutter_test/test/window_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void main() {
9292
return WidgetsBinding.instance.window.textScaleFactor;
9393
},
9494
propertyFaker: (TestWidgetsFlutterBinding binding, double fakeValue) {
95-
binding.window.textScaleFactorTestValue = fakeValue;
95+
binding.platformDispatcher.textScaleFactorTestValue = fakeValue;
9696
},
9797
);
9898
});
@@ -118,7 +118,7 @@ void main() {
118118

119119
// Set fake values for window properties.
120120
testWindow.devicePixelRatioTestValue = 2.5;
121-
testWindow.textScaleFactorTestValue = 3.0;
121+
tester.platformDispatcher.textScaleFactorTestValue = 3.0;
122122

123123
// Erase fake window property values.
124124
testWindow.clearAllTestValues();

0 commit comments

Comments
 (0)