Migrate to runZonedGuarded (dart-lang/stack_trace#93)

The `onError` argument to `runZoned` is deprecated. Switch to the
supported `runZonedGuarded`.

Remove argument types on the function literal since thy can now be
inferred. `runZonedGuarded` has a specific function type argument,
whereas `onError` was typed as `Function` which did not allow inference
on argument types.

Refactor handling of `!when` since the new API doesn't allow a nullable
callback.

Refactor some tests to use `having` matchers which previously relied on
calling methods on `dynamic`.
4 files changed
tree: e91b8733e6d44ab329384fa34d3adbd2800eab11
  1. pkgs/