Skip to content

Commit c2c1b75

Browse files
guildemlpil
authored andcommitted
Fixed constructors and createState definition
1 parent 8c91794 commit c2c1b75

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

snippets/dart-flutter.snippets

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Flutter stateless widget
44
snippet stless
55
class $1 extends StatelessWidget {
6+
const $1({super.key});
7+
68
@override
79
Widget build(BuildContext context) {
810
return Container(
@@ -14,8 +16,10 @@ snippet stless
1416
# Flutter stateful widget
1517
snippet stful
1618
class $1 extends StatefulWidget {
19+
const $1({super.key});
20+
1721
@override
18-
_$1State createState() => _$1State();
22+
State<$1> createState() => _$1State();
1923
}
2024

2125
class _$1State extends State<$1> {
@@ -30,8 +34,10 @@ snippet stful
3034
# Flutter widget with AnimationController
3135
snippet stanim
3236
class $1 extends StatefulWidget {
37+
const $1({super.key});
38+
3339
@override
34-
_$1State createState() => _$1State();
40+
State<$1> createState() => _$1State();
3541
}
3642

3743
class _$1State extends State<$1>
@@ -85,5 +91,3 @@ snippet fsa
8591
);
8692
}
8793
}
88-
89-

0 commit comments

Comments
 (0)