|
1 |
| -# 简单的使用说明 |
| 1 | +# README |
2 | 2 |
|
| 3 | +[English](https://github.com/AweiLoveAndroid/Flutter-learning/blob/master/code_plugins/readme.md)|[中文文档](https://github.com/AweiLoveAndroid/Flutter-learning/blob/master/code_plugins/README-CN.md) |
3 | 4 |
|
4 |
| -## ▶【提示:】更多详细的图文使用详细讲解,请看我的博客:[Flutter代码模板,解放双手,提高开发效率必备](https://www.jianshu.com/p/4184745d6983) |
| 5 | +--- |
5 | 6 |
|
6 |
| ----- |
| 7 | +> 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. |
7 | 8 |
|
8 |
| -### 一、对于AS或者IDEA用户来说,只需要下载settings.jar就可以了。点击`File`--> `Import Settings`,选择`settings.jar`导入。 |
| 9 | +### 1.Precautions |
9 | 10 |
|
10 |
| -> **注意事项:** |
| 11 | +* 1.Do not make any changes to the settings.jar file, otherwise please re-download the settings.jar flie. |
| 12 | +* 2.After importing, if the shortcut is not working, please check whether the code completions are correct in Android Studio or Intellij IDEA. |
11 | 13 |
|
12 |
| -``` |
13 |
| - 1.不要对该文件进行任何修改,如果改坏了导入不进去或者导入之后无法正常使用,请重新下载settings.jar就可以了。 |
14 |
| - 2.导入之后,如果发现快捷键无法正常使用,请看看你的AS或者IDEA的代码提示匹配设置是否正常。 |
15 |
| - |
16 |
| - 设置模糊匹配的步骤: |
17 |
| - 点击菜单栏File --> Settings --> Editor --> General --> Code Completion --> |
18 |
| - 在 Case sensitive completion 后面的选项改成NONE:进行模糊匹配。(First Letter:根据首字母进行匹配) |
19 |
| -``` |
20 |
| ----- |
21 | 14 |
|
22 |
| -### 二、对于VSCode用户来说,请下载`dart.json`文件,然后复制到`C:\Users\Administrator\AppData\Roaming\Code\User\snippets`目录里面即可,如已经存在,请替换就OK。 Mac用户,请复制到`/Library/Application Support/Code/User/snippets/`目录里面。 |
| 15 | +--- |
23 | 16 |
|
| 17 | +### 2.Set the fuzzy match: |
24 | 18 |
|
25 |
| ----- |
| 19 | +> old version |
| 20 | +Click menu bar `File → Settings → Editor → General → Code Completion → Case Sensitive Complete → NONE` |
26 | 21 |
|
27 |
| -更多精彩请打开微信搜索并关注公众号 `Flutter那些事`,或者扫描一下二维码关注公众号。 |
| 22 | + |
28 | 23 |
|
29 |
| - |
| 24 | +> new version |
| 25 | +
|
| 26 | +Click menu bar `File → Settings → Editor → General → Code Completion → Delete the check button in front of the Match cases` |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +### 3.How to import a project? |
| 33 | + |
| 34 | +> Import into Android Studio or Intellij IDEA |
| 35 | +
|
| 36 | +First open github [https://github.com/AweiLoveAndroid/Flutter-learning/blob/master/code_plugins/settings.jar](https://github.com/AweiLoveAndroid/Flutter-learning/blob/master/code_plugins/settings.jar) and download the settings.jar file. The jar flie can be placed in any English file path. |
| 37 | +Then, click the menu bar `File → Import Settings`, then find the `Settings.jar` that you had downloaded and import it. |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +Then select the `live template` and `live template (schemes)` and click the `OK` button. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +> Import into VSCode |
| 46 | +
|
| 47 | +For VSCode users, download the [https://github.com/AweiLoveAndroid/Flutter-learning/blob/master/code_plugins/dart.json](https://github.com/AweiLoveAndroid/Flutter-learning/blob/master/code_plugins/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. |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +4.Supported shortcuts |
| 52 | + |
| 53 | +Short keys|Description |
| 54 | +----|---- |
| 55 | +bab| Create AnimatedBuilder |
| 56 | +bu| Create Build() |
| 57 | +bufb| Create FutureBuilder |
| 58 | +bulb| Create LayoutBuilder |
| 59 | +buob| Create OrientationBuilder |
| 60 | +bustf| Create StatefulBuilder |
| 61 | +bustr| Create StreamBuilder |
| 62 | +cc| Create CustomClipper |
| 63 | +cen| Create Center |
| 64 | +col| Create Column |
| 65 | +con| Create full Container |
| 66 | +cp| Create your CustomPainter |
| 67 | +csv| CustomScrollView + SliverPadding and its child with padding. |
| 68 | +csv2| use CustomScrollView + SliverGrid |
| 69 | +gv| Create GridView.count |
| 70 | +inh| Create Inherited |
| 71 | +lv| Create normal ListView |
| 72 | +lvb| Create ListView.builder |
| 73 | +lvd |Create ListView with divider |
| 74 | +lvr| Create RadioListTile |
| 75 | +lvt| Create ListView with more ListTile |
| 76 | +mainstf |Create StatefulWidget |
| 77 | +mainstl| Create StatelessWidget |
| 78 | +me |Create methods |
| 79 | +mep| Create private methods |
| 80 | +row| Create Row |
| 81 | +sb |Create SizedBox |
| 82 | +ssv| Create SingleChildScrollView |
| 83 | +stanim| Create Stateful(with AnimationController) |
| 84 | +stf |Create full StatefulWidget with full lifecycle |
| 85 | +stl |Create StatelessWidget |
| 86 | +svc |Create CustomScrollView |
| 87 | +te| Create normal Text |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +5.Some shortcuts usage |
| 92 | + |
| 93 | +mainstf: |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | +mainstl: |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +stf: |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | +stl: |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | +gv: |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | +lv: |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +con: |
| 118 | + |
0 commit comments