Skip to content

Commit afd041d

Browse files
committed
chore: fix conflict between dart:js_interop and json_serializable
See google/json_serializable.dart#1480 for details.
1 parent c301174 commit afd041d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/util/js/js_web.dart

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1616
*/
1717

18-
import 'dart:js_interop/js_interop.dart';
18+
// fixme: json_serializable conflicts with @JS() annotation in [dart:js_interop]. (https://github.com/google/json_serializable.dart/issues/1391, https://github.com/google/json_serializable.dart/issues/1480)
19+
// As a workaround, we use the dart:_js_annotations library directly. It should be replaced with [dart:js_interop] when the issue is resolved.
20+
// ignore: IMPORT_INTERNAL_LIBRARY
21+
import 'dart:_js_annotations' as js;
1922

20-
@JS('window.eval')
23+
@js.JS()
2124
external dynamic eval(dynamic arg);
2225

2326
String evaluate(String jsCode) {

0 commit comments

Comments
 (0)