No Material widget found Flutter / Dart Origin: On your device Last updated 4 Nov 2026

Flutter: No Material widget found. TextField widgets require a Material widget ancestor

A Material-design widget (TextField, ListTile, InkWell, Chip) was placed outside a Scaffold, Material or Card, so it has no Material ancestor to draw ink effects on.

Exact message you may see No Material widget foundTextField widgets require a Material widget ancestorNo Material widget found. InkWell widgets require a Material widget ancestorListTile widgets require a Material widget ancestorMaterial widget ancestor required
Seen on: Flutter

Meaning

The usual cause is calling runApp with a widget that is not wrapped in MaterialApp/Scaffold, or building a custom route/overlay with no Material in its tree. Wrap the subtree in Material(...) or Scaffold(...).

Common causes

  • runApp(MyWidget()) without MaterialApp
  • Dialog/Overlay content outside the app's Material
  • Custom page using Container as the root
  • TextField placed in a plain Container route
  • Widget test pumping a widget without MaterialApp

⚡ Quick fix

  1. Wrap the app in MaterialApp(home: Scaffold(...))
  2. Wrap the subtree in Material(type: MaterialType.transparency)
  3. In tests use MaterialApp(home: Scaffold(body: widget))

Detailed fix by platform

Flutter

  1. Test fix: await tester.pumpWidget(MaterialApp(home: Scaffold(body: MyWidget())));

How to diagnose

  1. Root — MaterialApp present?
  2. Subtree — Inside Scaffold/Material?
  3. Test — Pump wrapped?

🔧 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 RenderFlex overflowed — Flutter: A RenderFlex overflowed by x pixels on the right/bottom (Flutter / Dart)A RenderFlex overflow…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…Expected: exactly one matching candidate, Actual: found 0 widgets — Flutter test: Expected: exactly one matching candidate Actual: _TextFinder:<Found 0 widgets with text "Hello"> (Flutter / Dart)Expected: exactly one…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…Navigator operation requested with a context that does not include a Navigator — Flutter: Navigator operation requested with a context that does not include a Navigator (Flutter / Dart)Navigator operation r…No Materi…

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.