Skip to content

Commit 4ad5471

Browse files
committed
AspectRatio (Flutter Widget of the Week)
1 parent 5fbafd9 commit 4ad5471

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ An Intellij & Android Studio plugin that adds Live Templates to your IDE saving
1212
| ---------- | ------------------------ | -------------- |
1313
|`alertDialog`|[View Docs](https://docs.flutter.io/flutter/widgets/AlertDialog-class.html)|Creates a showDialog that returns with AlertDialog|
1414
|`animBldr`|[View Docs](https://docs.flutter.io/flutter/widgets/AnimationBuilder-class.html)|Creates an AnimationBuilder|
15+
|`aspectRatio`|[View Docs](https://api.flutter.dev/flutter/widgets/AspectRatio-class.html)|Creates an AspectRatio|
1516
|`column`|[View Docs](https://docs.flutter.io/flutter/widgets/Column-class.html)|Creates a Column Widget|
1617
|`container`|[View Docs](https://docs.flutter.io/flutter/widgets/Container-class.html)|Creates a Container Widget|
1718
|`customClipper`|[View Docs](https://api.flutter.dev/flutter/rendering/CustomClipper-class.html)|Creates a CustomClipper|

resources/META-INF/plugin.xml

Lines changed: 6 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.7</version>
5+
<version>0.1.8</version>
66
<vendor>George Herbert</vendor>
77
<description><![CDATA[
88
<p>Provides live templates for Flutter to save time writing boilerplate.</p>
@@ -21,6 +21,10 @@ The following commands are supported:
2121
<td>Creates an AnimationBuilder</td>
2222
</tr>
2323
<tr>
24+
<td>aspectRatio</td>
25+
<td>Creates an AspectRatio</td>
26+
</tr>
27+
<tr>
2428
<td>column</td>
2529
<td>Creates a Column Widget</td>
2630
</tr>
@@ -101,7 +105,7 @@ The following commands are supported:
101105
<td>Creates a Text Widget</td>
102106
</tr>
103107
</table>]]></description>
104-
<change-notes>Some new minor widgets. Row, Column, Text and Container</change-notes>
108+
<change-notes>AspectRatio (Flutter Widget of the Week)</change-notes>
105109
<idea-version since-build="141.0" />
106110
<depends>com.intellij.modules.java</depends>
107111
<extensions defaultExtensionNs="com.intellij">

resources/liveTemplates/Flutter.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,13 @@
187187
<option name="DART_STATEMENT" value="true" />
188188
</context>
189189
</template>
190-
190+
191+
<!-- AspectRatio-->
192+
<template name="aspectRatio" value="AspectRatio(&#10;aspectRatio: $aspectRatio$,&#10;child: $child$&#10;)" description="New AspectRatio Widget" toReformat="false" toShortenFQNames="true">
193+
<variable name="aspectRatio" expression="$aspectRatio$" defaultValue="" alwaysStopAt="true" />
194+
<variable name="child" expression="$child$" defaultValue="" alwaysStopAt="true" />
195+
<context>
196+
<option name="DART_STATEMENT" value="true" />
197+
</context>
198+
</template>
191199
</templateSet>

0 commit comments

Comments
 (0)