Skip to content

Commit 05e9bed

Browse files
committed
Update docs
1 parent 3a3af90 commit 05e9bed

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ServiceStack's **Add ServiceStack Reference** feature allows clients to generate
77
Dart ServiceStack Reference supports **all Dart platforms**, including Flutter and AngularDart or Dart Web Apps with and without Dart 2's Strong Mode - in the same optimal development workflow pioneered in [Add ServiceStack Reference](http://docs.servicestack.net/add-servicestack-reference) where it doesn't requiring any additional tooling, transformers or build steps.
88

99
Due to the lack of reflection and Mirror support, consuming JSON APIs can be quite [cumbersome in Flutter](https://flutter.io/cookbook/networking/fetch-data/). But we've been able to achieve the same productive development experience available in [all supported languages](http://docs.servicestack.net/add-servicestack-reference) where you can use the generated Dart DTOs from any remote v5.1+ ServiceStack endpoint with ServiceStack's Smart generic
10-
[JsonServiceClient](https://pub.dartlang.org/documentation/servicestack/0.0.7/client/JsonServiceClient-class.html) available in the [servicestack Dart package](https://pub.dartlang.org/packages/servicestack#-installing-tab-), to enable an end-to-end Typed API for calling Services by [sending and receiving native DTOs](http://docs.servicestack.net/architecture-overview#client-architecture).
10+
[JsonServiceClient](https://pub.dartlang.org/documentation/servicestack/latest/servicestack/JsonServiceClient-class.html) available in the [servicestack Dart package](https://pub.dartlang.org/packages/servicestack#-installing-tab-), to enable an end-to-end Typed API for calling Services by [sending and receiving native DTOs](http://docs.servicestack.net/architecture-overview#client-architecture).
1111

1212
### Example Usage
1313

@@ -29,15 +29,15 @@ To make API calls we need to use the `JsonServiceClient`, installed by adding th
2929

3030
```yaml
3131
dependencies:
32-
servicestack: "^0.0.9"
32+
servicestack: "^1.0.0"
3333
```
3434
3535
Saving `pubspec.yaml` in VS Code with the [Dart Code Extension](https://dartcode.org) automatically calls `flutter packages get` to add any new dependencies to your project.
3636

3737
We now have everything we need to be able to make typed API requests to any of [TechStacks APIs](https://www.techstacks.io/metadata) with a shared `JsonServiceClient` instance populated with the base URL of the remote endpoint, e.g:
3838

3939
```dart
40-
import 'package:servicestack/client.dart';
40+
import 'package:servicestack/servicestack.dart';
4141
4242
import 'techstacks.dtos.dart';
4343
@@ -100,7 +100,7 @@ abstract class IConvertible
100100
}
101101
```
102102

103-
The conversion logic that handles the behind-the-scenes conversion into and out of Dart Types is maintained in the extensible [JsonConverters](https://pub.dartlang.org/documentation/servicestack/0.0.7/client/JsonConverters/Converters.html) class which lets you replace built-in converters with your own implementation or register new Converters when you want to take over handling of specific types.
103+
The conversion logic that handles the behind-the-scenes conversion into and out of Dart Types is maintained in the extensible [JsonConverters](https://pub.dartlang.org/documentation/servicestack/latest/servicestack/JsonConverters/Converters.html) class which lets you replace built-in converters with your own implementation or register new Converters when you want to take over handling of specific types.
104104

105105
### JsonServiceClient
106106

@@ -120,11 +120,11 @@ Behind the scenes `JsonServiceClient` leverages the optimal [`HttpClient` in dar
120120

121121
The `servicestack` Dart package also includes an alternative `JsonWebClient` implementation which instead performs HTTP Requests using [dart:html BrowserClient](https://webdev.dartlang.org/angular/guide/server-communication) to use the browsers built-in `XMLHttpRequest` object. Despite their implementation differences `JsonWebClient` also supports the same feature-set as the Dart VM's `JsonServiceClient` above.
122122

123-
AngularDart or Dart Web Apps can use `JsonWebClient` by importing `web_client.dart`, e.g:
123+
AngularDart or Dart Web Apps can use `JsonWebClient` by importing `web.dart`, e.g:
124124

125125
```dart
126-
import 'package:servicestack/client.dart';
127-
import 'package:servicestack/web_client.dart';
126+
import 'package:servicestack/servicestack.dart';
127+
import 'package:servicestack/web.dart';
128128
129129
var client = new JsonWebClient("https://www.techstacks.io");
130130
```
@@ -197,7 +197,7 @@ Then to use `JsonServiceClient` add the `servicestack` dependency to your apps [
197197
dependencies:
198198
flutter:
199199
sdk: flutter
200-
servicestack: "^0.0.9"
200+
servicestack: "^1.0.0"
201201

202202
Saving `pubspec.yaml` automatically runs [flutter packages get](https://flutter.io/using-packages/) to install any new dependencies in your App.
203203

@@ -221,12 +221,12 @@ Which updates all Dart references in the current directory, including any custom
221221
Updated: test.dtos.dart
222222
Updated: techstacks.dtos.dart
223223

224-
This gives us everything we need to call Web Services in our Flutter App, by importing `package:servicestack/client.dart` containing `JsonServiceClient` as well as any generated DTOs.
224+
This gives us everything we need to call Web Services in our Flutter App, by importing `package:servicestack/servicestack.dart` containing `JsonServiceClient` as well as any generated DTOs.
225225

226226
Then create new `JsonServiceClient` instances initialized with the `BaseUrl` for each of the remote endpoints we want to call:
227227

228228
```dart
229-
import 'package:servicestack/client.dart';
229+
import 'package:servicestack/servicestack.dart';
230230
231231
import 'test.dtos.dart';
232232
import 'techstacks.dtos.dart';
@@ -484,10 +484,10 @@ To display the image we assign the response to the `imageBytes` field within the
484484

485485
The [HelloAngularDart](https://github.com/ServiceStackApps/HelloAngularDart) project demonstrates the same functionality in an AngularDart Web App running inside a Web Browser.
486486

487-
The only difference is having to also import `web_client.dart` containing the `JsonWebClient`:
487+
The only difference is having to also import `web.dart` containing the `JsonWebClient`:
488488

489489
```dart
490-
import 'package:servicestack/web_client.dart';
490+
import 'package:servicestack/web.dart';
491491
```
492492

493493
and changing the clients to use the `JsonWebClient` instead, e.g:
@@ -508,8 +508,8 @@ import 'dart:typed_data';
508508
import 'dart:convert';
509509
510510
import 'package:angular/angular.dart';
511-
import 'package:servicestack/client.dart';
512-
import 'package:servicestack/web_client.dart';
511+
import 'package:servicestack/servicestack.dart';
512+
import 'package:servicestack/web.dart';
513513
514514
import '../dtos/test.dtos.dart';
515515
import '../dtos/techstacks.dtos.dart';
@@ -632,7 +632,7 @@ BaseUrl: https://www.techstacks.io
632632
//AddDescriptionAsComments: True
633633
//IncludeTypes:
634634
//ExcludeTypes:
635-
//DefaultImports: package:servicestack/client.dart
635+
//DefaultImports: package:servicestack/servicestack.dart
636636
*/
637637
```
638638

0 commit comments

Comments
 (0)