Skip to content

Commit 8e17148

Browse files
authored
0.1.5 - Add customPainter and customClipper (#3)
1 parent 23cc803 commit 8e17148

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ An Intellij & Android Studio plugin that adds Live Templates to your IDE saving
77
| ---------- | ------------------------ | -------------- |
88
|`alertDialog`|[View Docs](https://docs.flutter.io/flutter/widgets/AlertDialog-class.html)|Creates a showDialog that returns with AlertDialog|
99
|`animBldr`|[View Docs](https://docs.flutter.io/flutter/widgets/AnimationBuilder-class.html)|Creates an AnimationBuilder|
10+
|`customClipper`|[View Docs](https://api.flutter.dev/flutter/rendering/CustomClipper-class.html)|Creates a CustomClipper|
11+
|`customPainter`|[View Docs](https://api.flutter.dev/flutter/rendering/CustomPainter-class.html)|Creates a CustomPainter|
1012
|`customScrollV`|[View Docs](https://api.flutter.dev/flutter/widgets/CustomScrollView-class.html)|Creates a CustomScrollView|
1113
|`futureBldr`|[View Docs](https://docs.flutter.io/flutter/widgets/FutureBuilder-class.html)|Creates a FutureBuilder|
1214
|`importMat`|[View Docs](https://api.flutter.dev/flutter/material/material-library.html)|Adds Material Import|

resources/META-INF/plugin.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<idea-plugin>
33
<id>com.herbert.george.flutter-snippets</id>
44
<name>Flutter Snippets</name>
5-
<version>0.1.4</version>
5+
<version>0.1.5</version>
66
<vendor>George Herbert</vendor>
77
<description><![CDATA[
88
<p>Provides live templates for Flutter to save time writing boilerplate.</p>
@@ -19,6 +19,14 @@ The following commands are supported:
1919
<tr>
2020
<td>animBldr</td>
2121
<td>Creates an AnimationBuilder</td>
22+
</tr>
23+
<tr>
24+
<td>customClipper</td>
25+
<td>Creates a CustomClipper</td>
26+
</tr>
27+
<tr>
28+
<td>customPainter</td>
29+
<td>Creates a CustomPainter</td>
2230
</tr>
2331
<tr>
2432
<td>customScrollV</td>
@@ -77,7 +85,7 @@ The following commands are supported:
7785
<td>Creates a StatefulBuilder</td>
7886
</tr>
7987
</table>]]></description>
80-
<change-notes>Add support for stfulBldr (StatefulBuilder), orienatatBldr (OrientationBuilder) and import shortcuts for Material (importMat) and Cupertino (importCup)</change-notes>
88+
<change-notes>Add support for customClipper and customPainter</change-notes>
8189
<idea-version since-build="141.0" />
8290
<depends>com.intellij.modules.java</depends>
8391
<extensions defaultExtensionNs="com.intellij">

resources/liveTemplates/Flutter.xml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,31 @@
125125
<option name="DART_STATEMENT" value="true" />
126126
</context>
127127
</template>
128-
<!-- Add Material Package Import-->
128+
<!-- Material Package Import-->
129129
<template name="importMat" value="import 'package:flutter/material.dart';" description="Import Material Package" toReformat="false" toShortenFQNames="true">
130130
<context>
131131
<option name="DART_TOPLEVEL" value="true" />
132132
</context>
133133
</template>
134-
<!-- Add Cupertino Package Import-->
134+
<!-- Cupertino Package Import-->
135135
<template name="importCup" value="import 'package:flutter/cupertino.dart';" description="Import Cupertino Package" toReformat="false" toShortenFQNames="true">
136136
<context>
137137
<option name="DART_TOPLEVEL" value="true" />
138138
</context>
139139
</template>
140+
<!-- CustomClipper-->
141+
<template name="customClipper" value="class $name$Clipper extends CustomClipper&lt;Path&gt; {&#10; &#10;@override&#10;Path getClip(Size size) {&#10;// TODO: implement getClip&#10;}&#10;&#10;@override&#10;bool shouldReclip(CustomClipper&lt;Path&gt; oldClipper) {&#10;// TODO: implement shouldReclip&#10;}&#10;}" description="Create CustomClipper" toReformat="false" toShortenFQNames="true">
142+
<variable name="name" expression="&quot;name&quot;" defaultValue="" alwaysStopAt="true" />
143+
<context>
144+
<option name="DART_TOPLEVEL" value="true" />
145+
</context>
146+
</template>
147+
<!-- CustomPainter-->
148+
<template name="customPainter" value="class $name$Painter extends CustomPainter {&#10;&#10;@override&#10;void paint(Canvas canvas, Size size) {&#10;//TODO Implement paint&#10;}&#10;&#10; @override&#10;bool shouldRepaint($name$Painter oldDelegate) {&#10;//TODO Implement shouldRepaint&#10;}&#10;&#10;@override&#10;bool shouldRebuildSemantics($name$Painter oldDelegate) {&#10;//TODO Implement shouldRebuildSemantics&#10;}&#10;}" description="Create CustomPainter" toReformat="false" toShortenFQNames="true">
149+
<variable name="name" expression="&quot;name&quot;" defaultValue="" alwaysStopAt="true" />
150+
<context>
151+
<option name="DART_TOPLEVEL" value="true" />
152+
</context>
153+
</template>
154+
140155
</templateSet>

0 commit comments

Comments
 (0)