Update Dart tests to the latest Dart SDK.

The latest Dart SDK introduced some breaking changes which are fixed in this PR. Let me know if everything is fine.