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

An official flutter plugin for LeanCloud storage service base on dart.

leancloud_storage #

build the latest version platform

LeanCloud Storage Flutter SDK

Install #

Adding dependency in pubspec.yaml:

dependencies:
  ...
  leancloud_storage: ^0.7.10
copied to clipboard

Then run the following command:

$ flutter pub get
copied to clipboard

Import #

import 'package:leancloud_storage/leancloud.dart';
copied to clipboard

Initialize #

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

Debug #

Enable debug logs:

LCLogger.setLevel(LCLogger.DebugLevel);
copied to clipboard

Usage #

Objects #

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

Queries #

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

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');
    }
});
copied to clipboard

Users #

await LCUser.login('hello', 'world');
copied to clipboard

GeoPoints #

LCGeoPoint p1 = new LCGeoPoint(20.0059, 110.3665);
copied to clipboard

More #

Refer to LeanStorage Flutter Guide for more usage information. The guide is also available in Chinese (中文指南).

For LeanMessage, check out LeanCloud Official Plugin.

10
likes
115
points
245
downloads

Publisher

verified publisherleancloud.rocks

Weekly Downloads

2024.09.15 - 2025.03.30

An official flutter plugin for LeanCloud storage service base on dart.

Homepage

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

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

More

Packages that depend on leancloud_storage