After trying all the solutions here , I ran the Flutter doctor from the power shell it self , it started downloading the latest dart version , the restarted the IDE and It worked fine