4 Commits
0.0.2 ... 0.0.3

Author SHA1 Message Date
zhugy781
54a522b3f9 添加说明 2025-12-23 17:46:10 +08:00
zhugy781
ae48890a1c 修改版本 2025-12-23 16:28:28 +08:00
zhugy781
ee927acf63 创建类 2025-12-23 16:05:17 +08:00
zhugy781
c1ef4d3b26 添加下载地址 2025-12-23 15:17:42 +08:00
5 changed files with 23 additions and 9 deletions

View File

@@ -1,3 +1,8 @@
## 0.0.1 ## 0.0.1
* Initial release
* TODO: Describe initial release. ## 0.0.2
* 优化通信
## 0.0.3
* 添加iOS/Android下载地址

View File

@@ -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
View 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";
}

View File

@@ -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';

View File

@@ -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