From 957f14dde59a9662c8ea0ad8c117db58b7750cb8 Mon Sep 17 00:00:00 2001 From: stewen Date: Tue, 8 Aug 2023 16:08:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=8C=89=E9=92=AE=E6=94=B9?= =?UTF-8?q?=E6=88=90=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/lib/main.dart | 4 ++-- lib/api.dart | 3 ++- lib/mop.dart | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) 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();