Skip to content

Commit 23cc803

Browse files
authored
0.1.4 (#2)
* Add stfulBldr * Add orientatBlrd * Add importMat and importCup * Updarte docs links for importMat and importCup
1 parent c52e29c commit 23cc803

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ An Intellij & Android Studio plugin that adds Live Templates to your IDE saving
99
|`animBldr`|[View Docs](https://docs.flutter.io/flutter/widgets/AnimationBuilder-class.html)|Creates an AnimationBuilder|
1010
|`customScrollV`|[View Docs](https://api.flutter.dev/flutter/widgets/CustomScrollView-class.html)|Creates a CustomScrollView|
1111
|`futureBldr`|[View Docs](https://docs.flutter.io/flutter/widgets/FutureBuilder-class.html)|Creates a FutureBuilder|
12+
|`importMat`|[View Docs](https://api.flutter.dev/flutter/material/material-library.html)|Adds Material Import|
13+
|`importCup`|[View Docs](https://api.flutter.dev/flutter/cupertino/cupertino-library.html)|Adds Cupertino Import|
1214
|`layoutBldr`|[View Docs](https://api.flutter.dev/flutter/widgets/LayoutBuilder-class.html)|Creates a LayoutBuilder|
1315
|`listViewBldr`|[View Docs](https://docs.flutter.io/flutter/widgets/ListView.builder.html)|Creates a ListView.builder()|
16+
|`orienatatBldr`|[View Docs](https://api.flutter.dev/flutter/widgets/OrientationBuilder-class.html)|Creates a OrientationBuilder|
1417
|`scfAll`|[View Docs](https://docs.flutter.io/flutter/material/Scaffold-class.html)|Creates a Scaffold containing an Appbar, BottomNavigationBar and FloatingActionButton|
1518
|`scfAppBar`| |Creates a Scaffold containing an Appbar|
1619
|`scfAppBarFab`| |Creates a Scaffold containing an Appbar and Floating Action Button|
1720
|`scfAppBarBtmNav`| |Creates a Scaffold containing an Appbar and Bottom Navigation Bar|
1821
|`singleChildScrollV`|[View Docs](https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html)|Creates a SingleChildScrollView|
1922
|`streamBldr`|[View Docs](https://docs.flutter.io/flutter/widgets/StreamBuilder-class.html)|Creates a StreamBuilder|
23+
|`stfulBldr`|[View Docs](https://api.flutter.dev/flutter/widgets/StatefulBuilder/StatefulBuilder.html)|Creates a StatefulBuilder|
2024

2125
## Plugin Supports the Following IDEs:
2226
* Android Studio

resources/META-INF/plugin.xml

Lines changed: 18 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.3</version>
5+
<version>0.1.4</version>
66
<vendor>George Herbert</vendor>
77
<description><![CDATA[
88
<p>Provides live templates for Flutter to save time writing boilerplate.</p>
@@ -35,6 +35,18 @@ The following commands are supported:
3535
<tr>
3636
<td>listViewBldr</td>
3737
<td>Creates a ListView.builder()</td>
38+
</tr>
39+
<tr>
40+
<td>importMat</td>
41+
<td>Adds Material Import</td>
42+
</tr>
43+
<tr>
44+
<td>importCup</td>
45+
<td>Adds Cupertino Import</td>
46+
</tr>
47+
<tr>
48+
<td>orientatBldr</td>
49+
<td>Creates a ListView.builder()</td>
3850
</tr>
3951
<tr>
4052
<td>scfAll</td>
@@ -60,8 +72,12 @@ The following commands are supported:
6072
<td>streamBldr</td>
6173
<td>Creates a StreamBuilder</td>
6274
</tr>
75+
<tr>
76+
<td>stfulBldr</td>
77+
<td>Creates a StatefulBuilder</td>
78+
</tr>
6379
</table>]]></description>
64-
<change-notes>Add support for customScrollV (CustomScrollView), layoutBldr (LayoutBuilder) and singleChildScrollV (SingleChildScrollView)</change-notes>
80+
<change-notes>Add support for stfulBldr (StatefulBuilder), orienatatBldr (OrientationBuilder) and import shortcuts for Material (importMat) and Cupertino (importCup)</change-notes>
6581
<idea-version since-build="141.0" />
6682
<depends>com.intellij.modules.java</depends>
6783
<extensions defaultExtensionNs="com.intellij">

resources/liveTemplates/Flutter.xml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,37 @@
104104
</context>
105105
</template>
106106
<!-- New Scaffold with AppBar and Bottom Nav Bar-->
107-
<template name="scfAppBarBtmNav" value="int _index = 0; // Make sure this is outside build(), otherwise every setState will chage the value back to 0 &#10;&#10;return Scaffold(&#10;appBar: AppBar(&#10;title: Text('$appbarTitle$'),&#10;),&#10;body: Center(&#10;child: Container(child: Text('You are looking at the message for bottom navigation item $_index')),&#10;),&#10;bottomNavigationBar: BottomNavigationBar(&#10;onTap: (tappedItemIndex) =&gt; setState(() {&#10;_index = tappedItemIndex;&#10; }),&#10;currentIndex: _index,&#10;items: [&#10;BottomNavigationBarItem(icon: Icon(Icons.av_timer), title: Text('$navBarItem1Text$')),&#10;BottomNavigationBarItem(icon: Icon(Icons.add), title: Text('$navBarItem2Text$'))&#10;])&#10;);" description="New Scaffold with AppBar &amp; Bottom Nav Bar" toReformat="false" toShortenFQNames="true">
107+
<template name="scfAppBarBtmNav" value="int _index = 0; // Make sure this is outside build(), otherwise every setState will change the value back to 0 &#10;&#10;return Scaffold(&#10;appBar: AppBar(&#10;title: Text('$appbarTitle$'),&#10;),&#10;body: Center(&#10;child: Container(child: Text('You are looking at the message for bottom navigation item $_index')),&#10;),&#10;bottomNavigationBar: BottomNavigationBar(&#10;onTap: (tappedItemIndex) =&gt; setState(() {&#10;_index = tappedItemIndex;&#10; }),&#10;currentIndex: _index,&#10;items: [&#10;BottomNavigationBarItem(icon: Icon(Icons.av_timer), title: Text('$navBarItem1Text$')),&#10;BottomNavigationBarItem(icon: Icon(Icons.add), title: Text('$navBarItem2Text$'))&#10;])&#10;);" description="New Scaffold with AppBar &amp; Bottom Nav Bar" toReformat="false" toShortenFQNames="true">
108108
<variable name="appbarTitle" expression="&quot;appbarTitle&quot;" defaultValue="" alwaysStopAt="true" />
109109
<variable name="navBarItem1Text" expression="&quot;navBarItem1Text&quot;" defaultValue="" alwaysStopAt="true" />
110110
<variable name="navBarItem2Text" expression="&quot;navBarItem2Text&quot;" defaultValue="" alwaysStopAt="true" />
111111
<context>
112112
<option name="DART_STATEMENT" value="true" />
113113
</context>
114114
</template>
115+
<!-- StatefulBuilder-->
116+
<template name="stfulBldr" value="StatefulBuilder(&#10;builder: (BuildContext context, StateSetter setState){&#10;return $widget$&#10;}&#10;)," description="New Stateful Builder" toReformat="false" toShortenFQNames="true">
117+
<variable name="widget" expression="&quot;widget&quot;" defaultValue="" alwaysStopAt="true" />
118+
<context>
119+
<option name="DART_STATEMENT" value="true" />
120+
</context>
121+
</template>
122+
<!-- OrientationBuilder-->
123+
<template name="orientatBldr" value="OrientationBuilder(&#10; builder: (BuildContext context, Orientation orientation) {&#10;return GridView.count(&#10;// Create a grid with 2 columns in portrait mode, or 3 columns in&#10;// landscape mode.&#10;crossAxisCount: orientation == Orientation.portrait ? 2 : 3,&#10;);&#10;},&#10;);" description="New OrientationBuilder" toReformat="false" toShortenFQNames="true">
124+
<context>
125+
<option name="DART_STATEMENT" value="true" />
126+
</context>
127+
</template>
128+
<!-- Add Material Package Import-->
129+
<template name="importMat" value="import 'package:flutter/material.dart';" description="Import Material Package" toReformat="false" toShortenFQNames="true">
130+
<context>
131+
<option name="DART_TOPLEVEL" value="true" />
132+
</context>
133+
</template>
134+
<!-- Add Cupertino Package Import-->
135+
<template name="importCup" value="import 'package:flutter/cupertino.dart';" description="Import Cupertino Package" toReformat="false" toShortenFQNames="true">
136+
<context>
137+
<option name="DART_TOPLEVEL" value="true" />
138+
</context>
139+
</template>
115140
</templateSet>

0 commit comments

Comments
 (0)