|
99 | 99 | "prefix": "cc",
|
100 | 100 | "body": [
|
101 | 101 | "class $1 extends CustomClipper<Path> {",
|
102 |
| - " @override", |
103 |
| - " Path getClip(Size size) {", |
104 |
| - " //TODO:", |
105 |
| - " }", |
| 102 | + " @override", |
| 103 | + " Path getClip(Size size) {", |
| 104 | + " //TODO:", |
| 105 | + " }", |
106 | 106 | "",
|
107 |
| - " @override", |
108 |
| - " bool shouldReclip(CustomClipper<Path> oldClipper) => false;", |
109 |
| - " }", |
| 107 | + " @override", |
| 108 | + " bool shouldReclip(CustomClipper<Path> oldClipper) => false;", |
| 109 | + "}", |
110 | 110 | ],
|
111 | 111 | "description": "自定义CustomClipper"
|
112 | 112 | },
|
|
410 | 410 | ],
|
411 | 411 | "description": "创建带有各种ListTile的ListView"
|
412 | 412 | },
|
413 |
| - |
414 |
| - |
415 |
| - |
416 | 413 | "创建 StatefulWidget 控件": {
|
417 | 414 | "prefix": "mainstf",
|
418 | 415 | "body": [
|
419 |
| - |
| 416 | + "import 'package:flutter/material.dart';", |
| 417 | + "", |
| 418 | + "void main(){", |
| 419 | + "runApp(new MaterialApp(", |
| 420 | + " title:'$1',", |
| 421 | + " theme: new ThemeData(", |
| 422 | + " primarySwatch: Colors.blue,", |
| 423 | + "),", |
| 424 | + "home: new $2(),", |
| 425 | + "));", |
| 426 | + "}", |
| 427 | + "", |
| 428 | + "class $2 extends StatefulWidget{", |
| 429 | + "@override", |
| 430 | + "_$2State createState() => new _$2State();", |
| 431 | + "}", |
| 432 | + "", |
| 433 | + "class _$2State extends State<$2>{", |
| 434 | + "@override", |
| 435 | + "Widget build(BuildContext context){", |
| 436 | + "return new Scaffold(", |
| 437 | + "appBar: new AppBar(", |
| 438 | + "title: new Text('$1'),", |
| 439 | + "),", |
| 440 | + ");", |
| 441 | + "}", |
| 442 | + "}", |
420 | 443 | ],
|
421 | 444 | "description": "创建 StatefulWidget 控件"
|
422 | 445 | },
|
423 | 446 | "创建 StatelessWidget 控件": {
|
424 | 447 | "prefix": "mainstl",
|
425 | 448 | "body": [
|
426 |
| - |
| 449 | + "import 'package:flutter/material.dart';", |
| 450 | + "", |
| 451 | + "void main(){", |
| 452 | + "runApp(new MaterialApp(", |
| 453 | + " title:'$1',", |
| 454 | + " theme: new ThemeData(", |
| 455 | + " primarySwatch: Colors.blue,", |
| 456 | + "),", |
| 457 | + "home: new $2(),", |
| 458 | + "));", |
| 459 | + "}", |
| 460 | + "", |
| 461 | + "class $2 extends StatelessWidget{", |
| 462 | + "@override", |
| 463 | + "Widget build(BuildContext context){", |
| 464 | + "return new Scaffold(", |
| 465 | + "appBar: new AppBar(", |
| 466 | + "title: new Text('$1'),", |
| 467 | + "),", |
| 468 | + ");", |
| 469 | + "}", |
| 470 | + "}", |
427 | 471 | ],
|
428 | 472 | "description": "创建 StatelessWidget 控件"
|
429 | 473 | },
|
|
0 commit comments