cloudbase_auth 0.0.14 copy "cloudbase_auth: ^0.0.14" to clipboard
cloudbase_auth: ^0.0.14 copied to clipboard

Flutter plugin for cloudbase auth.

Cloudbase Auth for Flutter #

Pub

腾讯云·云开发的 Flutter 插件,更多的云开发 Flutter 插件请见云开发文档

安装 #

在 flutter 项目的 pubspec.yaml 文件的 dependencies 中添加

dependencies:
  cloudbase_core: ^0.0.4
  cloudbase_auth: ^0.0.4

简单示例 #

import 'package:cloudbase_core/cloudbase_core.dart';
import 'package:cloudbase_auth/cloudbase_auth.dart';

// 初始化 CloudBase
CloudBaseCore core = CloudBaseCore.init({
    // 填写你的云开发 env
    'env': 'your-env-id'
});

// 获取登录对象
CloudBaseAuth auth = CloudBaseAuth(core);

// 获取登录状态
CloudBaseAuthState authState = await auth.getAuthState();

// 唤起匿名登录
if (authState == null) {
  await auth.signInAnonymously().then((success) {
    // 登录成功
    print(success);
  }).catchError((err) {
    // 登录失败
    print(err);
  });
}

详细文档 #

云开发·登录验证

3
likes
5
points
23
downloads

Publisher

verified publishercloudbase.net

Weekly Downloads

Flutter plugin for cloudbase auth.

Homepage

License

unknown (license)

Dependencies

cloudbase_core, flutter

More

Packages that depend on cloudbase_auth