1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
| { "StatelessWidget": { "prefix": "slw", "body": [ "import 'package:flutter/material.dart';", "", "class ${1:WidgetName} extends StatelessWidget {", "\t@override", "\tWidget build(BuildContext context) {", "\t\treturn ${2:Container}();", "\t}", "}" ], "description": "StatelessWidget" }, "StatefulWidget": { "prefix": "sfw", "body": [ "import 'package:flutter/material.dart';", "", "class ${1:WidgetName} extends StatefulWidget {", "\t@override", "\t_${1:WidgetName}State createState() => _${1:WidgetName}State();", "}\n", "class _${1:WidgetName}State extends State<${1:WidgetName}> {", "\t@override", "\tWidget build(BuildContext context) {", "\t\treturn ${2:Container}();", "\t}", "}" ], "description": "StatefulWidget" }, "StatelessWidget with Scaffold": { "prefix": "slws", "body": [ "import 'package:flutter/material.dart';", "", "class ${1:WidgetName} extends StatelessWidget {", "\t@override", "\tWidget build(BuildContext context) {", "\t\treturn ${Scaffold}(", "\t\t\tappBar: AppBar(", "\t\t\t\ttitle: Text('${1:WidgetName}'),", "\t\t\t),${2}", "\t\t);", "\t}", "}" ], "description": "StatelessWidget with Scaffold" }, "StatefulWidget with Scaffold": { "prefix": "sfws", "body": [ "import 'package:flutter/material.dart';", "", "class ${1:WidgetName} extends StatefulWidget {", "\t@override", "\t_${1:WidgetName}State createState() => _${1:WidgetName}State();", "}\n", "class _${1:WidgetName}State extends State<${1:WidgetName}> {", "\t@override", "\tWidget build(BuildContext context) {", "\t\treturn ${Scaffold}(", "\t\t\tappBar: AppBar(", "\t\t\t\ttitle: Text('${1:WidgetName}'),", "\t\t\t),${2}", "\t\t);", "\t}", "}" ], "description": "StatefulWidget with Scaffold" }, "InheritedWidget": { "prefix": "ihw", "body": [ "class ${1:WidgetName} extends InheritedWidget {", "\tfinal Widget child;", "\t${2}", "\t${1:WidgetName}({", "\t\tthis.child,", "\t\t${2}", "\t}) : super(child: child);\n", "\tstatic ${1:WidgetName} of(BuildContext context) =>", "\t\t\tcontext.inheritFromWidgetOfExactType(${1:WidgetName});\n", "\t@override", "\tbool updateShouldNotify(${1:WidgetName} oldWidget) {", "\t\treturn true;", "\t}", "}" ], "description": "InheritedWidget" }, "setState": { "prefix": "ss", "body": ["setState(() {${1}});"], "description": "setState" }, "build": { "prefix": "build", "body": [ "@override", "Widget build(BuildContext context) {", "\treturn ${1:Container}(${2});", "}" ], "description": "Build Method" }, "JsonSerializable Import": { "prefix": "jsli", "body": [ "import 'package:json_annotation/json_annotation.dart';", "part '${1:name}.g.dart';", "", "@JsonSerializable(explicitToJson: true)", "class ${2:Name} {", " ${3}", "", " ${2:Name}({", " ${4}", " });", "", " factory ${2:Name}.fromJson(Map<String, dynamic> json) {", " return _$${2:Name}FromJson(json);", " }", "", " Map<String, dynamic> toJson() => _$${2:Name}ToJson(this);", "}" ], "description": "JsonSerializable Import" }, "JsonSerializable": { "prefix": "jsl", "body": [ "@JsonSerializable(explicitToJson: true)", "class ${1:Name} {", " ${2}", "", " ${1:Name}({", " ${3}", " });", "", " factory ${1:Name}.fromJson(Map<String, dynamic> json) {", " return _$${1:Name}FromJson(json);", " }", "", " Map<String, dynamic> toJson() => _$${1:Name}ToJson(this);", "}" ], "description": "JsonSerializable Class" } }
|