Skip to content

Commit 244c952

Browse files
committed
Revert "upgrade: bump dependency to adapt to Flutter 3.29" and "chore: fix conflict between dart:js_interop and json_serializable"
This reverts commit 95637b5 and afd041d. Research suggests that the best way to resolve the web compilation issue is to keep the original JS package, even though it is deprecated.
1 parent 86b2ab8 commit 244c952

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lib/util/js/js_web.dart

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

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;
18+
// ignore: deprecated_member_use
19+
import 'package:js/js.dart';
2220

23-
@js.JS()
21+
@JS('window.eval')
2422
external dynamic eval(dynamic arg);
2523

2624
String evaluate(String jsCode) {

pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ packages:
10621062
source: hosted
10631063
version: "1.0.5"
10641064
js:
1065-
dependency: transitive
1065+
dependency: "direct main"
10661066
description:
10671067
name: js
10681068
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"

pubspec.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ dependencies:
9090
lunar: ^1.2.20
9191
flutter_fgbg: ^0.7.0
9292
lazy_load_indexed_stack: ^1.0.0
93+
js: ^0.7.2
9394
nil: ^1.1.1
9495
flex_color_picker: ^3.2.0
9596
material_color_generator: ^1.1.0

0 commit comments

Comments
 (0)