Copyright notice: This article is the blogger’s original article, shall not be reproduced without the permission of the blogger. Juejin. Cn/post / 684490…

Reprint please indicate the source: juejin.cn/post/684490… This post is from AWeiLoveAndroid’s blog

Some friends may be using VSCode. There are two plug-ins for Flutter. I have tried them both, but they do not work well and do not have good scalability. Therefore, I wrote some common Flutter code templates myself, which can be directly used by importing AS or IDEA.

This article is published on Github.Github.com/AweiLoveAnd…


1. Instructions for use

  • 1. Don’tsettings.jarIf you want to make any changes to the file, if it’s too bad to import or if it doesn’t work properly after the import, please download settings.jar again.
  • 2. If you find that the shortcut keys cannot be used properly after import, please check whether the matching Settings of your AS or IDEA code are normal.

Steps to set up fuzzy matching:

Click the menu bar File –> Settings –> Editor –> General –> Code Completion –> Change the option after Case Sensitive Completion to NONE to blur the match. (First Letter: Match by First Letter)

If it is the latest version of AS or IDEA, there may be changes, just remove the check box in front of Match Cases. As shown below:


Two, import method

(1) Import AS or IDEA users

First go to github at github.com/AweiLoveAnd… Download the JAR package.

Then, click on the menu bar File–> Import Settings, find the Settings. Jar you just downloaded and Import it.

(2) VSCode user import

For VSCode Users, download the dart.json file and copy it to C:\Users\Administrator\AppData\Roaming\Code\User\snippets directory (Users is the User name of your computer). Please replace it.


3. Supported shortcut keys are as follows:

shortcuts describe
con Create a complete Container
cp Custom CustomPainter
csv CustomScrollView + SliverPadding creates a list of child controls with margins
csv2 Create the list using CustomScrollView + SliverGrid
gv Create the GridView. Count
lv Create a basic ListView
lvb Create a ListView. Builder
lvd Create a ListView with a split line
lvr RadioListTile create RadioListTile, you can select items
lvt Create a ListView with various listtiles
mainstf Create the StatefulWidget control
mainstl Create the StatelessWidget control
me Create method
mep Creating a private method
row Create a Row
sb Create SizedBox
ssv Create SingleChildScrollView
stf Create a complete StatefulWidget with life-cycle related methods.
stl Create StatelessWidget
svc Create CustomScrollView
te Create a standard Text

Four, part of the use of the diagram (AS AS a demonstration)

Mainstf creates the StatefulWidget control:


Mainstl creates the StatelessWidget control:


The STF creates a complete StatefulWidget that contains life-cycle related methods. :


STL creates StatelessWidget:


Gv create gridView.count:


Lv creates a basic ListView:


Con creates a complete Container:


Five, about the use of code templates and custom ways can see my GithubAndroid Studio common template usage and custom templates