ServiceStack Dart packages updated

With the new release of Dart 2 we’ve updated the servicestack Dart packages to support Dart 2+.

As this is a breaking change we’ve changed the major version number of servicestack Dart package to 1.0.5 which can be referenced with:

  servicestack: ^1.0.5

Where all non-Web (i.e. Flutter, Dart VM, Server and command-line tests) continue to use the same import and JsonServiceClient, i.e:

import 'package:servicestack/client.dart';

var client = new JsonServiceClient(BaseUrl);

Whilst Dart Web and Angular Dart projects instead use:

import 'package:servicestack/web_client.dart';

var client = new JsonWebClient(BaseUrl);

Both the HelloFlutter and HelloAngularDart example projects (and published docs) have been updated to use Dart 2+ and the latest servicestack Dart packages.

Please refer to the Dart 2 migration guides for how to upgrade your Dart 1.x projects to Dart 2.x. At a minimum it requires changing the sdk restriction in your pubspec.yaml to:

sdk: '>=2.0.0-dev.61.0 <3.0.0'

Normally all changes would be published in the next release notes but the next release is dependent on a new release of VS.NET as it contains support for Xamarin projects being able to the latest ServiceStack.Text which has been modified to use .NET’s new efficient Span<T> types from the System.Memory NuGet package.

I’m on the flutter beta channel and it is running dev.58:
The current Dart SDK version is 2.0.0-dev.58.0.flutter-f981f09760.

and thus the servicestack 1.x release is a non-starter for now.

The sdk: '>=2.0.0-dev.61.0 <3.0.0' was based on the Dart 2 migration guide for requiring Dart 2.

The HelloFlutter project works with that constraint although I’m on the master channel which returns:

 Dart VM version: 2.0.0 (Fri Aug 3 10:53:23 2018 +0200) on "windows_x64"

Hopefully they’ll release an update on the other channels soon.