updateVersion function
Updates the pubspec.yaml and versiong.g.dart with the new version no.
Implementation
void updateVersion(Version? newVersion, PubSpec pubspec, String pathToPubSpec) {
updateVersionFromDetails(newVersion, PubSpecDetails(pubspec, pathToPubSpec));
}