Target of URI doesn't exist 'package:flutter/material.dart'

Farah Bédoui picture Farah Bédoui · Jul 15, 2018 · Viewed 19.6k times · Source

My Flutter IDE (Android Studio) doesn't recognize material.dart anymore! It happened suddenly, I was working normally then my PC turned off because of CPU 100% consumption and when I restarted I found this problem.

Answer

Mohamed Mesalm picture Mohamed Mesalm · Dec 2, 2018
  1. ctrl -> Shift -> A (Find Action)
  2. Search for "Dart Analysis"
  3. Click the icon that says "Restart the Dart Analysis server"
  4. The red underline disappears from the package import and everything works.