flutterdependenciespubspec.yamlflutter-razorpay

In Pubspec.lock file razor_pay flutter is having version 1.3.2 vs in Pubspec.yaml its 1.3.2


In pubspec.lock the version is : "1.3.4" ,in pubspec.yml the version is razorpay_flutter: ^1.3.2 i tried deleting lock file then running pub get but still it goes to 1.3.4 , i want to use only the version 1.3.2

i tried running pub get , still its showing 1.3.4 in pubspec.lock file. i tried deleting the lock file then get pub but still its showing in lock file 1.3.2, where as in pubspec.yml its showing 1.3.2 i want to use 1.3.2 version only and why flutter is changing the lock file version and not updating it to 1.3.4 as same as pubspec.yml


Solution

  • Having:

    dependencies:
      razorpay_flutter: ^1.3.2
    

    in your pubspec.yaml file does not mean to use only version 1.3.2; it means use a version that is expected to be backwards-compatible with version 1.3.2 based on semantic versioning. This is explained by the documentation for caret syntax.

    If you want to use version 1.3.2 and only version 1.3.2, remove the caret:

    dependencies:
      razorpay_flutter: 1.3.2
    

    However, if you're doing that because of some incompatibility with version 1.3.4, then you should report that to the package maintainer.