Skip to content

Commit 842bc8e

Browse files
Fix DomCSSStyleSheetExtension to work with dart2wasm. (#122154)
Fix DomCSSStyleSheetExtension to work with dart2wasm.
1 parent 34e5550 commit 842bc8e

File tree

1 file changed

+5
-2
lines changed
  • packages/flutter/lib/src/services

1 file changed

+5
-2
lines changed

packages/flutter/lib/src/services/dom.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,11 @@ class DomCSSStyleSheet extends DomStyleSheet {}
336336
/// [DomCSSStyleSheet]'s required extension.
337337
extension DomCSSStyleSheetExtension on DomCSSStyleSheet {
338338
/// Inserts a rule into this style sheet.
339-
int insertRule(String rule, [int? index]) => js_util
340-
.callMethod(this, 'insertRule', <Object>[rule, if (index != null) index]);
339+
int insertRule(String rule, [int? index]) =>
340+
js_util.callMethod<double>(this, 'insertRule', <Object>[
341+
rule,
342+
if (index != null) index.toDouble()
343+
]).toInt();
341344
}
342345

343346
/// A list of token.

0 commit comments

Comments
 (0)