Basically undo the changes in https://github.com/flutter/flutter/pull/123242 once the underlying bug is fixed.