Skip to content

Update README.md to support code highlight #126

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ Want to get involved? Join our Slack channel and help out! (http://flutter-parse

## Getting Started
To install, either add to your pubspec.yaml
```
```yml
dependencies:
parse_server_sdk: ^1.0.16
```
@@ -20,15 +20,15 @@ or clone this repository and add to your project. As this is an early developmen

Once you have the library added to your project, upon first call to your app (Similar to what your application class would be) add the following...

```
```dart
Parse().initialize(
ApplicationConstants.keyApplicationId,
ApplicationConstants.keyParseServerUrl);
```

It's possible to add other params, such as ...

```
```dart
Parse().initialize(
ApplicationConstants.keyApplicationId,
ApplicationConstants.keyParseServerUrl,
@@ -42,7 +42,7 @@ Parse().initialize(

## Queries
Once you have setup the project and initialised the instance, you can then retreive data from your server by calling:
```
```dart
var apiResponse = await ParseObject('ParseTableName').getAll();

if (apiResponse.success){
@@ -53,7 +53,7 @@ var apiResponse = await ParseObject('ParseTableName').getAll();
```
Or you can get an object by its objectId:

```
```dart
var dietPlan = await DietPlan().getObject('R5EonpUDWy');

if (dietPlan.success) {
@@ -67,7 +67,7 @@ var dietPlan = await DietPlan().getObject('R5EonpUDWy');
## Complex queries
You can create complex queries to really put your database to the test:

```
```dart
var queryBuilder = QueryBuilder<DietPlan>(DietPlan())
..startsWith(DietPlan.keyName, "Keto")
..greaterThan(DietPlan.keyFat, 64)
@@ -110,7 +110,7 @@ The features available are:-
## Objects

You can create custom objects by calling:
```
```dart
var dietPlan = ParseObject('DietPlan')
..set('Name', 'Ketogenic')
..set('Fat', 65);
@@ -132,7 +132,7 @@ The features available are:-
## Custom Objects
You can create your own ParseObjects or convert your existing objects into Parse Objects by doing the following:

```
```dart
class DietPlan extends ParseObject implements ParseCloneable {

DietPlan() : super(_keyTableName);
@@ -155,7 +155,7 @@ class DietPlan extends ParseObject implements ParseCloneable {

To add a variable to an object call and retrieve it, call

```
```dart
dietPlan.set<int>('RandomInt', 8);
var randomInt = dietPlan.get<int>('RandomInt');
```
@@ -164,21 +164,21 @@ var randomInt = dietPlan.get<int>('RandomInt');

You can now save an object by calling .pin() on an instance of an object

```
```dart
dietPlan.pin();
```

and to retrieve it

```
```dart
var dietPlan = DietPlan().fromPin('OBJECT ID OF OBJECT');
```

## Increment Counter values in objects

Retrieve it, call

```
```dart
var response = await dietPlan.increment("count", 1);

```
@@ -187,7 +187,7 @@ var response = await dietPlan.increment("count", 1);

Retrieve it, call

```
```dart
var response = await dietPlan.add("listKeywords", ["a", "a","d"]);

var response = await dietPlan.addUnique("listKeywords", ["a", "a","d"]);
@@ -202,22 +202,22 @@ var response = await dietPlan.remove("listKeywords", ["a"]);
You can create and control users just as normal using this SDK.

To register a user, first create one :
```
```dart
var user = ParseUser().create("TestFlutter", "TestPassword123", "TestFlutterSDK@gmail.com");
```
Then have the user #:

```
```dart
var response = await user.#();
if (response.success) user = response.result;
```
You can also logout and login with the user:
```
```dart
var response = await user.login();
if (response.success) user = response.result;
```
Also, once logged in you can manage sessions tokens. This feature can be called after Parse().init() on startup to check for a logged in user.
```
```dart
user = ParseUser.currentUser();
```
Other user features are:-
@@ -231,12 +231,12 @@ Other user features are:-
## Config

The SDK now supports Parse Config. A map of all configs can be grabbed from the server by calling :
```
```dart
var response = await ParseConfig().getConfigs();
```

and to add a config:
```
```dart
ParseConfig().addConfig('TestConfig', 'testing');
```