From d134db09f8798e3d0e122e1e044408fe961f06bd Mon Sep 17 00:00:00 2001 From: wanbing01 Date: Thu, 21 Sep 2023 14:54:46 +0800 Subject: [PATCH] bindFunctionOf params bugFix --- fair/lib/src/internal/bind_data.dart | 6 +++--- fair/lib/src/runtime/runtime_fair_delegate.dart | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/fair/lib/src/internal/bind_data.dart b/fair/lib/src/internal/bind_data.dart index 5b1ae1a6..3e007d23 100644 --- a/fair/lib/src/internal/bind_data.dart +++ b/fair/lib/src/internal/bind_data.dart @@ -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]; diff --git a/fair/lib/src/runtime/runtime_fair_delegate.dart b/fair/lib/src/runtime/runtime_fair_delegate.dart index 32cb36c6..1412820f 100644 --- a/fair/lib/src/runtime/runtime_fair_delegate.dart +++ b/fair/lib/src/runtime/runtime_fair_delegate.dart @@ -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); };