1. Dart initialization (Fluwx: ^1.2.1+1)
void initWX() async{
    await fluwx.registerWxApi(
        appId:"xxxxxxxxxx",
        doOnAndroid: true,
        doOnIOS: true,
        universalLink:"https://www.kxxxxxxx/"

    );
    var result = await fluwx.isWeChatInstalled();
    print("is installed $result");
  }
Copy the code

2. Login invocation

Void loginWX() {print(" loginWX "); fluwx .sendAuth(scope: "snsapi_userinfo", state: "Wechat_sdk_demo_test "). Then ((data) {setState(() {print(" + data.tostring ()); }); }).catchError((e) { print('weChatLogin e $e'); }); }Copy the code