Awesome Flutter Snippets: Code Faster with VS Code

Awesome Flutter Snippets is a collection of commonly used Flutter classes and methods. It increases your speed of development by eliminating most of the boilerplate code associated with creating a widget. Widgets such as StreamBuilder and SingleChildScrollView can be created by typing the shortcut streamBldr and singleChildSV respectively.
 

Features

  • Speeds up development
  • Eliminates boilerplate
  • Supports complex widgets (Eg: Custom Clipper and Custom Paint)


 

 

ShortcutExpandedDescription
statelessWStateless WidgetCreates a Stateless widget
statefulWStateful WidgetCreates a Stateful widget
buildBuild MethodDescribes the part of the user interface represented by the widget.
initSInitStateCalled when this object is inserted into the tree. The framework will call this method exactly once for each State object it creates.
disDisposeCalled when this object is removed from the tree permanently. The framework calls this method when this State object will never build again.
reassembleReassembleCalled whenever the application is reassembled during debugging, for example during hot reload.
didChangeDdidChangeDependenciesCalled when a dependency of this State object changes
didUpdateWdidUpdateWidgetCalled whenever the widget configuration changes.
customClipperCustom ClipperUsed for creating custom shapes
customPainterCustom PainterUsed for creating custom paint
listViewBListView.BuilderCreates a scrollable, linear array of widgets that are created on demand.Providing a non-null itemCount improves the ability of the ListView to estimate the maximum scroll extent.
listViewSListView.SeparatedCreates a fixed-length scrollable linear array of list 'items' separated by list item 'separators'.
gridViewBGridView.BuilderCreates a scrollable, 2D array of widgets that are created on demand. Providing a non-null itemCount improves the ability of the GridView to estimate the maximum scroll extent.
gridViewCGridView.CountCreates a scrollable, 2D array of widgets with a fixed number of tiles in the cross axis.
gridViewEGridView.ExtentCreates a scrollable, 2D array of widgets with tiles that each have a maximum cross-axis extent.
customScrollVCustom ScrollViewCreates a ScrollView that creates custom scroll effects using slivers. If the primary argument is true, the controller must be null.
streamBldrStream BuilderCreates a new StreamBuilder that builds itself based on the latest snapshot of interaction with the specified stream
animatedBldrAnimated BuilderCreates an Animated Builder. The widget specified to child is passed to the builder
statefulBldrStateful BuilderCreates a widget that both has state and delegates its build to a callback. Useful for rebuilding specific sections of the widget tree.
orientationBldrOrientation BuilderCreates a builder which allows for the orientation of the device to be specified and referenced
layoutBldrLayout BuilderSimilar to the Builder widget except that the framework calls the builder function at layout time and provides the parent widget's constraints.
singleChildSVSingle Child Scroll ViewCreates a scroll view with a single child
futureBldrFuture BuilderCreates a Future Builder. This builds itself based on the latest snapshot of interaction with a Future.
nosmNo Such MethodThis method is invoked when a non-existent method or property is accessed.
inheritedWInherited WidgetClass used to propagate information down the widget tree.
mountedMountedWhether this State object is currently in a tree.
snkSinkA Sink is the input of a stream.
strmStreamA source of asynchronous data events. A stream can be of any data type.
subjSubjectA BehaviorSubject is also a broadcast StreamController which returns an Observable rather than a Stream.
toStrTo StringReturns a string representation of this object.
debugPDebug PrintPrints a message to the console, which you can access using the flutter tool's logs command (flutter logs).
importMMaterial PackageImport Material package.
importCCupertino PackageImport Cupertino package.
importFTflutter_test PackageImport flutter_test package.
importALApp localisationAllows for the importation of app_localisation following generation.
mateappMaterial AppCreate a new Material App.
cupeappCupertino PackageCreate a New Cupertino App.
tweenAnimationBuilderTween Animation BuilderWidget builder that animates a property of a Widget to a target value whenever the target value changes.
valueListenableBuilderValue Listenable BuilderGiven a ValueListenable and a builder which builds widgets from concrete values of T, this class will automatically register itself as a listener of the ValueListenable and call the builder with updated values when the value changes.
f-groupGroupCreate a group test function.
f-testTestCreate a test function.
f-testWidgetsTest WidgetsCreate a testWidgets function.


 

Requirements

Vscode: 1.56.0

Known Issues

At this time, there are no known issues. If you discover a bug or would like to see a shortcut added, please create a pull request at our GitHub page.

Release Notes

4.0.0

  • Breaking: Change testWdigets to f-testWidgets to better align with function snippets
  • Support for group test function f-group
  • Support for app localisation import importAL
  • Support for Flutter 3
    • Migrate to super initialisers
    • Not on Flutter 3? The Flutter 2.xx branch is up to date and ready for you :)
  • Fixed Lint issue - Added const to applicable widgets

3.0.3

3.0.2

  • Removed trailing whitespaces (Thank you @leoshusar)
  • Make widgets default to Container only (Thank you @Ascenio)

3.0.1

  • Support for Listview.builder
  • Support for GridView.count
  • Support for GridView.extent

3.0.0

  • Update all widgets to null safety
  • Update engine to 1.56.0

2.0.4

2.0.3

2.0.2

  • Resolved issue #6

2.0.1

  • Removed Stateful and Statless Widget since they are included with DartCode.
  • Added Material App.
  • Added Cupertino App.

2.0.0

  • Changed prefixes to use a keyword associated with the widget/function (in camel case)
  • Bug fixes

1.0.6

  • Added support for debug print
  • Added support for to string
  • Added support for importing Cupertino package
  • Added support for importing Material package (PR #2)
  • Added child logic to Stateless and Stateful widgets snippets (PR #3)

1.0.5

Critical bug fixes: - Adjusted tab stops to improve efficiency and workflow - Removed blank Containers from builders in favor of a tab stop with semi-colon - Added trailing comma at the end of child parameter

1.0.4

  • Fixed formatting
  • Removed unused tabs
  • Corrected spelling errors

1.0.3

Added support for: - Stream - Sink - Inherited Widget - Mounted - NoSuchMethod

1.0.2

Added support for: - Stateful Builder - Orientation Builder - Layout Builder - Single Child Scroll View - Future Builder

1.0.1

Added support for: - Stream Builder - Animated Builder - Custom Scroll View - Listview.Builder

1.0.0

Initial release of Awesome Flutter Snippets


Download details:

Author: Nash0x7E2
Source: https://github.com/Nash0x7E2/awesome-flutter-snippets

License: Apache-2.0 license

#flutter #dart #vscode 

Awesome Flutter Snippets: Code Faster with VS Code
1.25 GEEK