auth method

  1. @override
Future<void> auth({
  1. required List<String> scope,
  2. String? state,
  3. int type = WechatAuthType.kNormal,
})
override

授权登录

Implementation

@override
Future<void> auth({
  required List<String> scope,
  String? state,
  int type = WechatAuthType.kNormal,
}) {
  assert((Platform.isAndroid && type == WechatAuthType.kNormal) ||
      (Platform.isIOS &&
          <int>[WechatAuthType.kNormal, WechatAuthType.kWeb].contains(type)));
  return methodChannel.invokeMethod<void>('auth', <String, dynamic>{
    'scope': scope.join(','), // Scope
    if (state != null) 'state': state,
    'type': type,
  });
}