https://github.com/leancloud/storage-sdk-flutter
LeanCloud Storage SDK for Flutter/Dart.
https://github.com/leancloud/storage-sdk-flutter
Last synced: 11 months ago
JSON representation
LeanCloud Storage SDK for Flutter/Dart.
- Host: GitHub
- URL: https://github.com/leancloud/storage-sdk-flutter
- Owner: leancloud
- License: apache-2.0
- Created: 2019-12-30T02:54:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-29T05:53:51.000Z (almost 3 years ago)
- Last Synced: 2025-04-05T04:51:18.701Z (12 months ago)
- Language: Dart
- Size: 28.4 MB
- Stars: 34
- Watchers: 12
- Forks: 20
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# leancloud_storage



LeanCloud Storage Flutter SDK
## Install
Adding dependency in `pubspec.yaml`:
```dart
dependencies:
...
leancloud_storage: ^0.7.10
```
Then run the following command:
```sh
$ flutter pub get
```
## Import
```dart
import 'package:leancloud_storage/leancloud.dart';
```
## Initialize
```dart
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:
```dart
LCLogger.setLevel(LCLogger.DebugLevel);
```
## Usage
### Objects
```dart
LCObject object = new LCObject('Hello');
object['intValue'] = 123;
await object.save();
```
### Queries
```dart
LCQuery query = new LCQuery('Hello');
query.limit(limit);
List list = await query.find();
```
### Files
```dart
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
```dart
await LCUser.login('hello', 'world');
```
### GeoPoints
```dart
LCGeoPoint p1 = new LCGeoPoint(20.0059, 110.3665);
```
## More
Refer to [LeanStorage Flutter Guide][guide] for more usage information.
The guide is also available in Chinese ([中文指南][zh]).
[guide]: https://docs.leancloud.app/leanstorage_guide-flutter.html
[zh]: https://leancloud.cn/docs/leanstorage_guide-flutter.html
For LeanMessage, check out [LeanCloud Official Plugin][plugin].
[plugin]: https://pub.dev/packages/leancloud_official_plugin