diff --git a/packages/flutter/test/gestures/gesture_binding_test.dart b/packages/flutter/test/gestures/gesture_binding_test.dart index 23f00d70496b..05f6da7d4ae7 100644 --- a/packages/flutter/test/gestures/gesture_binding_test.dart +++ b/packages/flutter/test/gestures/gesture_binding_test.dart @@ -350,7 +350,7 @@ void main() { final List events = []; binding.callback = events.add; - ui.window.onPointerDataPacket?.call(packet); + binding.platformDispatcher.onPointerDataPacket?.call(packet); expect(events.length, 3); expect(events[0], isA()); expect(events[1], isA()); diff --git a/packages/flutter/test/rendering/mouse_tracker_test.dart b/packages/flutter/test/rendering/mouse_tracker_test.dart index 053fa42f26bf..9caf4968780c 100644 --- a/packages/flutter/test/rendering/mouse_tracker_test.dart +++ b/packages/flutter/test/rendering/mouse_tracker_test.dart @@ -134,7 +134,7 @@ void main() { test('should not crash if the first event is a Removed event', () { final List events = []; setUpWithOneAnnotation(logEvents: events); - ui.window.onPointerDataPacket!(ui.PointerDataPacket(data: [ + binding.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: [ _pointerData(PointerChange.remove, Offset.zero), ])); events.clear(); diff --git a/packages/flutter/test/widgets/independent_widget_layout_test.dart b/packages/flutter/test/widgets/independent_widget_layout_test.dart index fac163f53a56..90d8881b486a 100644 --- a/packages/flutter/test/widgets/independent_widget_layout_test.dart +++ b/packages/flutter/test/widgets/independent_widget_layout_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:ui' as ui; - import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -11,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; const Size _kTestViewSize = Size(800.0, 600.0); class ScheduledFrameTrackingWindow extends TestWindow { - ScheduledFrameTrackingWindow() : super(window: ui.window); + ScheduledFrameTrackingWindow({ required super.window }); int _scheduledFrameCount = 0; int get scheduledFrameCount => _scheduledFrameCount; @@ -28,7 +26,7 @@ class ScheduledFrameTrackingWindow extends TestWindow { } class ScheduledFrameTrackingBindings extends AutomatedTestWidgetsFlutterBinding { - final ScheduledFrameTrackingWindow _window = ScheduledFrameTrackingWindow(); + late final ScheduledFrameTrackingWindow _window = ScheduledFrameTrackingWindow(window: super.window); @override ScheduledFrameTrackingWindow get window => _window;