leancloud_storage 0.4.1 copy "leancloud_storage: ^0.4.1" to clipboard
leancloud_storage: ^0.4.1 copied to clipboard

outdated

A new Flutter package project.

leancloud_storage #

LeanCloud 数据存储 Flutter SDK。

安装 #

在 pubspec.yaml 依赖中增加 SDK 库:

dependencies:
  ...
  leancloud_storage: ^0.2.7

在控制台中执行安装命令:

$ flutter pub get

导入 #

在需要使用 SDK 的 .dart 文件中,引入 SDK:

import 'package:leancloud_storage/leancloud.dart';

初始化 #

LeanCloud.initialize(APP_ID, APP_KEY, server: APP_SERVER);

调试 #

开启调试日志

LCLogger.setLevel(LCLogger.DebugLevel);

用法 #

对象 #

LCObject object = new LCObject('Hello');
object['intValue'] = 123;
await object.save();

更多关于对象用法:参考

查询 #

LCQuery<LCObject> query = new LCQuery<LCObject>('Hello');
query.limit(limit);
List<LCObject> list = await query.find();

更多关于查询用法:参考

文件 #

LCFile file = await LCFile.fromPath('avatar', './avatar.jpg');
await file.save(onProgress: (int count, int total) {
    print('$count/$total');
    if (count == total) {
        print('done');
    }
});

更多关于文件用法:参考

用户 #

await LCUser.login('hello', 'world');

更多关于用户用法:参考

GeoPoint #

LCGeoPoint p1 = new LCGeoPoint(20.0059, 110.3665);

更多关于 GeoPoint 用法:参考