Expected: exactly one matching candidate, Actual: found 0 widgets Flutter / Dart Origin: On your device Last updated 4 Nov 2026

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.

Exact message you may see 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
Seen on: Flutter

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

  1. Add await tester.pumpAndSettle(); after taps and futures
  2. Use find.byKey for stable selection
  3. Scroll to the item with tester.scrollUntilVisible

Detailed fix by platform

Flutter

  1. debugDumpApp(); inside the test prints the widget tree

How to diagnose

  1. Pump — Done after the action?
  2. Visible — In viewport?
  3. 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:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

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 (Flutter / Dart)A Timer is still pend…Android license status unknown / licenses not accepted — flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses (Flutter / Dart)Android license statu…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) (Flutter / Dart)BoxConstraints forces…Cleartext HTTP traffic not permitted — Flutter (Android): java.io.IOException: Cleartext HTTP traffic to api.example.com not permitted (Flutter / Dart)Cleartext HTTP traffi…Dependency requires compileSdk 34 or later — Android Gradle: Execution failed for task ':app:checkDebugAarMetadata'. Dependency requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs (Flutter / Dart)Dependency requires c…MediaQuery.of() called with a context that does not contain a MediaQuery — Flutter: MediaQuery.of() called with a context that does not contain a MediaQuery (Flutter / Dart)MediaQuery.of() calle…No Material widget found — Flutter: No Material widget found. TextField widgets require a Material widget ancestor (Flutter / Dart)No Material widget fo…Expected:…

Explore the map of this error Full error map →

🧠 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.