viewportSize property

CellSize get viewportSize

Default size used by render / renderToString when no explicit size is given, and the size installed in the ambient MediaQuery. Mutable so tests can grow / shrink the viewport mid-test:

tester.viewportSize = const CellSize(40, 10);

A change after the first pumpWidget rebuilds the tree's MediaQuery in place and rebuilds its dependents — the harness analog of a terminal resize (run_app rebuilds its ambient MediaQuery on every ResizeEvent), so layout and what widgets read from MediaQuery never diverge.

Implementation

CellSize get viewportSize => _viewportSize;
set viewportSize (CellSize value)

Implementation

set viewportSize(CellSize value) {
  if (value == _viewportSize) return;
  _viewportSize = value;
  _refreshSurface();
}