diff --git a/packages/flutter/lib/src/foundation/_capabilities_web.dart b/packages/flutter/lib/src/foundation/_capabilities_web.dart index 4da8d6223d..86deb78d0d 100644 --- a/packages/flutter/lib/src/foundation/_capabilities_web.dart +++ b/packages/flutter/lib/src/foundation/_capabilities_web.dart @@ -2,7 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:js_interop'; +// For now, we're hiding dart:js_interop's `@JS` to avoid a conflict with +// package:js' `@JS`. In the future, we should be able to remove package:js +// altogether and just import dart:js_interop. +import 'dart:js_interop' hide JS; import 'package:js/js.dart'; // This value is set by the engine. It is used to determine if the application is diff --git a/packages/flutter/lib/src/services/dom.dart b/packages/flutter/lib/src/services/dom.dart index 6dad28b3d5..c9181beede 100644 --- a/packages/flutter/lib/src/services/dom.dart +++ b/packages/flutter/lib/src/services/dom.dart @@ -2,7 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:js_interop'; +// For now, we're hiding dart:js_interop's `@JS` to avoid a conflict with +// package:js' `@JS`. In the future, we should be able to remove package:js +// altogether and just import dart:js_interop. +import 'dart:js_interop' hide JS; import 'package:js/js.dart'; /// This file includes static interop helpers for Flutter Web. diff --git a/packages/flutter/test/painting/_test_http_request.dart b/packages/flutter/test/painting/_test_http_request.dart index debd39ee67..a8cf1017dd 100644 --- a/packages/flutter/test/painting/_test_http_request.dart +++ b/packages/flutter/test/painting/_test_http_request.dart @@ -2,7 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:js_interop'; +// For now, we're hiding dart:js_interop's `@JS` to avoid a conflict with +// package:js' `@JS`. In the future, we should be able to remove package:js +// altogether and just import dart:js_interop. +import 'dart:js_interop' hide JS; import 'package:flutter/src/services/dom.dart'; import 'package:js/js.dart';