Workaround is not needed since real fix has landed in dart sdk: https://dart-review.googlesource.com/c/sdk/+/62729.