diff --git a/example/lib/main.dart b/example/lib/main.dart index a0f6fb1..d49cff5 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -216,7 +216,7 @@ class MyAppletHandler extends AppletHandler { } @override - Future> getCustomMenus(String appId) { + List getCustomMenus(String appId) { CustomMenu menu1 = CustomMenu('WXTest', 'https://img1.baidu.com/it/u=2878938773,1765835171&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500', '百度图标', 'common'); menu1.darkImage = 'https://img95.699pic.com/xsj/14/46/mh.jpg%21/fw/700/watermark/url/L3hzai93YXRlcl9kZXRhaWwyLnBuZw/align/southeast'; @@ -233,7 +233,7 @@ class MyAppletHandler extends AppletHandler { // CustomMenu('WXShareAPPFriends', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSpvugSNLs9R7iopz_noeotAelvgzYj-74iCg&usqp=CAU', '微信好朋友', 'common'), // CustomMenu('WXShareAPPMoments', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR7cO4KB4e5-Ugdcq4pIyWunliH7LZRZzguKQ&usqp=CAU', '微信朋友圈', 'common'), ]; - return Future.value(customMenus); + return customMenus; } @override diff --git a/lib/api.dart b/lib/api.dart index 5dd445d..1e1aeea 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -33,7 +33,8 @@ abstract class AppletHandler { bool customCapsuleMoreButtonClick(String appId); /// 获取自定义菜单 - Future> getCustomMenus(String appId); + // Future> getCustomMenus(String appId); + List getCustomMenus(String appId); ///自定义菜单点击处理 Future onCustomMenuClick( diff --git a/lib/mop.dart b/lib/mop.dart index f9dd069..dd7c723 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -1181,7 +1181,7 @@ class Mop { return handler.customCapsuleMoreButtonClick(params["appId"]); }; _appletHandlerApis["getCustomMenus"] = (params) async { - final res = await handler.getCustomMenus(params["appId"]); + final res = handler.getCustomMenus(params["appId"]); List> list = []; res.forEach((element) { Map map = Map();