Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbff49d7

Browse files
committed
Begin rewrite of channel support
1 parent3540adf commitbff49d7

38 files changed

+997
-1016
lines changed

‎flutter-engine/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ image = { version = "0.22.4", optional = true, default_features = false }
1616
log ="0.4.8"
1717
parking_lot ="0.10.0"
1818
priority-queue ="0.7.0"
19-
serde = {version ="1.0.104",features = ["derive"] }
19+
serde = {version ="1.0.106",features = ["derive"] }
2020
serde_json ="1.0.44"
2121
async-std ="1.2"
2222
futures-task ="0.3.1"

‎flutter-engine/src/channel/basic_message_channel.rs

Lines changed: 0 additions & 71 deletions
This file was deleted.

‎flutter-engine/src/channel/event_channel.rs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ use crate::{
88
error::MethodCallError,
99
FlutterEngine,FlutterEngineWeakRef,
1010
};
11+
usecrate::channel::method_channel::MethodCallHandler;
12+
13+
pubtraitEventHandler{
14+
fnon_listen(&mutself,args:Value,engine:FlutterEngine) ->Result<Value,MethodCallError>;
15+
fnon_cancel(&mutself,engine:FlutterEngine) ->Result<Value,MethodCallError>;
16+
}
1117

1218
pubstructEventChannel{
1319
name:String,
@@ -32,6 +38,23 @@ impl EventChannel {
3238
plugin_name:None,
3339
}
3440
}
41+
42+
43+
/// When flutter listen to a stream of events using EventChannel.
44+
/// This method send back a success event.
45+
/// It can be call multiple times to simulate stream.
46+
pubfnsend_success_event(&self,data:&Value){
47+
let buf =self.codec().encode_success_envelope(data);
48+
self.send_buffer(&buf);
49+
}
50+
51+
/// When flutter listen to a stream of events using EventChannel.
52+
/// This method send back a error event.
53+
/// It can be call multiple times to simulate stream.
54+
pubfnsend_error_event(&self,code:&str,message:&str,data:&Value){
55+
let buf =self.codec().encode_error_envelope(code, message, data);
56+
self.send_buffer(&buf);
57+
}
3558
}
3659

3760
implChannelImplforEventChannel{
@@ -91,6 +114,4 @@ impl MethodCallHandler for EventChannelMethodCallHandler {
91114
Err(MethodCallError::ChannelClosed)
92115
}
93116
}
94-
}
95-
96-
method_channel!(EventChannel);
117+
}

‎flutter-engine/src/channel/json_method_channel.rs

Lines changed: 0 additions & 71 deletions
This file was deleted.

‎flutter-engine/src/channel/macros.rs

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp