Skip to content

Flutter Ace Snippet is a collection of the best snippets for flutter devs. It supports Provider and GetX as well.

License

Notifications You must be signed in to change notification settings

KunjKanani/flutter-ace-snippet

Repository files navigation

Flutter Ace Snippet

Flutter Ace Snippet is a collection of the best snippets for flutter devs. Once you use it, fall in love with Flutter Ace. We Developed Easiest & Best snippets available in the market. It supports Provider and GetX as well.


CODE SMARTLY TO MAKE YOUR LIFE EASY


Features

  • Write code with 10X speed
  • It is Easiest & Best snippets available in the market.
  • Required parameter will autocomplete
  • Supports complex widgets (Eg. PageView.builder, CustomPainter and Controllers for Getx & Provider)
  • Proper tabs positions for speed up coding

Snippets

  • We have huge amount of snippets for flutter.
  • We divide our all snippents in category, Given below
    1. Create New Flutter App (Eg. newFlutterApp, newFlutterAppProvider)
    2. Import Statement (Eg. material package)
    3. Basic Widget Snippets (Eg. Container, Row, Column)
    4. Builders Widget Snippets (Eg. GridView.builder, PageView.builder)
    5. Advance Widget Snippets (Eg. CustomClipper, CustomPainter)
    6. Margin & Padding Snippets (Eg. EdgeInsets.method())
    7. Widget's Properties & Var Declaration Snippets (Eg. height, width, List<E>)
    8. Provider Snippets (Eg. Consumer, ChangeNotifier Controller)
    9. Getx Snippents (Eg. GetXController, Bindings)

Create New Flutter App
Prefix Description
newFlutterApp Initial Flutter App
newFlutterAppProvider Initial Flutter App With Provider
newFlutterAppGet Initial Flutter App With GetX
Import Statement
Prefix Code
imm import 'package:flutter/material.dart';
imc import 'package:flutter/cupertino.dart';
imGet import 'package:get/get.dart';
imProvider import 'package:provider/provider.dart';
Basic Widget Snippets
Prefix Description Code
container It will give Container Widgets Container(
  child: Text("Container"),
)
row It will give Row Widgets Row(
 crossAxisAlignment: CrossAxisAlignment.center,
 mainAxisAlignment: MainAxisAlignment.start,
 children: [],
)
col It will give Column Widgets Column(
 crossAxisAlignment: CrossAxisAlignment.center,
 mainAxisAlignment: MainAxisAlignment.start,
 children: [],
)
text It will give Text Widget Text(
 "Text",
 style: TextStyle(),
)
scsv It will give SingleChildScrollView Widget SingleChildScrollView(
 child: Container(),
)
gd It will give GestureDetector Widget with onTap Method GestureDetector(
 onTap: (){
 
 },
 child: Container(),
)
sb It will give SizedBox widget with width & height SizedBox(
 height: 0,
 width: 0,
 child: Container(),
)
sbw It will give SizedBox widget with width only SizedBox(
 width: 0,
 child: Container(),
)
sbh It will give SizedBox widget with height only SizedBox(
 height: 0,
 child: Container(),
)
imgA It will give Image.asset() method with height & width Image.asset(
 "assets/filename",
 width: 0,
 height: 0,
)
imgN It will give Image.network() method with height & width Image.network(
 "URL",
 width: 0,
 height: 0,
)
imgF It will give Image.file() method with height & width Image.network(
 fileObject,
 width: 0,
 height: 0,
)
navigatorPush It will give Navigator.push() with initial structure Navigator.push(
 context,
 MaterialPageRoute(
  builder: (context) => MyHomePage(),
 ),
);
navigatorPop It will give a Navigator.pop() method Navigator.pop(context);
navigatorPushName It will give Navigator.pushNamed method with initial parameter Navigator.pushNamed(context, "/myHomePage");
Builders Widget Snippets
Prefix Description Code
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");
 },
)
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,
  );
 },
)
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");
 },
)
gvCount It will give a GridView.count with initial properties GridView.count(
 crossAxisCount: 3,
 shrinkWrap: true,
 children: [
  Text("Gridview.count"),
 ],
)
gvExtent It will give a GridView.extent with initial properties GridView.extent(
 maxCrossAxisExtent: 100,
 shrinkWrap: true,
 children: [
  Text("Gridview.extent"),
 ],
)
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),
   ),
  );
 },
)
streamBuild It will give a StreamBuilder with initial properties StreamBuilder(
 stream: stream,
 initialData: initalData,
 builder: (BuildContext context, AsyncSnapshot snapshot) {
   return Text("Stream Builder");
 },
)
animatedBuild It will give a AnimatedBuilder with initial properties AnimatedBuilder(
 animation: animation,
 child: child,
 builder: (context, child) {
  return Text("Animated Builder");
 },
)
layoutBuild It will give a LayoutBuilder with initial properties LayoutBuilder(
 builder: (BuildContext context, BoxConstraints constraints) {
  return Text("Layout Builder");
 },
)
futureBuild It will give a FutureBuilder with initial properties FutureBuilder(
 future: future,
 initialData: initialData,
 builder: (context, snapshot) {
  return Text("Future Builder");
 },
)
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
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;
}
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
padAll It will give a padding property with EdgeInsets.All() method with inital parameter padding: EdgeInsets.all(8),
padLTRB It will give a padding property with EdgeInsets.fromLTRB() method with inital parameter padding: EdgeInsets.fromLTRB(left, top, right, bottom),
padSym It will give a padding property with EdgeInsets.symmetric() method with inital parameter padding: EdgeInsets.symmetric(horizontal: 0, vertical: 0),
padOnly It will give a padding property with EdgeInsets.only() method padding: EdgeInsets.only(),
marAll It will give a margin property with EdgeInsets.All() method with inital parameter margin: EdgeInsets.all(8),
marLTRB It will give a margin property with EdgeInsets.fromLTRB() method with inital parameter margin: EdgeInsets.fromLTRB(left, top, right, bottom),
marSym It will give a margin property with EdgeInsets.symmetric() method with inital parameter margin: EdgeInsets.symmetric(horizontal: 0, vertical: 0),
marOnly It will give a margin property with EdgeInsets.only() method margin: EdgeInsets.only(),
Widget's Properties & Var Declaration Snippets
Prefix Description Code
width It will give width property with MediaQuery Width width: MediaQuery.of(context).size.width,
height It will give height property with MediaQuery Width height: MediaQuery.of(context).size.height,
brAll It will give borderRadius property with BorderRadius.all() method borderRadius: BorderRadius.all(Radius.circular(10)),
brCircular It will give borderRadius property with BorderRadius.circular() method borderRadius: BorderRadius.circular(10),
colorHax It will give color property with Color object initial argument color: Color(0xFF9C27B0),
list It will give a List with initial assignment List listName = [

];
Provider Snippets
Prefix Description Code
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();
 }
}
consumer It will give Consumer widget with initial properties Consumer(
 builder: (context, value, child) {
  return Text("Provider Consumer");
 },
)
Get Snippets
Prefix Description Code
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;
}
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());
 }
}
getBuilder It will give GetBuilder widgets with initial properties GetBuilder(
 init: Controller(),
 builder: (controller) {
  return Text("Get Builder");
 },
)
getX It will give GetX widgets with initial properties GetX(
 init: Controller(),
 builder: (controller) {
  return Text("GetX");
 },
)
mixingBuilder It will give MixinBuilder widgets with initial properties MixinBuilder(
 init: Controller(),
 builder: (controller) {
  return Text("Mixing Builder");
 },
)
gWidth It will give width property with Get Width width: Get.size.width,
gHeight It will give height property with Get Width height: Get.size.height,

Supports

  1. MacOs, Windows & Linux
  2. VScode version: ^1.54.0

Known Issues

You will find any issue in the extension, feel free to generate issue and make PR as well.

Release Notes

1.0.0

The initial release of Flutter Ace Snippet


About

Flutter Ace Snippet is a collection of the best snippets for flutter devs. It supports Provider and GetX as well.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published