Skip to content

Commit ff2a599

Browse files
committed
fix(stripe_js): fix toJS function signature with proper JSAny parameter type
1 parent 2ee9476 commit ff2a599

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/stripe_js/lib/src/loader/stripe_loader.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ Future<void> _injectSrcScript(String src, String windowVar) async {
99
Completer completer = Completer();
1010

1111
// Create callback function that will be called when script loads
12-
globalContext['ff_trigger_$windowVar'] = ((JSAny? _) {
12+
void onLoadCallback(JSAny? _) {
1313
completer.complete();
14-
}).toJS;
14+
}
15+
globalContext['ff_trigger_$windowVar'] = (onLoadCallback).toJS;
1516

1617
// Create and inject the script tag
1718
HTMLScriptElement script = HTMLScriptElement();
1819
script.type = 'text/javascript';
1920
script.src = src;
2021
script.crossOrigin = 'anonymous';
21-
script.onload = ((_) {
22+
script.onload = ((JSAny? _) {
2223
if (globalContext[windowVar] != null) {
2324
globalContext.callMethod('ff_trigger_$windowVar'.toJS);
2425
}

0 commit comments

Comments
 (0)