mop-flutter-sdk/lib/api.dart

43 lines
872 B
Dart
Raw Normal View History

2020-11-27 17:15:32 +08:00
import 'dart:typed_data';
2020-04-26 14:57:08 +08:00
class CustomMenu {
2021-03-02 14:04:51 +08:00
String menuId;
2020-04-26 14:57:08 +08:00
String image;
String title;
2021-03-02 14:04:51 +08:00
String type;
CustomMenu(this.menuId, this.image, this.title, this.type);
2020-04-26 14:57:08 +08:00
Map<String, dynamic> toJson() =>
2021-03-02 14:04:51 +08:00
{'menuId': menuId, 'image': image, 'title': title, 'type': type};
2020-04-26 14:57:08 +08:00
}
abstract class AppletHandler {
///
/// 转发小程序
///
///
///
void forwardApplet(Map<String, dynamic> appletInfo);
///
///获取用户信息
/// "userId"
/// "nickName"
/// "avatarUrl"
/// "jwt"
/// "accessToken"
///
Future<Map<String, dynamic>> getUserInfo();
/// 获取自定义菜单
Future<List<CustomMenu>> getCustomMenus(String appId);
///自定义菜单点击处理
Future<void> onCustomMenuClick(
2021-03-02 14:04:51 +08:00
String appId, String path, String menuId, String appInfo);
//打开小程序
Future<void> appletDidOpen(String appId);
2020-04-26 14:57:08 +08:00
}