leancloud_storage 0.5.0
leancloud_storage: ^0.5.0

Flutter Android iOS

A new Flutter package project.

leancloud_storage #

build the latest version platform

LeanCloud Storage Flutter SDK

Install #

Adding dependency in pubspec.yaml:

dependencies:
  ...
  leancloud_storage: ${latest version}

Then run the following command:

$ flutter pub get

Import #

import 'package:leancloud_storage/leancloud.dart';

Initialize #

LeanCloud.initialize(
  APP_ID, APP_KEY,
  server: APP_SERVER, // to use your own custom domain
  queryCache: new LCQueryCache() // optinoal, enable cache
);

Debug #

Enable debug logs:

LCLogger.setLevel(LCLogger.DebugLevel);

Usage #

Objects #

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

Queries #

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

Files #

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

Users #

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

GeoPoints #

LCGeoPoint p1 = new LCGeoPoint(20.0059, 110.3665);

More #

Refer to LeanStorage Flutter Guide for more usage information. The guide is also available in Chinese (δΈ­ζ–‡ζŒ‡ε—).

For LeanMessage, check out LeanCloud Official Plugin.

3
likes
65
pub points
72%
popularity

Publisher

leancloud.rocks

A new Flutter package project.

Homepage

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

convert, crypto, dio, dio_http_cache, flutter, path, shared_preferences

More

Packages that depend on leancloud_storage