Skip to content

Commit 1723780

Browse files
cipi1965phillwiggins
authored andcommitted
Update README.md to support code highlight (#126)
1 parent 86a7e1e commit 1723780

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Want to get involved? Join our Slack channel and help out! (http://flutter-parse
1111

1212
## Getting Started
1313
To install, either add to your pubspec.yaml
14-
```
14+
```yml
1515
dependencies:
1616
parse_server_sdk: ^1.0.16
1717
```
@@ -20,15 +20,15 @@ or clone this repository and add to your project. As this is an early developmen
2020
2121
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...
2222
23-
```
23+
```dart
2424
Parse().initialize(
2525
ApplicationConstants.keyApplicationId,
2626
ApplicationConstants.keyParseServerUrl);
2727
```
2828

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

31-
```
31+
```dart
3232
Parse().initialize(
3333
ApplicationConstants.keyApplicationId,
3434
ApplicationConstants.keyParseServerUrl,
@@ -42,7 +42,7 @@ Parse().initialize(
4242

4343
## Queries
4444
Once you have setup the project and initialised the instance, you can then retreive data from your server by calling:
45-
```
45+
```dart
4646
var apiResponse = await ParseObject('ParseTableName').getAll();
4747
4848
if (apiResponse.success){
@@ -53,7 +53,7 @@ var apiResponse = await ParseObject('ParseTableName').getAll();
5353
```
5454
Or you can get an object by its objectId:
5555

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

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

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

135-
```
135+
```dart
136136
class DietPlan extends ParseObject implements ParseCloneable {
137137
138138
DietPlan() : super(_keyTableName);
@@ -155,7 +155,7 @@ class DietPlan extends ParseObject implements ParseCloneable {
155155

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

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

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

167-
```
167+
```dart
168168
dietPlan.pin();
169169
```
170170

171171
and to retrieve it
172172

173-
```
173+
```dart
174174
var dietPlan = DietPlan().fromPin('OBJECT ID OF OBJECT');
175175
```
176176

177177
## Increment Counter values in objects
178178

179179
Retrieve it, call
180180

181-
```
181+
```dart
182182
var response = await dietPlan.increment("count", 1);
183183
184184
```
@@ -187,7 +187,7 @@ var response = await dietPlan.increment("count", 1);
187187

188188
Retrieve it, call
189189

190-
```
190+
```dart
191191
var response = await dietPlan.add("listKeywords", ["a", "a","d"]);
192192
193193
var response = await dietPlan.addUnique("listKeywords", ["a", "a","d"]);
@@ -202,22 +202,22 @@ var response = await dietPlan.remove("listKeywords", ["a"]);
202202
You can create and control users just as normal using this SDK.
203203

204204
To register a user, first create one :
205-
```
205+
```dart
206206
var user = ParseUser().create("TestFlutter", "TestPassword123", "TestFlutterSDK@gmail.com");
207207
```
208208
Then have the user #:
209209

210-
```
210+
```dart
211211
var response = await user.#();
212212
if (response.success) user = response.result;
213213
```
214214
You can also logout and login with the user:
215-
```
215+
```dart
216216
var response = await user.login();
217217
if (response.success) user = response.result;
218218
```
219219
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.
220-
```
220+
```dart
221221
user = ParseUser.currentUser();
222222
```
223223
Other user features are:-
@@ -231,12 +231,12 @@ Other user features are:-
231231
## Config
232232

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

238238
and to add a config:
239-
```
239+
```dart
240240
ParseConfig().addConfig('TestConfig', 'testing');
241241
```
242242

0 commit comments

Comments
 (0)