Usage Examples
You can create Stateless Widgets, Stateful Widgets, GetX App Structures, GetX Features, GetX Services, MobX Store, Classes and Interfaces by right clicking on any folder in the tree view and using the following options: WidgetsCreate Stateless Widget Example:To create a Stateless Widget, right-click on the folder where the widget will be created, choose Create Stateful Widget Example:To create a Stateful Widget, right-click on the folder where the widget will be created, choose GetXCreate GetX App Structure Example:
To create a GetX App Structure, right-click on the The folders that will be created by the command If you not will use some folder, just delete it from your project. Create GetX Feature Example:
To create a GetX resource that is composed of the You can create a folder to group GetX resources. In this case the name of the route file will be the name of the folder created, as we can see in the example below: Create GetX Service Example:
To create a GetX Service, right-click on the desired folder and choose MobXCreate MobX Store
To create a MobX Store, right-click on the desired folder and choose Interface for Providers, Repositories and ServicesCreate Provider Interface Example:Select the folder where the Provider Interface will be created and choose Create Repository Interface Example:Select the folder where the Repository Interface will be created and choose Create Service Interface Example:Select the folder where the Service Interface will be created and choose ClassesCreate Class Example:Select the folder where the class will be created and choose Create Controller Example:Select the folder where the controller will be created and choose Create DTO Example:Select the folder where the DTO will be created and choose Create Interface Example:Select the folder where the interface will be created and choose Create Model Example:Select the folder where the model will be created and choose Create Singleton Class Example:Select the folder where the model will be created and choose Code ActionsCode action Implements Interface:In interfaces files it is possible to use the code action Extra wrappersUse the code actions of Visual Studio Code to wrap a widget with one of the following wrappers:
Wrap with LayoutBuilderWrap with ExpandedWrap with StackWrap with PositionedWrap with AlignWrap with ClipRRectWrap with HeroWrap with GestureDetectorWrap with SingleChildScrollViewWrap with SafeAreaWrap with FormWrap with ObxIn case of use of Wrap with ObserverIn case of use of If wrap fails and breaks the code?In some widgets structures by positioning the cursor over the widget which will be surrounded by new widget may cause breaking the code. In this case, undo the last operation and select all the widget that will be wrapped using the shortcut SnippetsAll snippets are available through prefix Flutter and Dart
Widgets
GetX
Provider
Modular
Linter (analysis_options.yaml)
SettingsCreate Folder for InterfacesDefines if it will create a folder to contain the interface and implementation only for Create Implementation of InterfaceDefines whether the implementation class of an interface will be created together. GetX Display Context MenuDefines if the context menu with GetX features will be displayed. GetX Project PathDefault path for the GetX Project folders and files. GetX Use Constructor Tear-offsDefines if the Bindings and Routes files will use the new Dart language feature named Constructor tear-offs. GetX View SuffixDefault suffix name for the GetX view layer. MobX Display Context MenuDefines if the context menu with MobX features will be displayed. MobX File SuffixDefault suffix name for the MobX store. Use
|
Shortcut | Expanded | Description |
---|---|---|
sam-statelessW |
Stateless Widget | Creates a Stateless widget |
sam-statefulW |
Stateful Widget | Creates a Stateful widget |
sam-build |
Build Method | Describes the part of the user interface represented by the widget. |
sam-initS |
InitState | Called when this object is inserted into the tree. The framework will call this method exactly once for each State object it creates. |
sam-dis |
Dispose | Called when this object is removed from the tree permanently. The framework calls this method when this State object will never build again. |
sam-reassemble |
Reassemble | Called whenever the application is reassembled during debugging, for example during hot reload. |
sam-didChangeD |
didChangeDependencies | Called when a dependency of this State object changes |
sam-didUpdateW |
didUpdateWidget | Called whenever the widget configuration changes. |
sam-customClipper |
Custom Clipper | Used for creating custom shapes |
sam-customPainter |
Custom Painter | Used for creating custom paint |
sam-listViewB |
ListView.Builder | Creates 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. |
sam-listViewS |
ListView.Separated | Creates a fixed-length scrollable linear array of list 'items' separated by list item 'separators'. |
sam-gridViewB |
GridView.Builder | Creates 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. |
sam-gridViewC |
GridView.Count | Creates a scrollable, 2D array of widgets with a fixed number of tiles in the cross axis. |
sam-gridViewE |
GridView.Extent | Creates a scrollable, 2D array of widgets with tiles that each have a maximum cross-axis extent. |
sam-customScrollV |
Custom ScrollView | Creates a ScrollView that creates custom scroll effects using slivers. If the primary argument is true, the controller must be null. |
sam-streamBldr |
Stream Builder | Creates a new StreamBuilder that builds itself based on the latest snapshot of interaction with the specified stream |
sam-animatedBldr |
Animated Builder | Creates an Animated Builder. The widget specified to child is passed to the builder |
sam-statefulBldr |
Stateful Builder | Creates a widget that both has state and delegates its build to a callback. Useful for rebuilding specific sections of the widget tree. |
sam-orientationBldr |
Orientation Builder | Creates a builder which allows for the orientation of the device to be specified and referenced |
sam-layoutBldr |
Layout Builder | Similar to the Builder widget except that the framework calls the builder function at layout time and provides the parent widget's constraints. |
sam-singleChildSV |
Single Child Scroll View | Creates a scroll view with a single child |
sam-futureBldr |
Future Builder | Creates a Future Builder. This builds itself based on the latest snapshot of interaction with a Future. |
sam-nosm |
No Such Method | This method is invoked when a non-existent method or property is accessed. |
sam-inheritedW |
Inherited Widget | Class used to propagate information down the widget tree. |
sam-mounted |
Mounted | Whether this State object is currently in a tree. |
sam-snk |
Sink | A Sink is the input of a stream. |
sam-strm |
Stream | A source of asynchronous data events. A stream can be of any data type. |
sam-subj |
Subject | A BehaviorSubject is also a broadcast StreamController which returns an Observable rather than a Stream. |
sam-toStr |
To String | Returns a string representation of this object. |
sam-debugP |
Debug Print | Prints a message to the console, which you can access using the flutter tool's logs command (flutter logs). |
sam-importM |
Material Package | Import Material package. |
sam-importC |
Cupertino Package | Import Cupertino package. |
sam-importFT |
flutter_test Package | Import flutter_test package. |
sam-importAL |
App localisation | Allows for the importation of app_localisation following generation. |
sam-mateapp |
Material App | Create a new Material App. |
sam-cupeapp |
Cupertino Package | Create a New Cupertino App. |
sam-tweenAnimationBuilder |
Tween Animation Builder | Widget builder that animates a property of a Widget to a target value whenever the target value changes. |
sam-valueListenableBuilder |
Value Listenable Builder | Given 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. |
sam-f-group |
Group | Create a group test function. |
sam-f-test |
Test | Create a test function. |
sam-f-testWidgets |
Test Widgets | Create a testWidgets function. |
Flutter Snippets
Snippet | Widget | Description |
---|---|---|
sam-fscaf |
Scaffold Widget | Creates a Scaffold widget |
sam-fex |
Expanded Widget | Creates a Expanded widget |
sam-ftxt |
Text Widget | Creates a Text widget |
sam-fic |
Icon Widget | Creates a Icon widget |
sam-fcont |
Container Widget | Creates a Container widget |
sam-fcent |
Center Widget | Creates a Center widget |
sam-frow |
Row Widget | Creates a Row widget |
sam-fcol |
Column Widget | Creates a Column widget |
sam-fstk |
Stack Widget | Creates a Stack widget |
sam-falign |
Align Widget | Creates a Align widget |
sam-ftextbtn |
TextButton Widget | Creates a TextButton widget |
sam-fab |
FloatingActionButton Widget | Creates a FloatingActionButton widget |
sam-ficbtn |
IconButton Widget | Creates a IconButton widget |
sam-felevbtn |
RaisedButton Widget | Creates a RaisedButton widget |
sam-fgesdet |
GestureDetector Widget | Creates a GestureDetector widget |
sam-fink |
InkWell Widget | Creates a InkWell widget |
sam-fdrawer |
Drawer Widget | Creates a Drawer widget |
sam-fmeque |
MediaQuery Widget | Creates a MediaQuery widget |
sam-ftheme |
Theme Widget | Creates a Theme widget |
sam-flogo |
FlutterLogo Widget | Creates a FlutterLogo widget |
sam-fszb |
SizedBox Widget | Creates a SizedBox widget |
sam-fszbw |
SizedBox Widget with width | Creates a SizedBox widget with width |
sam-fszbh |
SizedBox Widget with height | Creates a SizedBox widget with height |
sam-flistv |
ListView Widget | Creates a ListView widget |
sam-fnav |
Navigation Widget | Creates the Navigation widget |
sam-fpop |
Navigator pop | Creates the Navigator pop function |
Import Snippets
Import | Package | Description |
---|---|---|
sam-impM |
material Package | Import Material package |
sam-impC |
cupertino Package | Import Cupertino package |
sam-impS |
services Package | Import Services package |
sam-impF |
foundation Package | Import Foundation package |
sam-impH |
http Package | Import HTTP package |
sam-impURL |
url_launcher Package | Import URL_Launcher package |
sam-impP |
provider Package | Import Provider package |
sam-impGF |
google_fonts Package | Import Google_Fonts package |
sam-impPP |
path_provider Package | Import Path_Provider package |
sam-impB |
flutter_bloc Package | Import Flutter_Bloc package |
sam-impGF |
sqflite Package | Import Sqflite package |
sam-impFS |
flutter_screenutil Package | Import Flutter_Screenutil package |
sam-impI |
intl Package | Import Intl package |
sam-impR |
riverpod Package | Import Riverpod package |
sam-impHooks |
flutter_hooks Package | Import Flutter_Hooks package |
Shortcut Snippets
Shortcut | Expanded | Description |
---|---|---|
sam-screen |
Scaffold with text | Creates a screen with text in center |
sam-devprev |
Device Preview | Creates a screen with the syntax of Device Preview Package |
sam-mateapp |
Material App | Creates a new screen with Material App |
sam-cupeapp |
Cupertino App | Creates a new screen with Cupertino App |
sam-build |
Build Method | Describes the part of the user interface represented by the widget. |
sam-customPainter |
Custom Painer | Creates custom painter |
sam-customClipper |
Custom Clippers | Creates custom clippers |
sam-initS |
InitState | Called when this object is inserted into the tree. The framework will call this method exactly once for each State object it creates. |
sam-dis |
Dispose | Called when this object is removed from the tree permanently. The framework calls this method when this State object will never build again. |
sam-caa |
CrossAxisAlignment | Creates CrossAxisAlignment |
sam-maa |
MainAxisAlignment | Creates MainAxisAlignment |
sam-appbar |
Custom AppBar widget | Creates Custom AppBar widget |
sam-fstyle |
Flutter TextStyle property | Creates Flutter TextStyle |
sam-defaultApp |
Default Counter App | Creates Default Counter App |
sam-fstring |
Flutter String snippet | Creates Flutter String snippet |
sam-fcolor |
Flutter Color snippet | Creates Flutter Color snippet |
sam-fequatable |
Flutter Equatable class snippet | Creates Equatable class snippet |
sam-fapptext |
Flutter AppText class snippet | Creates AppText class snippet for Strings used in app |
sam-fappimage |
Flutter AppImage class snippet | Creates AppImage class snippet for Image assets used in app |
sam-fappcolor |
Flutter AppColors class snippet | Creates AppColors class snippet for Color used in app |
Riverpod Snippets
Snippet | Expanded | Description |
---|---|---|
sam-stlessConsumer |
ConsumerStatelessWidget snippet | Create a Flutter ConsumerStatelessWidget snippet |
sam-stfulConsumer |
ConsumerStatefulWidget snippet | Creates Flutter ConsumerStatefulWidget snippet |
sam-changeNotifierProvider |
ChangeNotifierProvider snippet | Creates Flutter ChangeNotifierProvider snippet |
sam-changeNotifier |
ChangeNotifier snippet | Creates Flutter ChangeNotifier snippet |
sam-futureProvider |
FutureProvider snippet | Creates Flutter FutureProvider snippet |
sam-stlessHookConsumer |
HookConsumerWidget snippet | Creates Flutter HookConsumerWidget snippet |
sam-stfulHookConsumer |
StatefulHookConsumerWidget snippet | Creates Flutter StatefulHookConsumerWidget snippet |
sam-provider |
Provider snippet | Creates Flutter Provider snippet |
sam-stateNotifierProvider |
StateNotifierProvider snippet | Creates Flutter StateNotifierProvider snippet |
sam-stateNotifier |
StateNotifier snippet | Creates Flutter StateNotifier snippet |
sam-stateProvider |
StateProvider snippet | Creates Flutter StateProvider snippet |
sam-streamProvider |
StreamProvider snippet | Creates Flutter StreamProvider snippet |
Android Permission Snippets
Permission | Expanded | Description |
---|---|---|
sam-perInt |
INTERNET Permission | Android Internet permission |
Create New Flutter App | |
---|---|
Prefix | Description |
sam-newFlutterApp |
Initial Flutter App |
sam-newFlutterAppProvider |
Initial Flutter App With Provider |
sam-newFlutterAppGet |
Initial Flutter App With GetX |
Import Statement | |
---|---|
Prefix | Code |
sam-imm |
import 'package:flutter/material.dart'; |
sam-imc |
import 'package:flutter/cupertino.dart'; |
sam-imGet |
import 'package:get/get.dart'; |
sam-imProvider |
import 'package:provider/provider.dart'; |
Basic Widget Snippets | ||
---|---|---|
Prefix | Description | Code |
sam-container |
It will give Container Widgets | Container( child: Text("Container"), ) |
sam-row |
It will give Row Widgets | Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [], ) |
sam-col |
It will give Column Widgets | Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [], ) |
sam-text |
It will give Text Widget | Text( "Text", style: TextStyle(), ) |
sam-scsv |
It will give SingleChildScrollView Widget | SingleChildScrollView( child: Container(), ) |
sam-gd |
It will give GestureDetector Widget with onTap Method | GestureDetector( onTap: (){ }, child: Container(), ) |
sam-sb |
It will give SizedBox widget with width & height | SizedBox( height: 0, width: 0, child: Container(), ) |
sam-sbw |
It will give SizedBox widget with width only | SizedBox( width: 0, child: Container(), ) |
sam-sbh |
It will give SizedBox widget with height only | SizedBox( height: 0, child: Container(), ) |
sam-imgA |
It will give Image.asset() method with height & width | Image.asset( "assets/filename", width: 0, height: 0, ) |
sam-imgN |
It will give Image.network() method with height & width | Image.network( "URL", width: 0, height: 0, ) |
sam-imgF |
It will give Image.file() method with height & width | Image.network( fileObject, width: 0, height: 0, ) |
sam-navigatorPush |
It will give Navigator.push() with initial structure | Navigator.push( context, MaterialPageRoute( builder: (context) => MyHomePage(), ), ); |
sam-navigatorPop |
It will give a Navigator.pop() method | Navigator.pop(context); |
sam-navigatorPushName |
It will give Navigator.pushNamed method with initial parameter | Navigator.pushNamed(context, "/myHomePage"); |
Builders Widget Snippets | ||
---|---|---|
Prefix | Description | Code |
sam-lvBuild |
It will give a ListView.builder with initial properties | ListView.builder( itemCount: 0, shrinkWrap: true, scrollDirection: Axis.vertical, itemBuilder: (context, index) { return Text("ListView.builder"); }, ) |
sam-lvSeparated |
It will give a ListView.separated with initial properties | ListView.separated( itemCount: 0, shrinkWrap: true, itemBuilder: (context, index) { return Text("ListView.separated"); }, separatorBuilder: (context, index) { return Divider( height: 2, color: Colors.grey, ); }, ) |
sam-gvBuild |
It will give a GridView.builder with initial properties | GridView.builder( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3), itemCount: 0, shrinkWrap: true, itemBuilder: (context, index) { return Text("GridView.Builder"); }, ) |
sam-gvCount |
It will give a GridView.count with initial properties | GridView.count( crossAxisCount: 3, shrinkWrap: true, children: [ Text("Gridview.count"), ], ) |
sam-gvExtent |
It will give a GridView.extent with initial properties | GridView.extent( maxCrossAxisExtent: 100, shrinkWrap: true, children: [ Text("Gridview.extent"), ], ) |
sam-pvBuild |
It will give a PageView.builder with initial structure | PageView.builder( itemCount: 3, itemBuilder: (context, index) { return Container( margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10), decoration: BoxDecoration( color: Colors.purple, borderRadius: BorderRadius.circular(10), ), child: Text( "PageView", style: TextStyle(color: Colors.white), ), ); }, ) |
sam-streamBuild |
It will give a StreamBuilder with initial properties | StreamBuilder( stream: stream, initialData: initalData, builder: (BuildContext context, AsyncSnapshot snapshot) { return Text("Stream Builder"); }, ) |
sam-animatedBuild |
It will give a AnimatedBuilder with initial properties | AnimatedBuilder( animation: animation, child: child, builder: (context, child) { return Text("Animated Builder"); }, ) |
sam-layoutBuild |
It will give a LayoutBuilder with initial properties | LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { return Text("Layout Builder"); }, ) |
sam-futureBuild |
It will give a FutureBuilder with initial properties | FutureBuilder( future: future, initialData: initialData, builder: (context, snapshot) { return Text("Future Builder"); }, ) |
sam-tweenBuild |
It will give a TweenAnimationBuilder with initial properties | TweenAnimationBuilder( duration: const Duration(), tween: Tween(), builder: (BuildContext context, dynamic value, Widget? child) { return Text("Tween Animation Builder"); }, ), |
Advance Widget Snippets | ||
---|---|---|
Prefix | Description | Code |
sam-cClipper |
It will give a class that exetnds CustomClipper with override method | import 'package:flutter/cupertino.dart'; class NameClipper extends CustomClipper { @override Path getClip(Size size) { // TODO: implement getClip throw UnimplementedError(); } bool shouldReclip(covariant CustomClipper oldClipper) => false; } |
sam-cPainter |
It will give a class that exetnds CustomPainter with override method | import 'package:flutter/material.dart'; class namePainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { } @override bool shouldRepaint(namePainter oldDelegate) => false; @override bool shouldRebuildSemantics(namePainter oldDelegate) => false; } |
Margin & Padding Snippets | ||
---|---|---|
Prefix | Description | Code |
sam-padAll |
It will give a padding property with EdgeInsets.All() method with inital parameter | padding: EdgeInsets.all(8), |
sam-padLTRB |
It will give a padding property with EdgeInsets.fromLTRB() method with inital parameter | padding: EdgeInsets.fromLTRB(left, top, right, bottom), |
sam-padSym |
It will give a padding property with EdgeInsets.symmetric() method with inital parameter | padding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), |
sam-padOnly |
It will give a padding property with EdgeInsets.only() method | padding: EdgeInsets.only(), |
sam-marAll |
It will give a margin property with EdgeInsets.All() method with inital parameter | margin: EdgeInsets.all(8), |
sam-marLTRB |
It will give a margin property with EdgeInsets.fromLTRB() method with inital parameter | margin: EdgeInsets.fromLTRB(left, top, right, bottom), |
sam-marSym |
It will give a margin property with EdgeInsets.symmetric() method with inital parameter | margin: EdgeInsets.symmetric(horizontal: 0, vertical: 0), |
sam-marOnly |
It will give a margin property with EdgeInsets.only() method | margin: EdgeInsets.only(), |
Widget's Properties & Var Declaration Snippets | ||
---|---|---|
Prefix | Description | Code |
sam-width |
It will give width property with MediaQuery Width | width: MediaQuery.of(context).size.width, |
sam-height |
It will give height property with MediaQuery Width | height: MediaQuery.of(context).size.height, |
sam-brAll |
It will give borderRadius property with BorderRadius.all() method | borderRadius: BorderRadius.all(Radius.circular(10)), |
sam-brCircular |
It will give borderRadius property with BorderRadius.circular() method | borderRadius: BorderRadius.circular(10), |
sam-colorHax |
It will give color property with Color object initial argument | color: Color(0xFF9C27B0), |
sam-list | It will give a List with initial assignment | List listName = [ ]; |
Provider Snippets | ||
---|---|---|
Prefix | Description | Code |
sam-changeNotiFier |
It will give a class that extends ChangeNotifier with one demo variable | import 'package:flutter/material.dart'; class MySchedule extends ChangeNotifier { int _count = 0; int get count => _count; set count(int value) { _count = value; notifyListeners(); } } |
sam-consumer |
It will give Consumer widget with initial properties | Consumer( builder: (context, value, child) { return Text("Provider Consumer"); }, ) |
Get Snippets | ||
---|---|---|
Prefix | Description | Code |
sam-getController |
It will give a class that extends GetxController with one demo variable | import 'package:get/get.dart'; class NameController extends GetxController { var number = 0.obs; void changeValue(val) => number.value = val; } |
sam-getBinding |
It will give a class that extends Bindings with override method | import 'package:get/get.dart'; class HomeBindings extends Bindings { @override void dependencies() { Get.put(Controller1()); } } |
sam-getBuilder |
It will give GetBuilder widgets with initial properties | GetBuilder( init: Controller(), builder: (controller) { return Text("Get Builder"); }, ) |
sam-getX |
It will give GetX widgets with initial properties | GetX( init: Controller(), builder: (controller) { return Text("GetX"); }, ) |
sam-mixingBuilder |
It will give MixinBuilder widgets with initial properties | MixinBuilder( init: Controller(), builder: (controller) { return Text("Mixing Builder"); }, ) |
sam-gWidth |
It will give width property with Get Width | width: Get.size.width, |
sam-gHeight |
It will give height property with Get Width | height: Get.size.height, |
Flutter related snippets
Snippet | Description |
---|---|
sam-fstful |
StatefulWidget snippet. This is an alternative of stful |
sam-fstless |
StatelessWidget snippet. This is an alternative of stless |
sam-fscaff |
Scaffold widget snippet |
sam-fedgall |
EdgeInsets widget snippet with named constructor all |
sam-fedgonly |
EdgeInsets widget snippet with named constructor only |
sam-ftxt |
Text widget snippet |
sam-finitlf |
Flutter initState lifecycle method snippet |
sam-fic |
Flutter Icon widget snippet |
sam-fcont |
Flutter Container widget snippet |
sam-fcent |
Flutter Center widget snippet |
sam-frow |
Flutter Row widget snippet |
sam-fcol |
Flutter Column widget snippet |
sam-fex |
Expand widget snippet |
sam-fszbw |
SizedBox widget snippet with just width argument |
sam-fszbh |
SizedBox widget snippet with just height argument |
sam-fszb |
SizedBox widget with width and height arguments |
sam-fedgsym |
EdgeInsets widget with named constructor symmetric |
sam-fedgsymv |
EdgeInsets widget with named constructor symmetric with vertical parameter |
sam-fedgsymh |
EdgeInsets widget with named constructor symmetric with horizontal parameter |
sam-fimpmat |
Add material's package import statement |
sam-fstream |
Display a StreamBuilder widget |
sam-felbtn |
Flutter ElevatedButton snippet |
Dart related snippets
Snippet | Description |
---|---|
sam-dvar |
Dart variable declaration using var |
sam-dfinal |
Dart variable declaration using final |
sam-dconst |
Dart variable declaration using const |
sam-dinvar |
Dart Public Instance variable snippet |
sam-dprinvar |
Dart Private instance variable snippet |
sam-dmt |
Dart public method snippet |
sam-dprmt |
Dart private method snippet |
sam-darr |
Dart public arrow function snippet |
sam-dprarr |
Dart private arrow function snippet |
sam-dopnctor |
Dart optional named parameters constructor snippet |
sam-dlist |
Dart List collection snippet |
sam-dmap |
Dart Map collection snippet |
sam-dset |
Dart Set collection snippet |
sam-dgetarr |
Dart arrow function getter snippet |
sam-dimpas |
Dart import as snippet |
sam-dimpshow |
Dart import show snippet |
sam-dimplazy |
Dart import deffered as snippet |
sam-dimphide |
Dart import hide snippet |
sam-dexhide |
Dart export hide snippet |
sam-dexshow |
Dart export show snippet |
sam-dconvert |
Dart convert lib import snippet |
sam-dimpmeta |
Add meta package import statement |
sam-dan |
Add a Dart anonymous function |
sam-dcla |
Add Dart Class snippet |
sam-dclae |
Add Dart Class snippet with extends keyword |
Flutter Bloc pattern snippets
Snippet | Description |
---|---|
sam-fblocprov |
Flutter bloc provider snippet |
Features Wrap With |
---|
Wrap with LayoutBuilder |
Wrap with Builder |
Wrap with ValueListenableBuilder |
Wrap with Consumer |
Wrap with MobX Observer |
Wrap with Obx |
Wrap with Getx |
Menu Features:
Menu Features |
---|
Clean Arch.: New Feature Backend |
Clean Arch.: New Feature Flutter |
3-Tiers Back: New Feature |
Create Dart Interface |
Create Dart Class |
Create Stateless Widget |
Create Stateful Widget |
GetX: New Feature |
Flutter Modular: New Feature |
Dart Snippets Usage
Shortcut | Description |
---|---|
sam-freezed |
Creates a Freezed class |
sam-freezed-json-serializable |
Creates a Freezed with JsonSerializable |
sam-interface |
Creates a Interfaces |
sam-class-interface |
Creates a Classes with interface |
sam-callable-class |
Create a Callable Classes |
sam-d-test-init |
Create a dart tests |
sam-class |
Create class with file name |
sam-class-singleton |
Create a singleton class with file name |
sam-class-equatable |
Create class with file name and add Equatable |
sam-constructor |
Create constructor with file name based |
sam-private-constructor |
Create private constructor with file name based |
sam-static-attribute |
Create static atribute in class |
sam-seconds-delay |
Create Future.delayed in seconds |
sam-milliseconds-delay |
Create Future.delayed in milliseconds |
Flutter Snippets Usage
Shortcut | Description |
---|---|
sam-stl |
Create StatelessWidget with Scaffold and AppBar |
sam-stls |
Create StatelessWidget with super.key, Scaffold and AppBar |
sam-stf |
Create StatefulWidget with Scaffold and AppBar |
sam-stfs |
Create StatefulWidget with with super.key, Scaffold and AppBar |
sam-f-test-init |
Create a dart tests |
sam-change-notifier |
Create change notifier class |
sam-value-notifier |
Create ValueNotifier |
sam-text-editing-controller |
Create TextEditingController |
sam-separator |
Create SizedBox separator |
sam-form-key |
Create formKey GlobalKey |
sam-part |
Add a part based file name ex: home_controller -> (home_controller.g.dart |
sam-mediaquery |
Put MediaQuery.of |
sam-sw |
Get Screen size width from MediaQuery |
sam-sh |
Get Screen size height from MediaQuery |
sam-navigator |
Put Navigator.of(context). |
sam-snackbar |
Put ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('$1'))) |
Aqueduct Snippets Usage
Shortcut | Description |
---|---|
sam-aqu-operation |
Creates aqueduct operation |
sam-aqu-serializable |
Creates aqueduct class serializable |
Modular Snippets Usage
Shortcut | Description |
---|---|
sam-modular-router-child |
Creates router with page |
sam-modular-router |
Creates router module |
sam-modular-initial-router-module |
Creates router module with Modular.initialRoute |
sam-modular-initial-router-child |
Creates router page with Modular.initialRoute |
sam-modular-bind |
Create Bind for modular |
sam-modular_codegen_inject |
Modular codegen inject |
sam-modular_module |
Create Module |
Modular3 Snippets Usage
Shortcut | Description |
---|---|
sam-modular3-router-child |
Creates router with page |
sam-modular3-router |
Creates router module |
sam-modular3-initial-router-child |
Creates router page with Modular.initialRoute |
sam-modular3-bind-factory |
Create Bind Factory for modular |
sam-modular3-bind-instance |
Create Bind Instance for modular |
sam-modular3-bind-singleton |
Create Bind Singleton for modular |
sam-modular3-bind-lazySingleton |
Create Bind Lazy Singleton for modular with interface |
sam-modular3-bind-factory-interface |
Create Bind Factory for modular with interface |
sam-modular3-bind-instance-interface |
Create Bind Instance for modular with interface |
sam-modular3-bind-singleton-interface |
Create Bind Singleton for modular with interface |
sam-modular3-bind-lazySingleton-interface |
Create Bind Lazy Singleton for modular with interface |
sam-modular3_module |
Create Module |
Flutter Bloc Snippets Usage
Shortcut | Description |
---|---|
sam-bloctransform |
Override transformEvents method |
Cubit Snippets Usage
Shortcut | Description |
---|---|
sam-cubitot |
Override onTransition method |
sam-cubitaction |
Create cubit function action |
Mockito Snippets Usage
Shortcut | Description |
---|---|
sam-test-when-async |
Add when mockito async |
sam-test-when |
Add when mockito sync |
sam-test-when-throw |
Add when mockito sync |
sam-test-mock |
Create a mock class |
Flutter Provider Snippets Usage
Shortcut | Description |
---|---|
sam-provider-watch |
context.watch |
sam-provider-read |
context.watch |
sam-provider-select |
context.select |
Flutter GetX Snippets Usage
Shortcut | Description |
---|---|
sam-getxbinding |
Create Binding |
sam-getxcontroller |
Create Controller |
sam-getxrx |
Create Rx variable |
sam-getxobs |
Create .obs variable |
sam-getxoninit |
Create onInit method |
sam-getxonclose |
Create onClose method |
sam-getxpage |
Create Page with GetView |
Shelf/Shelf-Router Snippets Usage
Shortcut | Description |
---|---|
sam-shelf-controller |
Create Controller with shelf-router |
sam-shelf-operation |
Create Rest Operation |
Shortcuts
Import Package
Key press | Meaning |
---|---|
importM |
Material Package |
importC |
Cupertino Package |
Class
Key press | Meaning |
---|---|
resClass |
Responsive Class Code |
Builders
Key press | Meaning |
---|---|
listViewB |
ListView.Builder |
ListViewS |
ListView.Separated |
gridViewB |
GridView.Builder |
gridViewC |
GridView.Count |
gridViewE |
GridView.Extent |
streamB |
Stream Builder |
layoutB |
Layout Builder |
oriB |
Orientation Builder |
futureB |
Future Builder |
futureBLV |
Future Builder ListView |
futureBLVModel |
Future Builder with ListView Model |
Scroll Views
Key press | Meaning |
---|---|
customSV |
Custom ScrollView |
singleChildSV |
Single Child ScrollView |
Widgets
Key press | Meaning |
---|---|
stlW |
Stateless Widget |
stfW |
Stateful Widget |
Functions
Key press | Meaning |
---|---|
debugP |
Debug Print |
Methods
Key press | Meaning |
---|---|
buildM |
Build Method |
initS |
Init State Method |
dis |
Dispose Method |
alertDialog |
Alert Dialog Method |
Common Height
Key press | Meaning |
---|---|
smallHeight |
const SizedBox(height: 8.0) |
mediumHeight |
const SizedBox(height: 16.0) |
largeHeight |
const SizedBox(height: 24.0) |
largerHeight |
const SizedBox(height: 32.0) |
largestHeight |
const SizedBox(height: 40.0) |
Common Width
Key press | Meaning |
---|---|
smallWidth |
const SizedBox(width: 8.0) |
mediumWidth |
const SizedBox(width: 16.0) |
largeWidth |
const SizedBox(width: 24.0) |
largerWidth |
const SizedBox(width: 32.0) |
largestWidth |
const SizedBox(width: 40.0) |
Height
1xHeight
: 10 logical pixel Height.
Key press | Meaning |
---|---|
1xHeight |
const SizedBox(height: 10.0) |
2xHeight |
const SizedBox(height: 20.0) |
3xHeight |
const SizedBox(height: 30.0) |
4xHeight |
const SizedBox(height: 40.0) |
5xHeight |
const SizedBox(height: 50.0) |
6xHeight |
const SizedBox(height: 60.0) |
7xHeight |
const SizedBox(height: 70.0) |
8xHeight |
const SizedBox(height: 80.0) |
9xHeight |
const SizedBox(height: 90.0) |
10xHeight |
const SizedBox(height: 100.0) |
11xHeight |
const SizedBox(height: 110.0) |
12xHeight |
const SizedBox(height: 120.0) |
13xHeight |
const SizedBox(height: 130.0) |
14xHeight |
const SizedBox(height: 140.0) |
15xHeight |
const SizedBox(height: 150.0) |
16xHeight |
const SizedBox(height: 160.0) |
17xHeight |
const SizedBox(height: 170.0) |
18xHeight |
const SizedBox(height: 180.0) |
19xHeight |
const SizedBox(height: 190.0) |
20xHeight |
const SizedBox(height: 200.0) |
Width
1xWidth
: 10 logical pixel Width.
Key press | Meaning |
---|---|
1xWidth |
const SizedBox(width: 10.0) |
2xWidth |
const SizedBox(width: 20.0) |
3xWidth |
const SizedBox(width: 30.0) |
4xWidth |
const SizedBox(width: 40.0) |
5xWidth |
const SizedBox(width: 50.0) |
6xWidth |
const SizedBox(width: 60.0) |
7xWidth |
const SizedBox(width: 70.0) |
8xWidth |
const SizedBox(width: 80.0) |
9xWidth |
const SizedBox(width: 90.0) |
10xWidth |
const SizedBox(width: 100.0) |
11xWidth |
const SizedBox(width: 110.0) |
12xWidth |
const SizedBox(width: 120.0) |
13xWidth |
const SizedBox(width: 130.0) |
14xWidth |
const SizedBox(width: 140.0) |
15xWidth |
const SizedBox(width: 150.0) |
16xWidth |
const SizedBox(width: 160.0) |
17xWidth |
const SizedBox(width: 170.0) |
18xWidth |
const SizedBox(width: 180.0) |
19xWidth |
const SizedBox(width: 190.0) |
20xWidth |
const SizedBox(width: 200.0) |
Flutter
Dart
- Object Models
- Comments
- Object Model Testing
- json_serializable
- equatable
Shortcut | Description |
---|---|
jsonMethods | Creates factory fromJson and toJson to use with JsonSerializable. |
serializableObject | Creates JsonSerializable object class extending Equatable w/ fromJson, toJson and copyWith() method pre-defined. |
jsonMethodsWithComments | Create factory fromJson and toJson to use with JsonSerializable with comments. |
docTempl | Creates macro for the document template. |
macroComment | Creates class comment using macro. |
mock | Creates Mock for a class. Used in testing w/ Mocktail. |
whenThenAnswer | Creates when method followed by thenAnswer. Used in testing w/ Mocktail. |
whenThenThrow | Creates when method followed by thenThrow. Used in testing w/ Mocktail. |
whenThenReturn | Creates when method followed by thenReturn. Used in testing w/ Mocktail. |
fakeClass | Creates class extending Fake . Used in testing. |
fakeStateEvent | Creates class for Bloc/Cubit state, and Bloc event extending Fake . Used in testing. |
pageViewProvider | Page w/ View where Bloc is propagated down. Includes route. |
pageView | Page w/ View. Includes route. |
classProperty | Property of the class w/ comment. |
propertycomment | Comment w/ an example. |
emptyObject | Empty object for a model. |
objectModelTest | Creates test for an object model. |
materialPage | Creates Material page. |
materialRoute | Creates Material page route. |
fadeTransitionPage | Creates Material page w/ a fade transition. |
Flutter Provider Snippets
Flutter Provider Snippets is a collection of commonly used Flutter classes and methods used when you use provider. It increases your speed of development.
Shortcut | Description |
---|---|
providerOf |
Get the a specific Type from the context |
providerOfFalse |
Get the a specific Type from the context without listen changes |
consumer |
Create a consumer |
selector |
Create a selector with 1 property |
selector2 |
Create a selector with 2 properties |
selector3 |
Create a selector with 3 properties |
provider |
Create a provider |
changeNotifierProvider |
Create a changeNotifierProxyProvider with 1 dependency |
changeNotifierProxyProvider2 |
Create a changeNotifierProxyProvider with 2 dependencies |
changeNotifierProxyProvider3 |
Create a changeNotifierProxyProvider with 3 dependencies |
proxyProvider |
Create a proxyProvider with 1 dependency |
proxyProvider2 |
Create a proxyProvider with 2 dependencies |
proxyProvider3 |
Create a proxyProvider with 3 dependencies |