Member-only story

Explain Flutter Async Widget Testing to a 3-year-old

Only the easiest and the most common cases

Jackson Zhou
3 min readOct 24, 2019

Disclaimer: I’m new to Flutter myself, so feel free to add comments and I will update once verified.

No, just kidding, async tests shall pass ;)

Widget is the most basic building block in Flutter

In Flutter, everything is widget and widgets are made out of other widgets. Think of widgets as logo pieces, so it’s essential to write widget tests to make sure your building blocks work properly.

Async means doing things at some point in the future instead of right away

The world async means deferring work to the future, and in Flutter, an async function means it finishes right away but promises to return something in the future.

Async widget means a widget behaves in an async manner (most likely have some async functions under the hood)

Normally, async widgets have several async functions inside it (most likely in its initializer). Remember that an async function finishes right away but promises to return something in the future. Meanwhile, an async widget renders…

--

--

No responses yet