fluwx library Null safety

Fluwx is a powerful plugin for WeChatSDK. easy to use.

A open sou;rce project authorized by OpenFlutter.

Classes

BaseWeChatResponse
WeChatAuthByQRCodeFinishedResponse
WeChatAuthGotQRCodeResponse
qrCode in memory.
WeChatAuthResponse
WeChatFile
WeChatImage
WeChatLaunchMiniProgramResponse
WeChatOpenBusinessWebviewResponse
WeChatPaymentResponse
WeChatQRCodeScannedResponse
WeChatShareFileModel
source the file you want to share, source.suffix is necessary on iOS. scene can't be WeChatScene.TIMELINE, otherwise, sharing nothing. send files to WeChat
WeChatShareImageModel
source the image you want to send to WeChat scene the target you want to send thumbnail the preview of your image, will be created from scene if null.
WeChatShareMiniProgramModel
the default value is MINI_PROGRAM_TYPE_RELEASE hdImagePath only works on iOS, not sure the relationship between thumbnail and hdImagePath.
WeChatShareMusicModel
if musicUrl and musicLowBandUrl are both provided, only musicUrl will be used.
WeChatShareResponse
WeChatShareTextModel
source the text you want to send to WeChat scene the target you want to send
WeChatShareVideoModel
if videoUrl and videoLowBandUrl are both provided, only videoUrl will be used.
WeChatShareWebPageModel
webPage url you want to send to wechat thumbnail logo of your website
WeChatShowMessageFromWXRequest
WeChatSubscribeMsgResponse

Mixins

WeChatShareBaseModel

Extensions

MiniProgramTypeExtensions

Constants

defaultSuffixJpeg → const String
".jpeg"
defaultSuffixTxt → const String
".txt"

Properties

isWeChatInstalled Future<bool>
true if WeChat installed,otherwise false. Please add WeChat to the white list in order to get the correct result on IOS.
read-only
weChatResponseEventHandler Stream<BaseWeChatResponse>
Response answers from WeChat after sharing, payment etc.
read-only

Functions

authWeChatByPhoneLogin({required String scope, String state = "state"}) Future<bool>
IOS only
authWeChatByQRCode({required String appId, required String scope, required String nonceStr, required String timeStamp, required String signature, String? schemeData}) Future<bool>
Sometimes WeChat is not installed on users's devices.However we can request a QRCode so that we can get AuthCode by scanning the QRCode All required params must not be null or empty schemeData only works on iOS see * https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=215238808828h4XN&token=&lang=zh_CN
autoDeDuctWeChat({required String appId, required String mchId, required String planId, required String contractCode, required String requestSerial, required String contractDisplayAccount, required String notifyUrl, required String version, required String sign, required String timestamp, String returnApp = '3', int businessType = 12}) Future<bool>
please read official docs.
getExtMsg() Future<String>
launchWeChatMiniProgram({required String username, String? path, WXMiniProgramType miniProgramType = WXMiniProgramType.RELEASE}) Future<bool>
open mini-program see WXMiniProgramType
openWeChatApp() Future<bool>
just open WeChat, noting to do.
payWithWeChat({required String appId, required String partnerId, required String prepayId, required String packageValue, required String nonceStr, required int timeStamp, required String sign, String? signType, String? extData}) Future<bool>
request payment with WeChat. Read the official document for more detail. timeStamp is int because timeStamp will be mapped to Unit32.
payWithWeChatHongKongWallet({required String prepayId}) Future<bool>
request Hong Kong Wallet payment with WeChat. Read the official document for more detail.
registerWxApi({required String appId, bool doOnIOS = true, bool doOnAndroid = true, String? universalLink}) Future<bool>
it's ok if you register multi times. appId is not necessary. if doOnIOS is true ,fluwx will register WXApi on iOS. if doOnAndroid is true, fluwx will register WXApi on Android. universalLink is required if you want to register on iOS.
sendWeChatAuth({required String scope, String state = "state"}) Future<bool>
The WeChat-Login is under Auth-2.0 This method login with native WeChat app. For users without WeChat app, please use authByQRCode instead This method only supports getting AuthCode,this is first step to login with WeChat Once AuthCode got, you need to request Access_Token For more information please visit: [...]
shareToWeChat(WeChatShareBaseModel model) Future<bool>
Share your requests to WeChat. This depends on the actual type of model. see _shareModelMethodMapper for detail.
stopWeChatAuthByQRCode() Future<bool>
stop authWeChatByQRCode
subscribeWeChatMsg({required String appId, required int scene, required String templateId, String? reserved}) Future<bool>
subscribe WeChat message

Enums

AuthByQRCodeErrorCode
WechatAuth_Err_OK(0), WechatAuth_Err_NormalErr(-1), WechatAuth_Err_NetworkErr(-2), WechatAuth_Err_JsonDecodeErr(-3), WechatAuth_Err_Cancel(-4), WechatAuth_Err_Timeout(-5), WechatAuth_Err_Auth_Stopped(-6); AuthByQRCodeErrorCode.JSON_DECODE_ERR means WechatAuth_Err_GetQrcodeFailed when platform is iOS only Android will get AUTH_STOPPED
WeChatScene
WeChatScene.SESSION会话 WeChatScene.TIMELINE朋友圈 WeChatScene.FAVORITE收藏
WXMiniProgramType
WXMiniProgramType.RELEASE正式版 WXMiniProgramType.TEST测试版 WXMiniProgramType.PREVIEW预览版