Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
b30b1c8d
提交
b30b1c8d
authored
3月 08, 2020
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add params in ShareModels
上级
6e0c824f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
78 行增加
和
19 行删除
+78
-19
share_models.dart
lib/src/share/share_models.dart
+78
-19
没有找到文件。
lib/src/share/share_models.dart
浏览文件 @
b30b1c8d
...
@@ -26,6 +26,9 @@ const String _transaction = "transaction";
...
@@ -26,6 +26,9 @@ const String _transaction = "transaction";
const
String
_thumbnail
=
"thumbnail"
;
const
String
_thumbnail
=
"thumbnail"
;
const
String
_title
=
"title"
;
const
String
_title
=
"title"
;
const
String
_description
=
"description"
;
const
String
_description
=
"description"
;
const
String
_messageExt
=
"messageExt"
;
const
String
_mediaTagName
=
"mediaTagName "
;
const
String
_messageAction
=
"messageAction"
;
mixin
WeChatShareBaseModel
{
mixin
WeChatShareBaseModel
{
Map
toMap
();
Map
toMap
();
...
@@ -36,13 +39,26 @@ mixin WeChatShareBaseModel {
...
@@ -36,13 +39,26 @@ mixin WeChatShareBaseModel {
class
WeChatShareTextModel
implements
WeChatShareBaseModel
{
class
WeChatShareTextModel
implements
WeChatShareBaseModel
{
final
String
source
;
final
String
source
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
messageExt
;
final
String
messageAction
;
final
String
mediaTagName
;
WeChatShareTextModel
(
this
.
source
,
{
this
.
scene
=
WeChatScene
.
SESSION
})
WeChatShareTextModel
(
this
.
source
,
{
this
.
scene
=
WeChatScene
.
SESSION
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
})
:
assert
(
scene
!=
null
);
:
assert
(
scene
!=
null
);
@override
@override
Map
toMap
()
{
Map
toMap
()
{
return
{
_scene:
scene
.
index
,
_source:
source
};
return
{
_scene:
scene
.
index
,
_source:
source
,
_messageExt:
messageExt
,
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
};
}
}
}
}
...
@@ -56,12 +72,12 @@ class WeChatShareMiniProgramModel implements WeChatShareBaseModel {
...
@@ -56,12 +72,12 @@ class WeChatShareMiniProgramModel implements WeChatShareBaseModel {
final
String
path
;
final
String
path
;
final
WeChatImage
hdImagePath
;
final
WeChatImage
hdImagePath
;
final
String
title
;
final
String
title
;
final
String
description
;
final
String
description
;
final
WeChatImage
thumbnail
;
final
WeChatImage
thumbnail
;
final
bool
withShareTicket
;
final
bool
withShareTicket
;
final
String
messageExt
;
final
String
messageAction
;
final
String
mediaTagName
;
WeChatShareMiniProgramModel
(
WeChatShareMiniProgramModel
(
{
@required
this
.
webPageUrl
,
{
@required
this
.
webPageUrl
,
...
@@ -72,8 +88,10 @@ class WeChatShareMiniProgramModel implements WeChatShareBaseModel {
...
@@ -72,8 +88,10 @@ class WeChatShareMiniProgramModel implements WeChatShareBaseModel {
this
.
description
,
this
.
description
,
this
.
withShareTicket
:
false
,
this
.
withShareTicket
:
false
,
this
.
thumbnail
,
this
.
thumbnail
,
this
.
hdImagePath
this
.
hdImagePath
,
})
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
})
:
assert
(
miniProgramType
!=
null
),
:
assert
(
miniProgramType
!=
null
),
assert
(
webPageUrl
!=
null
&&
webPageUrl
.
isNotEmpty
),
assert
(
webPageUrl
!=
null
&&
webPageUrl
.
isNotEmpty
),
assert
(
userName
!=
null
&&
userName
.
isNotEmpty
),
assert
(
userName
!=
null
&&
userName
.
isNotEmpty
),
...
@@ -90,7 +108,9 @@ class WeChatShareMiniProgramModel implements WeChatShareBaseModel {
...
@@ -90,7 +108,9 @@ class WeChatShareMiniProgramModel implements WeChatShareBaseModel {
"description"
:
description
,
"description"
:
description
,
"withShareTicket"
:
withShareTicket
,
"withShareTicket"
:
withShareTicket
,
_thumbnail:
thumbnail
?.
toMap
(),
_thumbnail:
thumbnail
?.
toMap
(),
"hdImagePath"
:
hdImagePath
?.
toMap
()
"hdImagePath"
:
hdImagePath
?.
toMap
(),
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
};
};
}
}
}
}
...
@@ -104,12 +124,18 @@ class WeChatShareImageModel implements WeChatShareBaseModel {
...
@@ -104,12 +124,18 @@ class WeChatShareImageModel implements WeChatShareBaseModel {
final
String
title
;
final
String
title
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
description
;
final
String
description
;
final
String
messageExt
;
final
String
messageAction
;
final
String
mediaTagName
;
WeChatShareImageModel
(
this
.
source
,
WeChatShareImageModel
(
this
.
source
,
{
WeChatImage
thumbnail
,
{
WeChatImage
thumbnail
,
this
.
title
,
this
.
title
,
this
.
scene
=
WeChatScene
.
SESSION
,
this
.
scene
=
WeChatScene
.
SESSION
,
this
.
description
})
this
.
description
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
})
:
assert
(
source
!=
null
),
:
assert
(
source
!=
null
),
assert
(
scene
!=
null
),
assert
(
scene
!=
null
),
this
.
thumbnail
=
thumbnail
??
source
;
this
.
thumbnail
=
thumbnail
??
source
;
...
@@ -121,7 +147,9 @@ class WeChatShareImageModel implements WeChatShareBaseModel {
...
@@ -121,7 +147,9 @@ class WeChatShareImageModel implements WeChatShareBaseModel {
_source:
source
.
toMap
(),
_source:
source
.
toMap
(),
_thumbnail:
thumbnail
.
toMap
(),
_thumbnail:
thumbnail
.
toMap
(),
_title:
title
,
_title:
title
,
_description:
description
_description:
description
,
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
};
};
}
}
}
}
...
@@ -137,6 +165,9 @@ class WeChatShareMusicModel implements WeChatShareBaseModel {
...
@@ -137,6 +165,9 @@ class WeChatShareMusicModel implements WeChatShareBaseModel {
final
String
title
;
final
String
title
;
final
String
description
;
final
String
description
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
messageExt
;
final
String
messageAction
;
final
String
mediaTagName
;
WeChatShareMusicModel
(
WeChatShareMusicModel
(
{
this
.
musicUrl
,
{
this
.
musicUrl
,
...
@@ -146,8 +177,11 @@ class WeChatShareMusicModel implements WeChatShareBaseModel {
...
@@ -146,8 +177,11 @@ class WeChatShareMusicModel implements WeChatShareBaseModel {
this
.
musicDataUrl
,
this
.
musicDataUrl
,
this
.
musicLowBandDataUrl
,
this
.
musicLowBandDataUrl
,
this
.
thumbnail
,
this
.
thumbnail
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
scene
=
WeChatScene
.
SESSION
})
this
.
scene
=
WeChatScene
.
SESSION
})
:
assert
(
musicUrl
!=
null
||
musicLowBandUrl
!=
null
),
:
assert
(
musicUrl
!=
null
||
musicLowBandUrl
!=
null
),
assert
(
scene
!=
null
);
assert
(
scene
!=
null
);
@override
@override
...
@@ -160,7 +194,9 @@ class WeChatShareMusicModel implements WeChatShareBaseModel {
...
@@ -160,7 +194,9 @@ class WeChatShareMusicModel implements WeChatShareBaseModel {
"musicLowBandDataUrl"
:
musicLowBandDataUrl
,
"musicLowBandDataUrl"
:
musicLowBandDataUrl
,
_thumbnail:
thumbnail
?.
toMap
(),
_thumbnail:
thumbnail
?.
toMap
(),
_title:
title
,
_title:
title
,
_description:
description
_description:
description
,
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
};
};
}
}
}
}
...
@@ -173,8 +209,10 @@ class WeChatShareVideoModel implements WeChatShareBaseModel {
...
@@ -173,8 +209,10 @@ class WeChatShareVideoModel implements WeChatShareBaseModel {
final
WeChatImage
thumbnail
;
final
WeChatImage
thumbnail
;
final
String
title
;
final
String
title
;
final
String
description
;
final
String
description
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
messageExt
;
final
String
messageAction
;
final
String
mediaTagName
;
WeChatShareVideoModel
(
WeChatShareVideoModel
(
{
this
.
scene
=
WeChatScene
.
SESSION
,
{
this
.
scene
=
WeChatScene
.
SESSION
,
...
@@ -182,7 +220,10 @@ class WeChatShareVideoModel implements WeChatShareBaseModel {
...
@@ -182,7 +220,10 @@ class WeChatShareVideoModel implements WeChatShareBaseModel {
this
.
videoLowBandUrl
,
this
.
videoLowBandUrl
,
this
.
title
:
""
,
this
.
title
:
""
,
this
.
description
:
""
,
this
.
description
:
""
,
this
.
thumbnail
})
this
.
thumbnail
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
})
:
assert
(
videoUrl
!=
null
||
videoLowBandUrl
!=
null
),
:
assert
(
videoUrl
!=
null
||
videoLowBandUrl
!=
null
),
assert
(
thumbnail
!=
null
),
assert
(
thumbnail
!=
null
),
assert
(
scene
!=
null
);
assert
(
scene
!=
null
);
...
@@ -195,7 +236,9 @@ class WeChatShareVideoModel implements WeChatShareBaseModel {
...
@@ -195,7 +236,9 @@ class WeChatShareVideoModel implements WeChatShareBaseModel {
"videoLowBandUrl"
:
videoLowBandUrl
,
"videoLowBandUrl"
:
videoLowBandUrl
,
_thumbnail:
thumbnail
?.
toMap
(),
_thumbnail:
thumbnail
?.
toMap
(),
_title:
title
,
_title:
title
,
_description:
description
_description:
description
,
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
};
};
}
}
}
}
...
@@ -208,12 +251,18 @@ class WeChatShareWebPageModel implements WeChatShareBaseModel {
...
@@ -208,12 +251,18 @@ class WeChatShareWebPageModel implements WeChatShareBaseModel {
final
String
title
;
final
String
title
;
final
String
description
;
final
String
description
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
messageExt
;
final
String
messageAction
;
final
String
mediaTagName
;
WeChatShareWebPageModel
(
this
.
webPage
,
WeChatShareWebPageModel
(
this
.
webPage
,
{
this
.
title
:
""
,
{
this
.
title
:
""
,
this
.
description
:
""
,
this
.
description
:
""
,
this
.
thumbnail
,
this
.
thumbnail
,
this
.
scene
=
WeChatScene
.
SESSION
})
this
.
scene
=
WeChatScene
.
SESSION
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
})
:
assert
(
webPage
!=
null
),
:
assert
(
webPage
!=
null
),
assert
(
thumbnail
!=
null
),
assert
(
thumbnail
!=
null
),
assert
(
scene
!=
null
);
assert
(
scene
!=
null
);
...
@@ -224,7 +273,9 @@ class WeChatShareWebPageModel implements WeChatShareBaseModel {
...
@@ -224,7 +273,9 @@ class WeChatShareWebPageModel implements WeChatShareBaseModel {
_scene:
scene
.
index
,
_scene:
scene
.
index
,
"webPage"
:
webPage
,
"webPage"
:
webPage
,
_thumbnail:
thumbnail
?.
toMap
(),
_thumbnail:
thumbnail
?.
toMap
(),
_title:
title
_title:
title
,
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
};
};
}
}
}
}
...
@@ -237,13 +288,19 @@ class WeChatShareFileModel implements WeChatShareBaseModel {
...
@@ -237,13 +288,19 @@ class WeChatShareFileModel implements WeChatShareBaseModel {
final
String
title
;
final
String
title
;
final
String
description
;
final
String
description
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
messageExt
;
final
String
messageAction
;
final
String
mediaTagName
;
WeChatShareFileModel
(
this
.
filePath
,
WeChatShareFileModel
(
this
.
filePath
,
{
this
.
fileExtension
:
"pdf"
,
{
this
.
fileExtension
:
"pdf"
,
this
.
title
:
""
,
this
.
title
:
""
,
this
.
description
:
""
,
this
.
description
:
""
,
this
.
thumbnail
,
this
.
thumbnail
,
this
.
scene
=
WeChatScene
.
SESSION
})
this
.
scene
=
WeChatScene
.
SESSION
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
})
:
assert
(
filePath
!=
null
),
:
assert
(
filePath
!=
null
),
assert
(
scene
!=
null
);
assert
(
scene
!=
null
);
...
@@ -255,7 +312,9 @@ class WeChatShareFileModel implements WeChatShareBaseModel {
...
@@ -255,7 +312,9 @@ class WeChatShareFileModel implements WeChatShareBaseModel {
"fileExtension"
:
fileExtension
,
"fileExtension"
:
fileExtension
,
_thumbnail:
thumbnail
?.
toMap
(),
_thumbnail:
thumbnail
?.
toMap
(),
_title:
title
,
_title:
title
,
_description:
description
_description:
description
,
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
};
};
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论