null-annotate native calls in lib/ui/window.dart (#18430)

diff --git a/lib/ui/window.dart b/lib/ui/window.dart
index f70b7b6..084fe4d 100644
--- a/lib/ui/window.dart
+++ b/lib/ui/window.dart
@@ -981,7 +981,7 @@
   }
 
   _SetNeedsReportTimingsFunc _setNeedsReportTimings;
-  void _nativeSetNeedsReportTimings(bool value) native 'Window_setNeedsReportTimings';
+  void _nativeSetNeedsReportTimings(bool/*!*/ value) native 'Window_setNeedsReportTimings';
 
   /// A callback that is invoked when pointer data is available.
   ///
@@ -1030,8 +1030,8 @@
   ///  * [Navigator], a widget that handles routing.
   ///  * [SystemChannels.navigation], which handles subsequent navigation
   ///    requests from the embedder.
-  String get defaultRouteName => _defaultRouteName();
-  String _defaultRouteName() native 'Window_defaultRouteName';
+  String/*!*/ get defaultRouteName => _defaultRouteName();
+  String/*!*/ _defaultRouteName() native 'Window_defaultRouteName';
 
   /// Requests that, at the next appropriate opportunity, the [onBeginFrame]
   /// and [onDrawFrame] callbacks be invoked.
@@ -1066,7 +1066,7 @@
   ///    scheduling of frames.
   ///  * [RendererBinding], the Flutter framework class which manages layout and
   ///    painting.
-  void render(Scene scene) native 'Window_render';
+  void render(Scene/*!*/ scene) native 'Window_render';
 
   /// Whether the user has requested that [updateSemantics] be called when
   /// the semantic contents of window changes.
@@ -1127,7 +1127,7 @@
   ///
   /// In either case, this function disposes the given update, which means the
   /// semantics update cannot be used further.
-  void updateSemantics(SemanticsUpdate update) native 'Window_updateSemantics';
+  void updateSemantics(SemanticsUpdate/*!*/ update) native 'Window_updateSemantics';
 
   /// Set the debug name associated with this window's root isolate.
   ///
@@ -1137,7 +1137,7 @@
   /// This can be combined with flutter tools `--isolate-filter` flag to debug
   /// specific root isolates. For example: `flutter attach --isolate-filter=[name]`.
   /// Note that this does not rename any child isolates of the root.
-  void setIsolateDebugName(String name) native 'Window_setIsolateDebugName';
+  void setIsolateDebugName(String/*!*/ name) native 'Window_setIsolateDebugName';
 
   /// Sends a message to a platform-specific plugin.
   ///
@@ -1148,17 +1148,17 @@
   ///
   /// The framework invokes [callback] in the same zone in which this method
   /// was called.
-  void sendPlatformMessage(String name,
-                           ByteData data,
-                           PlatformMessageResponseCallback callback) {
+  void sendPlatformMessage(String/*!*/ name,
+                           ByteData/*?*/ data,
+                           PlatformMessageResponseCallback/*?*/ callback) {
     final String error =
         _sendPlatformMessage(name, _zonedPlatformMessageResponseCallback(callback), data);
     if (error != null)
       throw Exception(error);
   }
-  String _sendPlatformMessage(String name,
-                              PlatformMessageResponseCallback callback,
-                              ByteData data) native 'Window_sendPlatformMessage';
+  String _sendPlatformMessage(String/*!*/ name,
+                              PlatformMessageResponseCallback/*?*/ callback,
+                              ByteData/*?*/ data) native 'Window_sendPlatformMessage';
 
   /// Called whenever this window receives a message from a platform-specific
   /// plugin.
@@ -1182,12 +1182,12 @@
   }
 
   /// Called by [_dispatchPlatformMessage].
-  void _respondToPlatformMessage(int responseId, ByteData data)
+  void _respondToPlatformMessage(int/*!*/ responseId, ByteData/*?*/ data)
       native 'Window_respondToPlatformMessage';
 
   /// Wraps the given [callback] in another callback that ensures that the
   /// original callback is called in the zone it was registered in.
-  static PlatformMessageResponseCallback _zonedPlatformMessageResponseCallback(PlatformMessageResponseCallback callback) {
+  static PlatformMessageResponseCallback/*?*/ _zonedPlatformMessageResponseCallback(PlatformMessageResponseCallback/*?*/ callback) {
     if (callback == null)
       return null;
 
@@ -1209,7 +1209,7 @@
   ///
   /// For asynchronous communication between the embedder and isolate, a
   /// platform channel may be used.
-  ByteData getPersistentIsolateData() native 'Window_getPersistentIsolateData';
+  ByteData/*?*/ getPersistentIsolateData() native 'Window_getPersistentIsolateData';
 }
 
 /// Additional accessibility features that may be enabled by the platform.
diff --git a/lib/web_ui/lib/src/engine/semantics/semantics.dart b/lib/web_ui/lib/src/engine/semantics/semantics.dart
index 4dc0dc1..d1808ce 100644
--- a/lib/web_ui/lib/src/engine/semantics/semantics.dart
+++ b/lib/web_ui/lib/src/engine/semantics/semantics.dart
@@ -1422,7 +1422,7 @@
   }
 
   /// Updates the semantics tree from data in the [uiUpdate].
-  void updateSemantics(ui.SemanticsUpdate uiUpdate) {
+  void updateSemantics(ui.SemanticsUpdate/*!*/ uiUpdate) {
     if (!_semanticsEnabled) {
       return;
     }
diff --git a/lib/web_ui/lib/src/engine/window.dart b/lib/web_ui/lib/src/engine/window.dart
index 1d29c31..819ecd6 100644
--- a/lib/web_ui/lib/src/engine/window.dart
+++ b/lib/web_ui/lib/src/engine/window.dart
@@ -154,7 +154,7 @@
   String _defaultRouteName;
 
   @override
-  String get defaultRouteName => _defaultRouteName ??= _browserHistory.currentPath;
+  String/*!*/ get defaultRouteName => _defaultRouteName ??= _browserHistory.currentPath;
 
   /// Change the strategy to use for handling browser history location.
   /// Setting this member will automatically update [_browserHistory].
@@ -367,16 +367,16 @@
 
   @override
   void sendPlatformMessage(
-    String name,
-    ByteData data,
-    ui.PlatformMessageResponseCallback callback,
+    String/*!*/ name,
+    ByteData/*?*/ data,
+    ui.PlatformMessageResponseCallback/*?*/ callback,
   ) {
     _sendPlatformMessage(name, data, _zonedPlatformMessageResponseCallback(callback));
   }
 
   /// Wraps the given [callback] in another callback that ensures that the
   /// original callback is called in the zone it was registered in.
-  static ui.PlatformMessageResponseCallback _zonedPlatformMessageResponseCallback(ui.PlatformMessageResponseCallback callback) {
+  static ui.PlatformMessageResponseCallback/*?*/ _zonedPlatformMessageResponseCallback(ui.PlatformMessageResponseCallback/*?*/ callback) {
     if (callback == null)
       return null;
 
@@ -389,9 +389,9 @@
   }
 
   void _sendPlatformMessage(
-    String name,
-    ByteData data,
-    ui.PlatformMessageResponseCallback callback,
+    String/*!*/ name,
+    ByteData/*?*/ data,
+    ui.PlatformMessageResponseCallback/*?*/ callback,
   ) {
     // In widget tests we want to bypass processing of platform messages.
     if (assertionsEnabled && ui.debugEmulateFlutterTesterEnvironment) {
@@ -604,7 +604,7 @@
   }
 
   @override
-  void render(ui.Scene scene) {
+  void render(ui.Scene/*!*/ scene) {
     if (experimentalUseSkia) {
       final LayerScene layerScene = scene;
       rasterizer.draw(layerScene.layerTree);
diff --git a/lib/web_ui/lib/src/ui/window.dart b/lib/web_ui/lib/src/ui/window.dart
index 07fcae0..54c2b33 100644
--- a/lib/web_ui/lib/src/ui/window.dart
+++ b/lib/web_ui/lib/src/ui/window.dart
@@ -846,7 +846,7 @@
   ///  * [Navigator], a widget that handles routing.
   ///  * [SystemChannels.navigation], which handles subsequent navigation
   ///    requests from the embedder.
-  String get defaultRouteName;
+  String/*!*/ get defaultRouteName;
 
   /// Whether the user has requested that [updateSemantics] be called when
   /// the semantic contents of window changes.
@@ -907,7 +907,7 @@
   ///
   /// In either case, this function disposes the given update, which means the
   /// semantics update cannot be used further.
-  void updateSemantics(SemanticsUpdate update) {
+  void updateSemantics(SemanticsUpdate/*!*/ update) {
     engine.EngineSemanticsOwner.instance.updateSemantics(update);
   }
 
@@ -921,9 +921,9 @@
   /// The framework invokes [callback] in the same zone in which this method
   /// was called.
   void sendPlatformMessage(
-    String name,
-    ByteData data,
-    PlatformMessageResponseCallback callback,
+    String/*!*/ name,
+    ByteData/*?*/ data,
+    PlatformMessageResponseCallback/*?*/ callback,
   );
 
   /// Additional accessibility features that may be enabled by the platform.
@@ -954,15 +954,15 @@
   ///    scheduling of frames.
   ///  * [RendererBinding], the Flutter framework class which manages layout and
   ///    painting.
-  void render(Scene scene);
+  void render(Scene/*!*/ scene);
 
   String get initialLifecycleState => _initialLifecycleState;
 
   String _initialLifecycleState;
 
-  void setIsolateDebugName(String name) {}
+  void setIsolateDebugName(String/*!*/ name) {}
 
-  ByteData getPersistentIsolateData() => null;
+  ByteData/*?*/ getPersistentIsolateData() => null;
 }
 
 VoidCallback webOnlyScheduleFrameCallback;