setSurfaceSize method Null safety

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

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

Set to null to use the default surface size.

Implementation

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