-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
目前的自定义事件不支持携带参数:
static Future<bool> event(String eventId, {String label}) async {
Map<String, dynamic> map = {
'eventId': eventId,
};
if (label != null) {
map['label'] = label;
}
return _channel.invokeMethod<bool>('event', map);
}显然只有一个label是不够的,需要携带更多的Map类型数据。
希望可以扩展这个方法,像友盟官方的这种用法(以安卓平台为例):
Map<String, Object> music = new HashMap<String, Object>();
music.put("music_type", "popular");//自定义参数:音乐类型,值:流行
music.put("singer", "JJ"); //歌手:(林俊杰)JJ
music.put("song_name","A_Thousand_Years_Later"); //歌名:一千年以后
music.put("song_price",100); //价格:100元
MobclickAgent.onEventObject(this, "play_music", music);Metadata
Metadata
Assignees
Labels
No labels