Skip to content

Commit

Permalink
bindFunctionOf params bugFix
Browse files Browse the repository at this point in the history
  • Loading branch information
wanbing committed Sep 21, 2023
1 parent f8223ef commit d134db0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions fair/lib/src/internal/bind_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ class BindingData {
return ([props]) {
var arguments = [];
if (props != null) {
arguments.addAll(props);
arguments.add(props);
}
if (args != null) {
arguments.addAll(args);
}
_functions?['runtimeInvokeMethod']?.call(rFuncName, arguments);
_functions?['runtimeInvokeMethod']?.call(rFuncName, true, arguments);
};
} else {
return ([props]) =>
_functions?['runtimeInvokeMethod']?.call(funcName, props);
_functions?['runtimeInvokeMethod']?.call(funcName, false, props);
}
} else {
return _functions?[funcName];
Expand Down
8 changes: 6 additions & 2 deletions fair/lib/src/runtime/runtime_fair_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ abstract class RuntimeFairDelegate {
}

void bindBaseFunc() {
_bindFunctionsMap['runtimeInvokeMethod'] = (funcName, [props]) {
_bindFunctionsMap['runtimeInvokeMethod'] = (funcName, isMultiParams, [props]) {
var arguments;
if (props != null) {
arguments = [];
arguments.addAll(props);
if (isMultiParams) {
arguments.addAll(props);
} else {
arguments.add(props);
}
}
return runtime?.invokeMethod(pageName, funcName, arguments);
};
Expand Down

0 comments on commit d134db0

Please sign in to comment.