In my case, I deleted the pubspec.lock file and then ran:
pubspec.lock
flutter pub get
This regenerated the lock file and resolved the dependency issues.