提交 609d17b8 authored 作者: JarvanMo's avatar JarvanMo

construct WeChatShareImageModel from file

上级 c60de433
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import 'dart:io';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import '../utils/utils.dart'; import '../utils/utils.dart';
...@@ -177,6 +179,29 @@ class WeChatShareImageModel extends WeChatShareModel { ...@@ -177,6 +179,29 @@ class WeChatShareImageModel extends WeChatShareModel {
messageExt: messageExt, messageExt: messageExt,
scene: scene); scene: scene);
WeChatShareImageModel.fromFile(
File imageFile,
{String transaction,
this.description,
String thumbnail,
WeChatScene scene,
String messageExt,
String messageAction,
String mediaTagName,
this.title})
: this.image = "file://${imageFile.path}",
this.transaction = transaction ?? "text",
this.thumbnail = thumbnail ?? "",
assert(image != null),
super(
mediaTagName: mediaTagName,
messageAction: messageAction,
messageExt: messageExt,
scene: scene);
@override @override
Map toMap() { Map toMap() {
return { return {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论