Search code examples
flutter

Accidentally deleted flutter default widget code, how do I fix it?


I use vs code and I accidentally(don't even know how I opened it) opened the default widget code for Edgeinsets and probably rewrote it with something I was trying to paste. Now, wherever my app has Edgeinsets, it's shown with red underline and method not found. How do I open the file edgeinsets.dart and what is the default code for that widget? Is there a futter terminal command I can use to fix it or I have to manually copy-paste the code?


Solution

  • Ohhh noo! You did a great mistake man! Never mess with default files...now flutter clean and upgrade won't work..

    Just use flutter pub cache repair in terminal it will delete all default packages and reinstall them again. It should solve your problem.