setSurfaceSize method Null safety

Future<void> setSurfaceSize(
  1. Size? size
)

Artificially changes the surface size to size on the Widget binding, then flushes microtasks.

Set to null to use the default surface size.

Implementation

Future<void> setSurfaceSize(Size? size) {
  return TestAsyncUtils.guard<void>(() async {
    assert(inTest);
    if (_surfaceSize == size)
      return;
    _surfaceSize = size;
    handleMetricsChanged();
  });
}