Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54a522b3f9 | ||
|
|
ae48890a1c | ||
|
|
ee927acf63 | ||
|
|
c1ef4d3b26 |
@@ -1,3 +1,8 @@
|
|||||||
## 0.0.1
|
## 0.0.1
|
||||||
|
* Initial release
|
||||||
|
|
||||||
* TODO: Describe initial release.
|
## 0.0.2
|
||||||
|
* 优化通信
|
||||||
|
|
||||||
|
## 0.0.3
|
||||||
|
* 添加iOS/Android下载地址
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ enum ToFlutterAppEnum {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//通用交互
|
//通用交互
|
||||||
enum WebInteractionType {
|
enum WebInteractionType {
|
||||||
taskKeyWatchLive('TaskKeyWatchLive'), // 观看直播
|
taskKeyWatchLive('TaskKeyWatchLive'), // 观看直播
|
||||||
@@ -101,14 +102,14 @@ enum WebInteractionType {
|
|||||||
;
|
;
|
||||||
|
|
||||||
const WebInteractionType(
|
const WebInteractionType(
|
||||||
this.code,
|
this.code,
|
||||||
);
|
);
|
||||||
final String code; //服务端 key
|
final String code; //服务端 key
|
||||||
|
|
||||||
factory WebInteractionType.fromCode(String? code) => values.firstWhere(
|
factory WebInteractionType.fromCode(String? code) => values.firstWhere(
|
||||||
(element) => element.code == code,
|
(element) => element.code == code,
|
||||||
orElse: () => WebInteractionType.unknown,
|
orElse: () => WebInteractionType.unknown,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 原生交互通知 h5 {type:'enum',data:'所需参数 '}
|
// 原生交互通知 h5 {type:'enum',data:'所需参数 '}
|
||||||
@@ -242,10 +243,11 @@ class FlutterBridge {
|
|||||||
});
|
});
|
||||||
void checkGameState(String gameCode) => sendToFlutter(
|
void checkGameState(String gameCode) => sendToFlutter(
|
||||||
ToFlutterAppEnum.checkGameState.code, {'gameCode': gameCode});
|
ToFlutterAppEnum.checkGameState.code, {'gameCode': gameCode});
|
||||||
|
|
||||||
void share({
|
void share({
|
||||||
required String activityId,
|
required String activityId, // 活动id
|
||||||
required bool needShareReport,
|
required bool needShareReport, // 是否需要上报分享数据
|
||||||
Map<String, dynamic> extraParams = const {},
|
Map<String, dynamic> extraParams = const {}, // 额外的参数 分享上方卡片 数据,参考客户端参数
|
||||||
}) =>
|
}) =>
|
||||||
sendToFlutter(ToFlutterAppEnum.share.code, {
|
sendToFlutter(ToFlutterAppEnum.share.code, {
|
||||||
"activityId": activityId,
|
"activityId": activityId,
|
||||||
|
|||||||
6
lib/utils/config.dart
Normal file
6
lib/utils/config.dart
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
class WebConfig {
|
||||||
|
static const String iOSDownloadUrl =
|
||||||
|
"https://apps.apple.com/sg/app/sugarvibe/id6737873037";
|
||||||
|
static const String androidDownloadUrl =
|
||||||
|
"https://play.google.com/store/apps/details?id=com.sugarvibe.chat";
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
library;
|
library;
|
||||||
|
|
||||||
export 'package:web_tools/utils/app_bridge.dart';
|
export 'package:web_tools/utils/app_bridge.dart';
|
||||||
|
export 'package:web_tools/utils/config.dart';
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
name: web_tools
|
name: web_tools
|
||||||
description: "A new Flutter package project."
|
description: "A new Flutter package project."
|
||||||
version: 0.0.1
|
version: 0.0.3
|
||||||
publish_to: 'none' # 不发布到pub.dev
|
publish_to: 'none' # 不发布到pub.dev
|
||||||
homepage: https://gitea.sdws.shop/xim/web_tools.git
|
homepage: https://gitea.sdws.shop/xim/web_tools.git
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user