Here is the solution for this problem, just run this and thank me later
flutter pub upgrade --major-versions