Skip to content

Commit a1a9b9a

Browse files
committed
update file dart.json
1 parent 5f1fe60 commit a1a9b9a

File tree

1 file changed

+56
-12
lines changed

1 file changed

+56
-12
lines changed

code_plugins/dart.json

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@
9999
"prefix": "cc",
100100
"body": [
101101
"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+
" }",
106106
"",
107-
" @override",
108-
" bool shouldReclip(CustomClipper<Path> oldClipper) => false;",
109-
" }",
107+
" @override",
108+
" bool shouldReclip(CustomClipper<Path> oldClipper) => false;",
109+
"}",
110110
],
111111
"description": "自定义CustomClipper"
112112
},
@@ -410,20 +410,64 @@
410410
],
411411
"description": "创建带有各种ListTile的ListView"
412412
},
413-
414-
415-
416413
"创建 StatefulWidget 控件": {
417414
"prefix": "mainstf",
418415
"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+
"}",
420443
],
421444
"description": "创建 StatefulWidget 控件"
422445
},
423446
"创建 StatelessWidget 控件": {
424447
"prefix": "mainstl",
425448
"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+
"}",
427471
],
428472
"description": "创建 StatelessWidget 控件"
429473
},

0 commit comments

Comments
 (0)