Back to Flutter Learning

README

code_plugins/readme.md

latest5.5 KB
Original Source

README

English|中文文档


Some Friends who use Flutter have a question, whether Android Studio or Intellij IDEA, they are not many of the shortcuts .Some friends are using the VSCode, maybe you can find the plugin to use, but it is not helpful for you. When you write some codes that you use every day, you can't use the shortcut to generate the code you want. So I wrote the common Flutter code live templates, and then you can use it in Android Studio, Intellij IDEA and VSCode.

1.Precautions

  • 1.Do not make any changes to the settings.jar file, otherwise please re-download the settings.jar flie.
  • 2.After importing, if the shortcut is not working, please check whether the code completions are correct in Android Studio or Intellij IDEA.

2.Set the fuzzy match:

old version Click menu bar File → Settings → Editor → General → Code Completion → Case Sensitive Complete → NONE

new version

Click menu bar File → Settings → Editor → General → Code Completion → Delete the check button in front of the Match cases


3.How to import a project?

Import into Android Studio or Intellij IDEA

First open github https://github.com/AweiLoveAndroid/Flutter-learning/tree/master/code_plugins and download the settings.jar file. The jar flie can be placed in any English file path. Then, click the menu bar File → Import Settings, then find the settings.jar that you had downloaded and import it.

Then select the live template and live template (schemes) and click the OK button.

Import into VSCode

For VSCode users, download the dart.json file and copy it to C:\ Users\ Administrator \ AppData \ Roaming \ Code \ User \ Snippets \ directory (user is the username in the computer). If the file dart.json already exists, please replace it.


4.Supported shortcuts

Short keysDescription
babCreate AnimatedBuilder
buCreate Build()
bufbCreate FutureBuilder
bulbCreate LayoutBuilder
buobCreate OrientationBuilder
bustfCreate StatefulBuilder
bustrCreate StreamBuilder
ccCreate CustomClipper
cenCreate Center
colCreate Column
conCreate full Container
cpCreate your CustomPainter
csvCustomScrollView + SliverPadding and its child with padding.
csv2use CustomScrollView + SliverGrid
gvCreate GridView.count
inhCreate Inherited
lvCreate normal ListView
lvbCreate ListView.builder
lvdCreate ListView with divider
lvrCreate RadioListTile
lvtCreate ListView with more ListTile
mainstfCreate StatefulWidget
mainstlCreate StatelessWidget
meCreate methods
mepCreate private methods
rowCreate Row
sbCreate SizedBox
ssvCreate SingleChildScrollView
stanimCreate Stateful(with AnimationController)
stfCreate full StatefulWidget with full lifecycle
stlCreate StatelessWidget
svcCreate CustomScrollView
teCreate normal Text

5.Some shortcuts usage

mainstf:

mainstl:

stf:

stl:

gv:

lv:

con: