cloudbase_database 0.0.12

Flutter Android iOS

Flutter plugin for cloudbase database.

Cloudbase Database for Flutter #

Pub

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

安装 #

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

dependencies:
  cloudbase_core: ^0.0.4
  cloudbase_database: ^0.0.7

简单示例 #

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

void main() async {
  CloudBaseCore core = CloudBaseCore.init({'env': 'your-env-id'});

  // 匿名登录
  CloudBaseAuth auth = CloudBaseAuth(core);
  CloudBaseAuthState authState = await auth.getAuthState();

  if (authState == null) {
      await auth.signInAnonymously();
  }

  // 数据库查询
  CloudBaseDatabase database = CloudBaseDatabase(core);
  String myOpenID = 'xxx';
  database.collection('user').where({
    '_openid': myOpenID
  });
}

详细文档 #

云开发·数据库

1
likes
55
pub points
62%
popularity

Flutter plugin for cloudbase database.

Homepage

Documentation

API reference

Uploader

lt520c@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

cloudbase_core, flutter

More

Packages that depend on cloudbase_database