|
26 | 26 | " @override",
|
27 | 27 | " Widget build(BuildContext context) {",
|
28 | 28 | " return Container(",
|
29 |
| - " child: ${2:null},", |
| 29 | + " child: ${2:null},", |
30 | 30 | " );",
|
31 | 31 | " }",
|
32 | 32 | "}"
|
|
80 | 80 | "prefix": "initS",
|
81 | 81 | "body": [
|
82 | 82 | "@override",
|
83 |
| - "void initState() { ", |
| 83 | + "void initState() {", |
84 | 84 | " super.initState();",
|
85 | 85 | " ${0:}",
|
86 | 86 | "}"
|
|
91 | 91 | "prefix": "dis",
|
92 | 92 | "body": [
|
93 | 93 | "@override",
|
94 |
| - "void dispose() { ", |
| 94 | + "void dispose() {", |
95 | 95 | " ${0:}",
|
96 | 96 | " super.dispose();",
|
97 | 97 | "}"
|
|
137 | 137 | "ListView.builder(",
|
138 | 138 | " itemCount: ${1:1},",
|
139 | 139 | " itemBuilder: (BuildContext context, int index) {",
|
140 |
| - " return ${2:};", |
141 |
| - " },", |
| 140 | + " return ${2:};", |
| 141 | + " },", |
142 | 142 | "),"
|
143 | 143 | ],
|
144 | 144 | "description": "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."
|
|
149 | 149 | "ListView.separated(",
|
150 | 150 | " itemCount: ${1:1},",
|
151 | 151 | " separatorBuilder: (BuildContext context, int index) {",
|
152 |
| - " return ${2:};", |
153 |
| - " },", |
| 152 | + " return ${2:};", |
| 153 | + " },", |
154 | 154 | " itemBuilder: (BuildContext context, int index) {",
|
155 |
| - " return ${3:};", |
156 |
| - " },", |
| 155 | + " return ${3:};", |
| 156 | + " },", |
157 | 157 | "),"
|
158 | 158 | ],
|
159 | 159 | "description": "Creates a fixed-length scrollable linear array of list 'items' separated by list item 'separators'."
|
|
204 | 204 | "body": [
|
205 | 205 | "CustomScrollView(",
|
206 | 206 | " slivers: <Widget>[",
|
207 |
| - " ${0:}", |
| 207 | + " ${0:}", |
208 | 208 | " ],",
|
209 | 209 | "),"
|
210 | 210 | ],
|
|
236 | 236 | " },",
|
237 | 237 | "),"
|
238 | 238 | ],
|
239 |
| - "description": "Creates an Animated Builder. The widget specified to `child` is passed to the `builder` " |
| 239 | + "description": "Creates an Animated Builder. The widget specified to `child` is passed to the `builder`" |
240 | 240 | },
|
241 | 241 | "Stateful Builder": {
|
242 | 242 | "prefix": "statefulBldr",
|
|
367 | 367 | "body": [
|
368 | 368 | "@override",
|
369 | 369 | "String toString() {",
|
370 |
| - "return ${1:toString};", |
371 |
| - " }" |
| 370 | + " return ${1:toString};", |
| 371 | + "}" |
372 | 372 | ],
|
373 | 373 | "description": "Returns a string representation of this object."
|
374 | 374 | },
|
|
399 | 399 | "description": "Create a MaterialApp",
|
400 | 400 | "body": [
|
401 | 401 | "import 'package:flutter/material.dart';",
|
402 |
| - " ", |
| 402 | + "", |
403 | 403 | "void main() => runApp(MyApp());",
|
404 |
| - " ", |
| 404 | + "", |
405 | 405 | "class MyApp extends StatelessWidget {",
|
406 | 406 | " @override",
|
407 | 407 | " Widget build(BuildContext context) {",
|
|
427 | 427 | "description": "Create a CupertinoApp",
|
428 | 428 | "body": [
|
429 | 429 | "import 'package:flutter/cupertino.dart';",
|
430 |
| - " ", |
| 430 | + "", |
431 | 431 | "void main() => runApp(MyApp());",
|
432 |
| - " ", |
| 432 | + "", |
433 | 433 | "class MyApp extends StatelessWidget {",
|
434 | 434 | " @override",
|
435 | 435 | " Widget build(BuildContext context) {",
|
|
454 | 454 | "prefix": "tweenAnimationBuilder",
|
455 | 455 | "body": [
|
456 | 456 | "TweenAnimationBuilder(",
|
457 |
| - " duration: ${1:const Duration(),}", |
458 |
| - " tween: ${2:Tween(),}", |
459 |
| - " builder: (BuildContext context, ${3:dynamic} value, Widget? child) {", |
460 |
| - " return ${4:Container();}", |
461 |
| - " },", |
462 |
| - " ), " |
| 457 | + " duration: ${1:const Duration(),}", |
| 458 | + " tween: ${2:Tween(),}", |
| 459 | + " builder: (BuildContext context, ${3:dynamic} value, Widget? child) {", |
| 460 | + " return ${4:Container();}", |
| 461 | + " },", |
| 462 | + ")," |
463 | 463 | ],
|
464 | 464 | "description": "Widget builder that animates a property of a Widget to a target value whenever the target value changes."
|
465 | 465 | },
|
466 | 466 | "Value Listenable Builder": {
|
467 | 467 | "prefix": "valueListenableBuilder",
|
468 | 468 | "body": [
|
469 | 469 | "ValueListenableBuilder(",
|
470 |
| - " valueListenable: ${1: null},", |
471 |
| - " builder: (BuildContext context, ${2:dynamic} value, Widget? child) {", |
472 |
| - " return ${3: Container();}", |
473 |
| - " },", |
474 |
| - " )," |
| 470 | + " valueListenable: ${1: null},", |
| 471 | + " builder: (BuildContext context, ${2:dynamic} value, Widget? child) {", |
| 472 | + " return ${3: Container();}", |
| 473 | + " },", |
| 474 | + ")," |
475 | 475 | ],
|
476 | 476 | "description": "Given a ValueListenable<T> 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."
|
477 | 477 | },
|
478 | 478 | "Test": {
|
479 | 479 | "prefix": "f-test",
|
480 | 480 | "body": [
|
481 | 481 | "test(",
|
482 |
| - " \"${1:test description}\",", |
483 |
| - " () {},", |
| 482 | + " \"${1:test description}\",", |
| 483 | + " () {},", |
484 | 484 | ");"
|
485 | 485 | ],
|
486 | 486 | "description": "Create a test function"
|
|
489 | 489 | "prefix": "widgetTest",
|
490 | 490 | "body": [
|
491 | 491 | "testWidgets(",
|
492 |
| - " \"${1:test description}\",", |
493 |
| - " (WidgetTester tester) async {},", |
| 492 | + " \"${1:test description}\",", |
| 493 | + " (WidgetTester tester) async {},", |
494 | 494 | ");"
|
495 | 495 | ],
|
496 | 496 | "description": "Create a testWidgets function"
|
|
0 commit comments