From dd26f173443240079befe2fd1e21ca535d9d8944 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Wed, 20 Mar 2019 00:14:14 -0300 Subject: [PATCH 1/2] Update README.md --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c910a5f9b..757362f70 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,8 @@ You can create complex queries to really put your database to the test: ..startsWith(DietPlan.keyName, "Keto") ..greaterThan(DietPlan.keyFat, 64) ..lessThan(DietPlan.keyFat, 66) - ..equals(DietPlan.keyCarbs, 5); + ..equals(DietPlan.keyCarbs, 5) + ..whereEqualTo("owner", user.toPointer()); //Query using Pointer to user var response = await queryBuilder.query(); @@ -180,6 +181,13 @@ Retrieve it, call ```dart var response = await dietPlan.increment("count", 1); +``` +or using with save function + +```dart +dietPlan.setIncrement('count', 1); +dietPlan.setDecrement('count', 1); +var response = dietPlan.save() ``` @@ -188,14 +196,23 @@ var response = await dietPlan.increment("count", 1); Retrieve it, call ```dart -var response = await dietPlan.add("listKeywords", ["a", "a","d"]); +var response = await dietPlan.add('listKeywords', ['a','a','d']); -var response = await dietPlan.addUnique("listKeywords", ["a", "a","d"]); +var response = await dietPlan.addUnique('listKeywords', ['a', 'a','d']); -var response = await dietPlan.remove("listKeywords", ["a"]); +var response = await dietPlan.remove('listKeywords', ['a']); ``` +or using with save function + +```dart +dietPlan.setAdd('listKeywords', ['a','a','d']); +dietPlan.setAddUnique('listKeywords', ['a','a','d']); +dietPlan.setRemove('listKeywords', ['a']); +var response = dietPlan.save() + +``` ## Users @@ -240,6 +257,33 @@ and to add a config: ParseConfig().addConfig('TestConfig', 'testing'); ``` + +## Installation + +The SDK supports Parse Installation and Channels: + +```dart +var instalattion = await ParseInstallation.currentInstallation(); +instalattion.deviceToken = 'xyz'; +instalattion.set('user', user); //Create Pointer to user +instalattion.subscribeToChannel('C'); +var response = await instalattion.save(); +``` + +For unsubscribe Channels: + +```dart +var instalattion = await ParseInstallation.currentInstallation(); +instalattion.unsubscribeFromChannel('D'); +var response = await instalattion.save(); +``` + +For gest List Channels: + +```dart +List channels = await instalattion.getSubscribedChannels(); +``` + ## Other Features of this library Main: From 1cbcadeb81c022caa978f9ed3501197f4283b6c6 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Wed, 20 Mar 2019 01:46:34 -0300 Subject: [PATCH 2/2] Update README.md --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 757362f70..33049e3fc 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,19 @@ var dietPlan = ParseObject('DietPlan') ..set('Name', 'Ketogenic') ..set('Fat', 65); ``` + +Types supported: + * String + * Double + * Int + * Boolean + * DateTime + * File + * Geopoint + * ParseObject/ParseUser (Pointer) + * Map + * List (all types supported) + You then have the ability to do the following with that object: The features available are:- * Get @@ -197,9 +210,7 @@ Retrieve it, call ```dart var response = await dietPlan.add('listKeywords', ['a','a','d']); - var response = await dietPlan.addUnique('listKeywords', ['a', 'a','d']); - var response = await dietPlan.remove('listKeywords', ['a']); ``` @@ -257,7 +268,6 @@ and to add a config: ParseConfig().addConfig('TestConfig', 'testing'); ``` - ## Installation The SDK supports Parse Installation and Channels: @@ -284,6 +294,43 @@ For gest List Channels: List channels = await instalattion.getSubscribedChannels(); ``` +## Files + +The SDK supports Parse File for Upload e Download. + +```dart +File imgFile = await ImagePicker.pickImage(source: ImageSource.gallery); +ParseFile parseFile = ParseFile(imgFile, name: 'image.jpeg'); +var response = await parseFile.save(); +if (fileResponse.success) { + print('Upload with success'); + } else { + print('Upload with error'); + } +``` + +For retrieve ParseFile from Parse Object: + +```dart +var image = dietPlan.get('image') as ParseFile; +print('Image url: ' + image.url); +print('Image name: ' + image.name); + +```` + +For download ParseFile in local storage: + +```dart +ParseFile file = await parseFile.download(); +``` + +For retrieve ParseFile from local storage: + +```dart +ParseFile file = await parseFile.loadStorage(); +``` + + ## Other Features of this library Main: