toJson method
Implementation
Map<String, dynamic> toJson() {
// 生成事件唯一标识
String uuid = const Uuid().v4();
// 注册监听
CallbackQueue.instance._callbacks[uuid] = callback;
// 生成 json 格式回调
return {
'eventId': uuid,
'argType': callback.nativeType,
'arg': callback.toJson(),
};
}