plugin_framework, split call function to server side and client side

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-04-26 13:29:55 +08:00
parent 2169ef5016
commit 82bfa9ca29
5 changed files with 82 additions and 34 deletions

View File

@@ -1301,12 +1301,16 @@ impl<T: InvokeUiSession> Remote<T> {
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
Some(misc::Union::PluginRequest(p)) => {
allow_err!(crate::plugin::handle_server_event(&p.id, &self.handler.id, &p.content));
allow_err!(crate::plugin::handle_server_event(
&p.id,
&self.handler.id,
&p.content
));
// to-do: show message box on UI when error occurs?
}
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
Some(misc::Union::PluginResponse(p)) => {
Some(misc::Union::PluginFailure(p)) => {
let name = if p.name.is_empty() {
"plugin".to_string()
} else {