{"id":21663511,"url":"https://github.com/lunagao/leancloud_flutter_plugin","last_synced_at":"2025-04-11T23:53:27.963Z","repository":{"id":56833786,"uuid":"163529143","full_name":"LunaGao/leancloud_flutter_plugin","owner":"LunaGao","description":"LeanCloud flutter plugin by Luna Gao","archived":false,"fork":false,"pushed_at":"2019-09-11T08:32:09.000Z","size":162,"stargazers_count":33,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-11T23:53:23.442Z","etag":null,"topics":["flutter","flutter-plugin","leancloud"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LunaGao.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-29T17:32:52.000Z","updated_at":"2022-10-03T14:36:39.000Z","dependencies_parsed_at":"2022-09-08T07:41:58.378Z","dependency_job_id":null,"html_url":"https://github.com/LunaGao/leancloud_flutter_plugin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LunaGao%2Fleancloud_flutter_plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LunaGao%2Fleancloud_flutter_plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LunaGao%2Fleancloud_flutter_plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LunaGao%2Fleancloud_flutter_plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LunaGao","download_url":"https://codeload.github.com/LunaGao/leancloud_flutter_plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497839,"owners_count":21113984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","flutter-plugin","leancloud"],"created_at":"2024-11-25T10:26:15.570Z","updated_at":"2025-04-11T23:53:27.946Z","avatar_url":"https://github.com/LunaGao.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LeanCloud flutter plugin\n[![Bless](https://cdn.rawgit.com/LunaGao/BlessYourCodeTag/master/tags/god.svg)](http://lunagao.github.io/BlessYourCodeTag/)\n[![Package version](https://img.shields.io/badge/dynamic/json.svg?url=https://pub.dartlang.org/packages/leancloud_flutter_plugin.json\u0026label=dart\u0026query=$.versions[-1:]\u0026colorB=blue)](https://shields.io/)\n[![Build Status](https://travis-ci.org/LunaGao/leancloud_flutter_plugin.svg?branch=dev)](https://travis-ci.org/LunaGao/leancloud_flutter_plugin)\n\n[Leancloud](https://leancloud.cn/) flutter plugin by Luna Gao\n\n[Dark packages](https://pub.dartlang.org/packages/leancloud_flutter_plugin)\n\n## Description\nThis plugin depends on Leancloud Native(iOS / Android) SDK. It's just convert the code from dart to those native language(Objective-C / Java).\n\n## Getting Started\n\n### Install\n\n* Add this to your package's pubspec.yaml file:\n```\ndependencies:\n  leancloud_flutter_plugin: ^0.0.5\n```\n* Install packages from the command line:\n```\nflutter packages get\n```\n* Import it\n```\nimport 'package:leancloud_flutter_plugin/leancloud_flutter_plugin.dart';\n```\n\n### How to use\nBefore your `runApp` function, initialize the leancloud. Such as the `example` app does.\n\n**Steps:** \n* initialize plugin\n* setup log level *(Optional, default value is `OFF`)*\n* setup region *(Optional, default value is `NorthChina`)*\n* initialize leancloud\n* save object or you can do whet ever you want :)\n\n#### Initialize plugin\nPlugin is *Singleton mode*. Please **NOT** initialize it by yourself.\n\nImport: `import 'package:leancloud_flutter_plugin/leancloud_flutter_plugin.dart';`\n\n```\nLeancloudFlutterPlugin leancloudFlutterPlugin = LeancloudFlutterPlugin.getInstance();\n```\n#### Log Level *(Optional)*\nSetup log level must be earlier than **initialize leancloud** function.\n```\nleancloudFlutterPlugin.setLogLevel(LeancloudLoggerLevel.DEBUG);\n```\n#### Region *(Optional)*\nSetup region must be earlier than **initialize leancloud** function.\n```\nleancloudFlutterPlugin.setRegion(LeancloudCloudRegion.NorthChina);\n```\n#### Initialize Leancloud\n```\nleancloudFlutterPlugin.initialize(appId, appKey);\n```\n#### Create and update an Object\nImport: `import 'package:leancloud_flutter_plugin/leancloud_object.dart';`\n\n```\n// Create\nAVObject object = new AVObject(\"YOUR_OBJECT\");\nobject.put(\"FIELD_NAME\", \"VALUE\"); // String\nobject.put(\"OR_INT\", 10); // int\nobject.put(\"OR_BOOLEAN\", true); // boolean\nobject.put(\"OR_FLOAT\", 10.01); // float\nobject.save().then((object) {\n  // Saved\n  print(object);\n  \n  // and Update\n  object.put(\"description\", \"updated!\");\n  object.save().then((object) {\n    // Updated\n    print(object);\n  });\n});\n\n```\nIf your update your object, `{\"code\":403,\"error\":\"Forbidden writing by object's ACL.\"}` happened, \nthen please check leancloud data's ACL field. \n\n#### Delete an Object\n```\n// object is an AVObject\nobject.delete().then((isDeleted) {\n  // Deleted\n  if (isDeleted) {\n    object = null; // you should set ref to null manually if you don't using this object\n    print(\"Deleted!\");\n  }\n});\n\n```\n\n#### Query an Object\nImport: `import 'package:leancloud_flutter_plugin/leancloud_query.dart';`\n```\n// query by object_id\nAVQuery avQuery = new AVQuery(\"DemoObject\");\navQuery.get(\"OBJECT_ID\").then((object) {\n  print(\"Queryed!\");\n});\n\n// query objects\nAVQuery avQuery = new AVQuery(\"DemoObject\");\navQuery.whereEqualTo(\"KEY\", \"VALUE\"); // string value\navQuery.whereNotEqualTo(\"KEY\", 10); // int value\navQuery.whereGreaterThan(\"KEY\", true); // bool value\navQuery.whereGreaterThanOrEqualTo(\"KEY\", \"VALUE\");\navQuery.whereLessThan(\"KEY\", \"VALUE\");\navQuery.whereLessThanOrEqualTo(\"KEY\", \"VALUE\");\navQuery.find().then((objects) {\n  print(\"All Objects Queryed!\");\n});\n```\n\n## Example App\n\n[Example App README.md](https://github.com/LunaGao/leancloud_flutter_plugin/blob/master/example/README.md)\n\n## Publish Plugin\n\n```\ncd PROJECT_PATH\nflutter format .\nflutter pub pub publish --dry-run\nflutter pub pub publish\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunagao%2Fleancloud_flutter_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunagao%2Fleancloud_flutter_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunagao%2Fleancloud_flutter_plugin/lists"}