diff --git a/packages/flutter_test/lib/src/window.dart b/packages/flutter_test/lib/src/window.dart index 2dc9c0512b..ce1c77ab96 100644 --- a/packages/flutter_test/lib/src/window.dart +++ b/packages/flutter_test/lib/src/window.dart @@ -373,4 +373,12 @@ class TestWindow implements Window { clearTextScaleFactorTestValue(); clearViewInsetsTestValue(); } + + /// This gives us some grace time when the dart:ui side adds something to + /// Window, and makes things easier when we do rolls to give us time to + /// catch up. + @override + dynamic noSuchMethod(Invocation invocation) { + return null; + } } diff --git a/packages/flutter_test/test/window_test.dart b/packages/flutter_test/test/window_test.dart index e45c3f0185..2ce3c15ec6 100644 --- a/packages/flutter_test/test/window_test.dart +++ b/packages/flutter_test/test/window_test.dart @@ -10,6 +10,11 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:meta/meta.dart'; void main() { + test('TestWindow can handle new methods without breaking', () { + final dynamic testWindow = TestWindow(window: ui.window); + expect(testWindow.someNewProperty, null); + }); + testWidgets('TestWindow can fake device pixel ratio', (WidgetTester tester) async { verifyThatTestWindowCanFakeProperty( tester: tester,