DevelopersSeptember 14, 2026by
EmpoorioChain Core
EmpoorioChain Core

Engineering Notes #9: Layout Overflows Are Exceptions, So Test Them Like Exceptions

What happened

Ailoos App was reviewed by hand on a tablet for three days. Screens were opened, looked at, screenshotted. On 13 September 2026 a widget test was added that renders every screen at the logical sizes of the two reference devices — a phone at 420×913 and a tablet at 686×1097 (density 280 → 1.75) — and fails on any RenderFlex overflowed. First run: nine overflows in eight places. Almost all appeared only on the phone, which is why three days on the tablet had not seen them.

Why a test and not screenshots

A Flutter overflow is an exception, not a yellow-and-black stripe. Screenshots see only the screens someone opens, on the device that happens to be connected, on that day. A test runs in every suite, on every screen, at both sizes, forever.

The template

Ailoos_App/test/ui/desbordes_en_los_dos_aparatos_test.dart — reusable across the ecosystem's Flutter apps.

Three traps in the test itself

  1. tester.takeException() keeps one exception — the last. With several overflows on one screen the earlier ones are lost; if the last error is something else (a plugin absent in the test environment) the test passes green with an overflow in plain sight. Install a FlutterError.onError handler that accumulates every error.
  2. The culprit widget is not in the stack trace. It is in the error's informationCollector; render toDiagnosticsNode().toStringDeep() and search for relevant error-causing widget.
  3. Plugins absent in tests throw. Stub them, or the accumulated errors are noise.

The rule

Anything that manifests as an exception at runtime should be caught by a test, not by a person looking at a screen. The ecosystem's Flutter apps — Eoonia, Ouranoos, Ailoos, the commerce apps — adopt the template.

The same week OuranoOS's tablet review found seven problems that 142 green tests had not — an invented quota, a simulator 17× too cheap, a NaN. Both lessons stand: test what can be tested, and also launch the app. Neither replaces the other.

From the Ailoos App overflow sweep, 2026-09-13.

Share this article