Repository: flutter
Issue: ui_web: fix incorrect JS interop (and probably migrate to extension types)
Labels: engine,platform-web,P2,c: tech-debt,team-web,triaged-web

at [f65328a433](https://github.com/flutter/engine/commit/f65328a433ef8b0214ca87ce8c786609a116dd52) 

with this diff

```diff
diff --git a/lib/web_ui/analysis_options.yaml b/lib/web_ui/analysis_options.yaml
index 0938119b50..aa66cb0434 100644
--- a/lib/web_ui/analysis_options.yaml
+++ b/lib/web_ui/analysis_options.yaml
@@ -16,3 +16,4 @@ linter:
     public_member_api_docs: false
     unawaited_futures: true
     use_setters_to_change_properties: false
+    invalid_runtime_check_with_js_interop_types: true
diff --git a/lib/web_ui/pubspec.yaml b/lib/web_ui/pubspec.yaml
index 59d9405abd..720e6d7f4a 100644
--- a/lib/web_ui/pubspec.yaml
+++ b/lib/web_ui/pubspec.yaml
@@ -3,7 +3,7 @@ publish_to: none
 
 # Keep the SDK version range in sync with pubspecs under web_sdk
 environment:
-  sdk: '>=3.2.0-0 <4.0.0'
+  sdk: ^3.5.0-0
 
 dependencies:
   js: 0.6.4
```

we get

```
Analyzing web_ui...

   info - lib/src/engine/canvaskit/native_memory.dart:88:32 - Cast from 'T' to 'SkDeletable' casts a Dart value to a JS interop type, which may not be platform-consistent. Try using conversion methods from 'dart:js_interop' to convert between Dart types and JS interop types. - invalid_runtime_check_with_js_interop_types
   info - lib/src/engine/dom.dart:1808:16 - Cast from 'JSAny?' to 'T' casts a JS interop value to a Dart type, which may not be platform-consistent. Try using conversion methods from 'dart:js_interop' to convert between JS interop types and Dart types. - invalid_runtime_check_with_js_interop_types
   info - lib/src/engine/dom.dart:1847:16 - Cast from 'JSUint8Array' to 'T' casts a JS interop value to a Dart type, which may not be platform-consistent. Try using conversion methods from 'dart:js_interop' to convert between JS interop types and Dart types. - invalid_runtime_check_with_js_interop_types
   info - lib/src/engine/dom.dart:3432:20 - Cast from 'DomNode' to 'T' casts a JS interop value to a Dart type, which may not be platform-consistent. Try using conversion methods from 'dart:js_interop' to convert between JS interop types and Dart types. - invalid_runtime_check_with_js_interop_types
   info - lib/src/engine/dom.dart:3484:20 - Cast from 'DomNode' to 'T' casts a JS interop value to a Dart type, which may not be platform-consistent. Try using conversion methods from 'dart:js_interop' to convert between JS interop types and Dart types. - invalid_runtime_check_with_js_interop_types
   info - lib/src/engine/dom.dart:3592:16 - Cast from 'JSAny' to 'T' casts a JS interop value to a Dart type, which may not be platform-consistent. Try using conversion methods from 'dart:js_interop' to convert between JS interop types and Dart types. - invalid_runtime_check_with_js_interop_types
   info - lib/src/engine/html/bitmap_canvas.dart:646:31 - Runtime check between 'DomHTMLElement' and 'DomHTMLImageElement' involves a runtime check between a JS interop value and an unrelated JS interop type that will always be true and won't check the underlying type. Try using a JS interop member like 'isA' from 'dart:js_interop' to check the underlying type of JS interop values, or make the JS interop type a supertype using 'implements'. - invalid_runtime_check_with_js_interop_types
   info - lib/src/engine/pointer_binding.dart:311:9 - Runtime check between 'DomEventTarget?' and 'DomElement' involves a runtime check between a JS interop value and an unrelated JS interop type that will always be true and won't check the underlying type. Try using a JS interop member like 'isA' from 'dart:js_interop' to check the underlying type of JS interop values, or make the JS interop type a supertype using 'implements'. - invalid_runtime_check_with_js_interop_types
   info - test/common/matchers.dart:294:9 - Runtime check between 'Object?' and 'DomElement' checks whether a Dart value is a JS interop type, which may not be platform-consistent. - invalid_runtime_check_with_js_interop_types

9 issues found.

```