Flutter Widget Unit Test Wrappers

Fred Grott
7 min readOct 24, 2021

Flutter test and goldens testing does not run a full flutter app. Instead, the Flutter engine is initialized; then we pump a supplied widget to get a rendered frame. That means acceptance testing on non-integrated testing is somewhat different in that we need to write a wrapper that supplies the App Root Widget so that widget is above the Widget under test in the Widget tree to get a true visual picture of the widget under test.

--

--