Skip to content

0.1.5 - Add customPainter and customClipper #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ An Intellij & Android Studio plugin that adds Live Templates to your IDE saving
| ---------- | ------------------------ | -------------- |
|`alertDialog`|[View Docs](https://docs.flutter.io/flutter/widgets/AlertDialog-class.html)|Creates a showDialog that returns with AlertDialog|
|`animBldr`|[View Docs](https://docs.flutter.io/flutter/widgets/AnimationBuilder-class.html)|Creates an AnimationBuilder|
|`customClipper`|[View Docs](https://api.flutter.dev/flutter/rendering/CustomClipper-class.html)|Creates a CustomClipper|
|`customPainter`|[View Docs](https://api.flutter.dev/flutter/rendering/CustomPainter-class.html)|Creates a CustomPainter|
|`customScrollV`|[View Docs](https://api.flutter.dev/flutter/widgets/CustomScrollView-class.html)|Creates a CustomScrollView|
|`futureBldr`|[View Docs](https://docs.flutter.io/flutter/widgets/FutureBuilder-class.html)|Creates a FutureBuilder|
|`importMat`|[View Docs](https://api.flutter.dev/flutter/material/material-library.html)|Adds Material Import|
Expand Down
12 changes: 10 additions & 2 deletions resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<idea-plugin>
<id>com.herbert.george.flutter-snippets</id>
<name>Flutter Snippets</name>
<version>0.1.4</version>
<version>0.1.5</version>
<vendor>George Herbert</vendor>
<description><![CDATA[
<p>Provides live templates for Flutter to save time writing boilerplate.</p>
Expand All @@ -19,6 +19,14 @@ The following commands are supported:
<tr>
<td>animBldr</td>
<td>Creates an AnimationBuilder</td>
</tr>
<tr>
<td>customClipper</td>
<td>Creates a CustomClipper</td>
</tr>
<tr>
<td>customPainter</td>
<td>Creates a CustomPainter</td>
</tr>
<tr>
<td>customScrollV</td>
Expand Down Expand Up @@ -77,7 +85,7 @@ The following commands are supported:
<td>Creates a StatefulBuilder</td>
</tr>
</table>]]></description>
<change-notes>Add support for stfulBldr (StatefulBuilder), orienatatBldr (OrientationBuilder) and import shortcuts for Material (importMat) and Cupertino (importCup)</change-notes>
<change-notes>Add support for customClipper and customPainter</change-notes>
<idea-version since-build="141.0" />
<depends>com.intellij.modules.java</depends>
<extensions defaultExtensionNs="com.intellij">
Expand Down
19 changes: 17 additions & 2 deletions resources/liveTemplates/Flutter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,31 @@
<option name="DART_STATEMENT" value="true" />
</context>
</template>
<!-- Add Material Package Import-->
<!-- Material Package Import-->
<template name="importMat" value="import 'package:flutter/material.dart';" description="Import Material Package" toReformat="false" toShortenFQNames="true">
<context>
<option name="DART_TOPLEVEL" value="true" />
</context>
</template>
<!-- Add Cupertino Package Import-->
<!-- Cupertino Package Import-->
<template name="importCup" value="import 'package:flutter/cupertino.dart';" description="Import Cupertino Package" toReformat="false" toShortenFQNames="true">
<context>
<option name="DART_TOPLEVEL" value="true" />
</context>
</template>
<!-- CustomClipper-->
<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">
<variable name="name" expression="&quot;name&quot;" defaultValue="" alwaysStopAt="true" />
<context>
<option name="DART_TOPLEVEL" value="true" />
</context>
</template>
<!-- CustomPainter-->
<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">
<variable name="name" expression="&quot;name&quot;" defaultValue="" alwaysStopAt="true" />
<context>
<option name="DART_TOPLEVEL" value="true" />
</context>
</template>

</templateSet>