diff --git a/packages/flutter_html_iframe/lib/flutter_html_iframe.dart b/packages/flutter_html_iframe/lib/flutter_html_iframe.dart
index cbcf4cde5b..98211f3c62 100644
--- a/packages/flutter_html_iframe/lib/flutter_html_iframe.dart
+++ b/packages/flutter_html_iframe/lib/flutter_html_iframe.dart
@@ -6,7 +6,7 @@ import 'package:webview_flutter/webview_flutter.dart';
import 'iframe_unsupported.dart'
if (dart.library.io) 'iframe_mobile.dart'
- if (dart.library.html) 'iframe_web.dart';
+ if (dart.library.js_interop) 'iframe_web.dart';
class IframeHtmlExtension extends HtmlExtension {
final NavigationDelegate? navigationDelegate;
diff --git a/packages/flutter_html_iframe/lib/iframe_web.dart b/packages/flutter_html_iframe/lib/iframe_web.dart
index f2f4d33805..2085e3078a 100644
--- a/packages/flutter_html_iframe/lib/iframe_web.dart
+++ b/packages/flutter_html_iframe/lib/iframe_web.dart
@@ -1,11 +1,10 @@
import 'dart:convert';
import 'dart:math';
+import 'dart:ui_web' as ui_web;
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
-import 'package:flutter_html_iframe/shims/dart_ui.dart' as ui;
import 'package:web/web.dart' show HTMLIFrameElement;
-
import 'package:webview_flutter/webview_flutter.dart';
class IframeWidget extends StatelessWidget {
@@ -30,7 +29,7 @@ class IframeWidget extends StatelessWidget {
..src = extensionContext.attributes['src'] ?? ""
..style.border = 'none';
final String createdViewId = _getRandString(10);
- ui.platformViewRegistry
+ ui_web.platformViewRegistry
.registerViewFactory(createdViewId, (int viewId) => iframe);
return SizedBox(
width: double.tryParse(extensionContext.attributes['width'] ?? "") ??
diff --git a/packages/flutter_html_iframe/lib/shims/dart_ui.dart b/packages/flutter_html_iframe/lib/shims/dart_ui.dart
deleted file mode 100644
index 0131b7ebda..0000000000
--- a/packages/flutter_html_iframe/lib/shims/dart_ui.dart
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2019 The Flutter Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file shims dart:ui in web-only scenarios, getting rid of the need to
-// suppress analyzer warnings.
-
-// TODO: flutter/flutter#55000 Remove this file once web-only dart:ui APIs
-// are exposed from a dedicated place.
-export 'dart_ui_fake.dart' if (dart.library.html) 'dart_ui_real.dart';
diff --git a/packages/flutter_html_iframe/lib/shims/dart_ui_fake.dart b/packages/flutter_html_iframe/lib/shims/dart_ui_fake.dart
deleted file mode 100644
index 4e528a7337..0000000000
--- a/packages/flutter_html_iframe/lib/shims/dart_ui_fake.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2019 The Flutter Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Fake interface for the logic that this package needs from (web-only) dart:ui.
-// This is conditionally exported so the analyzer sees these methods as available.
-
-/// Shim for web_ui engine.PlatformViewRegistry
-/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/ui.dart#L62
-// ignore: camel_case_types
-class platformViewRegistry {
- /// Shim for registerViewFactory
- /// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/ui.dart#L72
- static void registerViewFactory(
- String viewTypeId, dynamic Function(int viewId) viewFactory) {}
-}
-
-/// Signature of callbacks that have no arguments and return no data.
-typedef VoidCallback = void Function();
diff --git a/packages/flutter_html_iframe/lib/shims/dart_ui_real.dart b/packages/flutter_html_iframe/lib/shims/dart_ui_real.dart
deleted file mode 100644
index 90ecd7d002..0000000000
--- a/packages/flutter_html_iframe/lib/shims/dart_ui_real.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2019 The Flutter Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-export 'dart:ui';