Flutter test: Expected: exactly one matching candidate Actual: _TextFinder:<Found 0 widgets with text "Hello">
A widget test looked for a widget that is not currently in the tree.
Expected: exactly one matching candidate Actual: Found 0 widgets with textWhich: means none were found but one was expected_TextFinder:<Found 0 widgets with textExpected: exactly one matching candidateActual: _WidgetTypeFinder:<zero widgets with type Meaning
Common causes: the widget is built after an async gap and needs await tester.pump(), it is off-screen in a list (use scrollUntilVisible), the text differs slightly, or the page wasn't navigated to. Print the tree with debugDumpApp() to see what exists.
Common causes
- Missing
await tester.pump()/pumpAndSettle()after an action - Widget built lazily and off-screen
- Text/keys differ
- Navigation not performed
- Dialog or overlay not pumped
⚡ Quick fix
- Add
await tester.pumpAndSettle();after taps and futures - Use
find.byKeyfor stable selection - Scroll to the item with
tester.scrollUntilVisible
Detailed fix by platform
Flutter
debugDumpApp();inside the test prints the widget tree
How to diagnose
- Pump — Done after the action?
- Visible — In viewport?
- Finder — Correct text/key?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- A Timer is still pending even after the widget tree was disposed Flutter test: A Timer is still pending even after the widget tree was disposed
- Android license status unknown / licenses not accepted flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses
- BoxConstraints forces an infinite width Flutter: BoxConstraints forces an infinite width. These invalid constraints were provided to RenderStack's layout() function (TextField in a Row)
Most viewed in Flutter / Dart
- setState() called after dispose() Flutter: setState() called after dispose(): _MyState#1a2b3 (lifecycle state: defunct, not mounted)
- A RenderFlex overflowed Flutter: A RenderFlex overflowed by x pixels on the right/bottom
- Null check operator used on a null value Dart/Flutter: Null check operator used on a null value
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026