1. Why did you develop this vscode plug-in?

In the Flutter project, we have now developed some of our own component libraries, which are uploaded to the company’s Git and referenced as follows.

But after a while, the code was lost because the above reference method did not specify a local path, so flutter uniformly downloaded the dependent libraries to a local cache path.

Git clone to the local plugin and specify a path so that the changes will not be lost.

The main purpose of developing this vscode plug-in is to implement automatic git clone to the local, so that the plugin code changes are not lost.

2. Existing Plugin management scheme

In fact, we have solved the problem of lost code in the development of plugin through ci.sh script. Why do we need to develop this plug-in?

But this poses a very serious problem.

The version of the dependent library is not determined by pubspec.yaml, but by the subdirectory below this path, so the ci.sh script must be executed before going live.

If the dependency library wants to specify the version, it must go to ci.sh to change checkout to the script that specified the tag. If it does not change, it will directly cause the wrong version of the dependency library to be online.

Therefore, if there are more than one dependent library, we need to carefully review the CI script, which is a lot of work and unreliable to go online.

3. The flutter – dependency – manager

There are three items:

1. Use the Github schema specified by version number, which is usually a well-known third-party library and does not need to be modified.

2. Use the pattern specified by git URL, usually the component library or business module library developed by the company, which needs to be modified periodically.

3. The mode specified in the local path is a mode in component development, which can be coordinated and modified.

The plug-in provides two operations: 1. Download the Git URL mode to the local path for modification and coordination. 2. After the development is complete, upload it to Git, tag it, and change the local path mode to git URL mode.

Note that only the operations corresponding to the blue text are provided by this plug-in. You need to use git commands and tools to complete other operations.

After Git Clone, a workspace will be automatically established, which makes it very convenient to browse and modify the plug-in code. The interface is as follows.

Because there is no plugin or plugin directory on the baler, if there is any dependent library referenced by path, the package will fail directly, which can form a mandatory version check.

Vscode plug-in is now on the market, interested students can download and use it.