Search code examples
flutterdartflutter-packages

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


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.


Solution

  • Flutter Issue Fix: 18-April-2020

    It happened due to :

    1. You have created a project and then you try to push the code to Git ( and keeping your vscode open)
    2. Your package needs to update using command flutter packages get ( simply from vscode menu choose terminal and then run this command )
    3. If you still it didn't fix your issue, simply go to File Menu, choose Close Folder, it fixes your issue.
    4. Last option restart VSCode.