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:
dependencies:
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.