Skip to content

Commit 4f0b7ee

Browse files
authored
Merge pull request #187 from wanbing/dev_wanbing
fair兼容web bug修复
2 parents 6e1f0c9 + 4698146 commit 4f0b7ee

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

fair/lib/src/runtime/fair_message_channel_web.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import 'dart:html';
1212

1313
import 'package:fair/src/runtime/plugin/plugin_dispatcher.dart';
1414
import 'package:flutter/services.dart';
15-
import 'package:js/js.dart';
16-
import 'package:js/js_util.dart';
15+
import 'js/js.dart' if (dart.library.html) 'package:js/js.dart';
16+
import 'js/js_util.dart' if (dart.library.html) 'package:js/js_util.dart';
1717

1818
import 'fair_runtime_declaration.dart';
1919

fair/lib/src/runtime/js/js.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (C) 2005-present, 58.com. All rights reserved.
3+
* Use of this source code is governed by a BSD type license that can be
4+
* found in the LICENSE file.
5+
*/
6+
class JS {
7+
final String? name;
8+
9+
const JS([this.name]);
10+
}
11+
12+
external F allowInterop<F extends Function>(F f);

fair/lib/src/runtime/js/js_util.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*
2+
* Copyright (C) 2005-present, 58.com. All rights reserved.
3+
* Use of this source code is governed by a BSD type license that can be
4+
* found in the LICENSE file.
5+
*/
6+
external T setProperty<T>(Object o, Object name, T? value);

0 commit comments

Comments
 (0)