What's the use of pubspec.lock file in Flutter Project

Issue

Every project this file is auto-generated, also if I am added any library to pubspec.yaml file, this file also updates and, added and shows there URL, name path, and source.
but what’s the main purpose of these files in the project.

Solution

pubspec.lock :
lock file lets you test your package against the latest compatible versions of its dependencies. For application packages, we recommend that you commit the pubspec. lock file. Saving pubspec. lock ensures that everyone working on the app uses the exact same versions

Reference of official doc

Answered By – Maz341

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *