1
+ // ignore_for_file: camel_case_types
2
+
1
3
import 'package:flutter/material.dart' ;
2
4
import 'package:playbook/playbook.dart' ;
3
5
@@ -16,54 +18,61 @@ Scenario foo2() {
16
18
}
17
19
18
20
class Foo3 extends StatelessWidget {
21
+ const Foo3 ({super .key});
22
+
19
23
@override
20
24
Widget build (BuildContext context) {
21
25
return Container (color: Colors .amber);
22
26
}
23
27
}
24
28
25
29
class Foo4_Bar extends StatelessWidget {
30
+ const Foo4_Bar ({super .key});
31
+
26
32
@override
27
33
Widget build (BuildContext context) {
28
34
return Container (color: Colors .pink);
29
35
}
30
36
}
31
37
32
- Widget foo5 () => Text ('Foo 5' );
38
+ Widget foo5 () => const Text ('Foo 5' );
33
39
34
40
Story fooWidgetStory () {
35
- return Story ('FooWidget' , scenarios: [
36
- foo1 (),
37
- foo2 (),
38
- Scenario (
39
- 'foo3foo3' ,
40
- layout: ScenarioLayout .sizing (
41
- ScenarioLayoutFixed (
42
- 100.0 ,
43
- ),
44
- ScenarioLayoutFixed (
45
- 200.0 ,
41
+ return Story (
42
+ 'FooWidget' ,
43
+ scenarios: [
44
+ foo1 (),
45
+ foo2 (),
46
+ const Scenario (
47
+ 'foo3foo3' ,
48
+ layout: ScenarioLayout .sizing (
49
+ ScenarioLayoutFixed (
50
+ 100 ,
51
+ ),
52
+ ScenarioLayoutFixed (
53
+ 200 ,
54
+ ),
46
55
),
56
+ child: Foo3 (),
47
57
),
48
- child : Foo3 (),
49
- ) ,
50
- Scenario (
51
- 'Foo4 Bar' ,
52
- layout : ScenarioLayout . fixedH (
53
- 300.0 ,
54
- crossAxisLayout : ScenarioLayoutFill (),
58
+ const Scenario (
59
+ 'Foo4 Bar' ,
60
+ layout : ScenarioLayout . fixedH (
61
+ 300 ,
62
+ crossAxisLayout : ScenarioLayoutFill (),
63
+ ) ,
64
+ child : Foo4_Bar (),
55
65
),
56
- child: Foo4_Bar (),
57
- ),
58
- Scenario (
59
- 'foo5' ,
60
- layout: ScenarioLayout .fixedV (
61
- 500.0 ,
62
- crossAxisLayout: ScenarioLayoutFixed (
63
- 200.0 ,
66
+ Scenario (
67
+ 'foo5' ,
68
+ layout: const ScenarioLayout .fixedV (
69
+ 500 ,
70
+ crossAxisLayout: ScenarioLayoutFixed (
71
+ 200 ,
72
+ ),
64
73
),
74
+ child: foo5 (),
65
75
),
66
- child: foo5 (),
67
- ),
68
- ]);
76
+ ],
77
+ );
69
78
}
0 commit comments