A set of helpful Flutter and Dart snippets for day to day Flutter development.
Simply Flutter set of snippets
I'm working hard to select all the day to day widgets, so wait for more!.
| Snippet | Description |
|---|---|
fstful |
StatefulWidget snippet. This is an alternative of stful |
fstless |
StatelessWidget snippet. This is an alternative of stless |
fscaff |
Scaffold widget snippet |
fedgall |
EdgeInsets widget snippet with named constructor all |
fedgonly |
EdgeInsets widget snippet with named constructor only |
ftxt |
Text widget snippet |
finitlf |
Flutter initState lifecycle method snippet |
fic |
Flutter Icon widget snippet |
fcont |
Flutter Container widget snippet |
fcent |
Flutter Center widget snippet |
frow |
Flutter Row widget snippet |
fcol |
Flutter Column widget snippet |
fex |
Expand widget snippet |
fszbw |
SizedBox widget snippet with just width argument |
fszbh |
SizedBox widget snippet with just height argument |
fszb |
SizedBox widget with width and height arguments |
fedgsym |
EdgeInsets widget with named constructor symmetric |
fedgsymv |
EdgeInsets widget with named constructor symmetric with vertical parameter |
fedgsymh |
EdgeInsets widget with named constructor symmetric with horizontal parameter |
fimpmat |
Add material's package import statement |
fstream |
Display a StreamBuilder widget |
felbtn |
Flutter ElevatedButton snippet |
| Snippet | Description |
|---|---|
dvar |
Dart variable declaration using var |
dfinal |
Dart variable declaration using final |
dconst |
Dart variable declaration using const |
dinvar |
Dart Public Instance variable snippet |
dprinvar |
Dart Private instance variable snippet |
dmt |
Dart public method snippet |
dprmt |
Dart private method snippet |
darr |
Dart public arrow function snippet |
dprarr |
Dart private arrow function snippet |
dopnctor |
Dart optional named parameters constructor snippet |
dlist |
Dart List collection snippet |
dmap |
Dart Map collection snippet |
dset |
Dart Set collection snippet |
dgetarr |
Dart arrow function getter snippet |
dimpas |
Dart import as snippet |
dimpshow |
Dart import show snippet |
dimplazy |
Dart import deffered as snippet |
dimphide |
Dart import hide snippet |
dexhide |
Dart export hide snippet |
dexshow |
Dart export show snippet |
dconvert |
Dart convert lib import snippet |
dimpmeta |
Add meta package import statement |
dan |
Add a Dart anonymous function |
dcla |
Add Dart Class snippet |
dclae |
Add Dart Class snippet with extends keyword |
| Snippet | Description |
|---|---|
fblocprov |
Flutter bloc provider snippet |
- Features
- put back
fstlessandfstfulbut this time these work differently, now the Widgets will be named base on the file name.- If you don't want this behavior you can use
stlessorstfulinstead.
- If you don't want this behavior you can use
- make semicolon optional for
fscaffsnippet. - prepend
constkeyword to some widgets to avoid linter warnings. - add
felbtnsnippet. - add
dclaDart Class snippet. - add
dclaeAdd Dart Class snippet with extends keyword.
- put back
- Breaking Changes
varondvarsnippet is now optional, you can choose to use a type instead, and the semicolon was removed.- this open the possibility to use
dvarfor parameter declaration.
- this open the possibility to use
- Features
- add
fblocprovbloc provider snippet. - add
dimpmeta, which add meta package import statement. - add Dart anonymous function -
dan. - remove from the Flutter related snippets
fstfulappandfstless.- use
stlessandstfulinstead, these come with the official Flutter extension.
- use
- add
- Features
- remove
fstfulappandfstlesssince DartCode extension already has them. - add
fimpmatsnippet that add material package import statement. - add
fstreamsnippet that display an StreamBuilder widget - replace body property value from
fscaffsnippet to a more generic value. - equal operator on
dfinalanddconstnow is optional - add
<Widget>generic type tofcolandfrowsnippets
- remove
- Features:
- add
dimpas,dimpshow,dimplazy,dimphideimport snippets. - add
dexhideanddexshowexport snippets. - add
dmtpublic method snippets. - add
convertlib import snippet. - add
dvar,dfinalanddconstvariable declaration snippets. - add
darranddprarrarrow function snippets.
- add
- Fixes:
- add the material package import to fstless snippet.
- Refactors:
- change the type of
dinvaranddprinvarto a more generic one (dynamic) and remove the initialization. - remove the semicolon to
dinvarsnippet to allow use case when we want to use it as a function parameter.
- change the type of
- Docs:
- organize the Flutter and the Dart snippets
- change the render header to description
- Features:
- add Dart
List,MapandSetcollection snippets - add Dart arrow function getter snippet
- add Dart
- Fixes
- Typos
- New snippets:
- fedgsym - EdgeInsets widget with named constructor
symmetric - fedgsymv - EdgeInsets widget with named constructor
symmetricwithverticalparameter - fedgsymh - EdgeInsets widget with named constructor
symmetricwithhorizontalparameter
- fedgsym - EdgeInsets widget with named constructor
- Special thanks to:
- Ajil Ooommen: Add fedgsym, fedgsymv, fedgsymh snippets.
- New Snippets:
- fex - Expand widget snippet
- fszbw - SizedBox widget snippet with just width argument
- fszbh - SizedBox widget snippet with just height argument
- fszb - SizedBox widget with width and height arguments
- fedgonly - EdgeInsets widget snippet with named constructor
only
- Renamed snippets:
- fedgeiallw -> fedgall
- froww -> frow
- fcolw -> fcol
- fcontw -> fcont
- fcentw -> fcent
- fwscaffoldw -> fscaff
- fstlessw -> fstless
- fstfulwapp -> fstfulapp
- ftxtw -> ftxt
- finitlfm -> finitlf
- ficw - fic
- Fixes:
- path of the gif image
Initial release
