shareToWeChat function
Share your requests to WeChat.
This depends on the actual type of model
.
see _shareModelMethodMapper
for detail.
Implementation
Future<bool> shareToWeChat(WeChatShareBaseModel model) async {
if (_shareModelMethodMapper.containsKey(model.runtimeType)) {
final methodChannel = _shareModelMethodMapper[model.runtimeType];
if (methodChannel == null) {
throw ArgumentError.value(
'${model.runtimeType} method channel not found',
);
}
return await _channel.invokeMethod(methodChannel, model.toMap());
}
return Future.error('no method mapper found[${model.runtimeType}]');
}