@@ -7,6 +7,10 @@ import 'package:flutter/material.dart';
7
7
import 'package:flutter/rendering.dart' ;
8
8
import 'package:flutter/services.dart' ;
9
9
10
+ ////////////////////////////////////////////////////////////////
11
+ // From the Flutter engine, i.e. from dart:ui.
12
+ //
13
+
10
14
extension PaintChecks on Subject <Paint > {
11
15
Subject <Shader ?> get shader => has ((x) => x.shader, 'shader' );
12
16
}
@@ -26,15 +30,89 @@ extension RectChecks on Subject<Rect> {
26
30
// TODO others
27
31
}
28
32
33
+ extension FontVariationChecks on Subject <FontVariation > {
34
+ Subject <String > get axis => has ((x) => x.axis, 'axis' );
35
+ Subject <double > get value => has ((x) => x.value, 'value' );
36
+ }
37
+
38
+ extension SizeChecks on Subject <Size > {
39
+ Subject <double > get width => has ((x) => x.width, 'width' );
40
+ Subject <double > get height => has ((x) => x.height, 'height' );
41
+ }
42
+
43
+ ////////////////////////////////////////////////////////////////
44
+ // From 'package:flutter/foundation.dart'.
45
+ //
46
+
47
+ extension ValueListenableChecks <T > on Subject <ValueListenable <T >> {
48
+ Subject <T > get value => has ((c) => c.value, 'value' );
49
+ }
50
+
51
+ ////////////////////////////////////////////////////////////////
52
+ // From 'package:flutter/services.dart'.
53
+ //
54
+
55
+ extension ClipboardDataChecks on Subject <ClipboardData > {
56
+ Subject <String ?> get text => has ((d) => d.text, 'text' );
57
+ }
58
+
59
+ extension TextEditingValueChecks on Subject <TextEditingValue > {
60
+ Subject <String > get text => has ((x) => x.text, 'text' );
61
+ Subject <TextSelection > get selection => has ((x) => x.selection, 'selection' );
62
+ Subject <TextRange > get composing => has ((x) => x.composing, 'composing' );
63
+ }
64
+
65
+ ////////////////////////////////////////////////////////////////
66
+ // From 'package:flutter/animation.dart'.
67
+ //
68
+
29
69
extension AnimationChecks <T > on Subject <Animation <T >> {
30
70
Subject <AnimationStatus > get status => has ((d) => d.status, 'status' );
31
71
Subject <T > get value => has ((d) => d.value, 'value' );
32
72
}
33
73
34
- extension ClipboardDataChecks on Subject <ClipboardData > {
35
- Subject <String ?> get text => has ((d) => d.text, 'text' );
74
+ ////////////////////////////////////////////////////////////////
75
+ // From 'package:flutter/painting.dart'.
76
+ //
77
+
78
+ extension TextStyleChecks on Subject <TextStyle > {
79
+ Subject <bool > get inherit => has ((t) => t.inherit, 'inherit' );
80
+ Subject <Color ?> get color => has ((t) => t.color, 'color' );
81
+ Subject <double ?> get fontSize => has ((t) => t.fontSize, 'fontSize' );
82
+ Subject <FontWeight ?> get fontWeight => has ((t) => t.fontWeight, 'fontWeight' );
83
+ Subject <double ?> get letterSpacing => has ((t) => t.letterSpacing, 'letterSpacing' );
84
+ Subject <List <FontVariation >?> get fontVariations => has ((t) => t.fontVariations, 'fontVariations' );
85
+ Subject <String ?> get fontFamily => has ((t) => t.fontFamily, 'fontFamily' );
86
+ Subject <List <String >?> get fontFamilyFallback => has ((t) => t.fontFamilyFallback, 'fontFamilyFallback' );
87
+
88
+ // TODO others
89
+ }
90
+
91
+ extension InlineSpanChecks on Subject <InlineSpan > {
92
+ Subject <TextStyle ?> get style => has ((x) => x.style, 'style' );
93
+ }
94
+
95
+ extension BoxDecorationChecks on Subject <BoxDecoration > {
96
+ Subject <Color ?> get color => has ((x) => x.color, 'color' );
97
+ }
98
+
99
+ ////////////////////////////////////////////////////////////////
100
+ // From 'package:flutter/rendering.dart'.
101
+ //
102
+
103
+ extension RenderBoxChecks on Subject <RenderBox > {
104
+ Subject <Size > get size => has ((x) => x.size, 'size' );
36
105
}
37
106
107
+ extension RenderParagraphChecks on Subject <RenderParagraph > {
108
+ Subject <InlineSpan > get text => has ((x) => x.text, 'text' );
109
+ Subject <bool > get didExceedMaxLines => has ((x) => x.didExceedMaxLines, 'didExceedMaxLines' );
110
+ }
111
+
112
+ ////////////////////////////////////////////////////////////////
113
+ // From 'package:flutter/widgets.dart'.
114
+ //
115
+
38
116
extension ColoredBoxChecks on Subject <ColoredBox > {
39
117
Subject <Color ?> get color => has ((d) => d.color, 'color' );
40
118
}
@@ -45,10 +123,6 @@ extension GlobalKeyChecks<T extends State<StatefulWidget>> on Subject<GlobalKey<
45
123
Subject <T ?> get currentState => has ((k) => k.currentState, 'currentState' );
46
124
}
47
125
48
- extension RenderBoxChecks on Subject <RenderBox > {
49
- Subject <Size > get size => has ((x) => x.size, 'size' );
50
- }
51
-
52
126
extension IconChecks on Subject <Icon > {
53
127
Subject <IconData ?> get icon => has ((i) => i.icon, 'icon' );
54
128
Subject <Color ?> get color => has ((i) => i.color, 'color' );
@@ -70,47 +144,41 @@ extension RouteSettingsChecks<T> on Subject<RouteSettings> {
70
144
Subject <Object ?> get arguments => has ((s) => s.arguments, 'arguments' );
71
145
}
72
146
73
- extension ValueListenableChecks <T > on Subject <ValueListenable <T >> {
74
- Subject <T > get value => has ((c) => c.value, 'value' );
75
- }
76
-
77
147
extension TextChecks on Subject <Text > {
78
148
Subject <String ?> get data => has ((t) => t.data, 'data' );
79
149
Subject <TextStyle ?> get style => has ((t) => t.style, 'style' );
80
150
}
81
151
82
- extension TextEditingValueChecks on Subject <TextEditingValue > {
83
- Subject <String > get text => has ((x) => x.text, 'text' );
84
- Subject <TextSelection > get selection => has ((x) => x.selection, 'selection' );
85
- Subject <TextRange > get composing => has ((x) => x.composing, 'composing' );
86
- }
87
-
88
152
extension TextEditingControllerChecks on Subject <TextEditingController > {
89
153
Subject <String ?> get text => has ((t) => t.text, 'text' );
90
154
}
91
155
92
- extension TextFieldChecks on Subject <TextField > {
93
- Subject <TextCapitalization ?> get textCapitalization => has ((t) => t.textCapitalization, 'textCapitalization' );
94
- Subject <InputDecoration ?> get decoration => has ((t) => t.decoration, 'decoration' );
95
- Subject <TextEditingController ?> get controller => has ((t) => t.controller, 'controller' );
156
+ extension ElementChecks on Subject <Element > {
157
+ Subject <Size ?> get size => has ((t) => t.size, 'size' );
158
+ // TODO more
96
159
}
97
160
98
- extension TextStyleChecks on Subject <TextStyle > {
99
- Subject <bool > get inherit => has ((t) => t.inherit, 'inherit' );
100
- Subject <Color ?> get color => has ((t) => t.color, 'color' );
101
- Subject <double ?> get fontSize => has ((t) => t.fontSize, 'fontSize' );
102
- Subject <FontWeight ?> get fontWeight => has ((t) => t.fontWeight, 'fontWeight' );
103
- Subject <double ?> get letterSpacing => has ((t) => t.letterSpacing, 'letterSpacing' );
104
- Subject <List <FontVariation >?> get fontVariations => has ((t) => t.fontVariations, 'fontVariations' );
105
- Subject <String ?> get fontFamily => has ((t) => t.fontFamily, 'fontFamily' );
106
- Subject <List <String >?> get fontFamilyFallback => has ((t) => t.fontFamilyFallback, 'fontFamilyFallback' );
161
+ extension MediaQueryDataChecks on Subject <MediaQueryData > {
162
+ Subject <TextScaler > get textScaler => has ((x) => x.textScaler, 'textScaler' );
163
+ // TODO more
164
+ }
107
165
108
- // TODO others
166
+ extension TableRowChecks on Subject <TableRow > {
167
+ Subject <Decoration ?> get decoration => has ((x) => x.decoration, 'decoration' );
109
168
}
110
169
111
- extension FontVariationChecks on Subject <FontVariation > {
112
- Subject <String > get axis => has ((x) => x.axis, 'axis' );
113
- Subject <double > get value => has ((x) => x.value, 'value' );
170
+ extension TableChecks on Subject <Table > {
171
+ Subject <List <TableRow >> get children => has ((x) => x.children, 'children' );
172
+ }
173
+
174
+ ////////////////////////////////////////////////////////////////
175
+ // From 'package:flutter/material.dart'.
176
+ //
177
+
178
+ extension TextFieldChecks on Subject <TextField > {
179
+ Subject <TextCapitalization ?> get textCapitalization => has ((t) => t.textCapitalization, 'textCapitalization' );
180
+ Subject <InputDecoration ?> get decoration => has ((t) => t.decoration, 'decoration' );
181
+ Subject <TextEditingController ?> get controller => has ((t) => t.controller, 'controller' );
114
182
}
115
183
116
184
extension TextThemeChecks on Subject <TextTheme > {
@@ -139,30 +207,6 @@ extension TypographyChecks on Subject<Typography> {
139
207
Subject <TextTheme > get tall => has ((t) => t.tall, 'tall' );
140
208
}
141
209
142
- extension InlineSpanChecks on Subject <InlineSpan > {
143
- Subject <TextStyle ?> get style => has ((x) => x.style, 'style' );
144
- }
145
-
146
- extension RenderParagraphChecks on Subject <RenderParagraph > {
147
- Subject <InlineSpan > get text => has ((x) => x.text, 'text' );
148
- Subject <bool > get didExceedMaxLines => has ((x) => x.didExceedMaxLines, 'didExceedMaxLines' );
149
- }
150
-
151
- extension SizeChecks on Subject <Size > {
152
- Subject <double > get width => has ((x) => x.width, 'width' );
153
- Subject <double > get height => has ((x) => x.height, 'height' );
154
- }
155
-
156
- extension ElementChecks on Subject <Element > {
157
- Subject <Size ?> get size => has ((t) => t.size, 'size' );
158
- // TODO more
159
- }
160
-
161
- extension MediaQueryDataChecks on Subject <MediaQueryData > {
162
- Subject <TextScaler > get textScaler => has ((x) => x.textScaler, 'textScaler' );
163
- // TODO more
164
- }
165
-
166
210
extension MaterialChecks on Subject <Material > {
167
211
Subject <Color ?> get color => has ((x) => x.color, 'color' );
168
212
// TODO more
@@ -184,18 +228,6 @@ extension ThemeDataChecks on Subject<ThemeData> {
184
228
Subject <Brightness > get brightness => has ((x) => x.brightness, 'brightness' );
185
229
}
186
230
187
- extension BoxDecorationChecks on Subject <BoxDecoration > {
188
- Subject <Color ?> get color => has ((x) => x.color, 'color' );
189
- }
190
-
191
- extension TableRowChecks on Subject <TableRow > {
192
- Subject <Decoration ?> get decoration => has ((x) => x.decoration, 'decoration' );
193
- }
194
-
195
- extension TableChecks on Subject <Table > {
196
- Subject <List <TableRow >> get children => has ((x) => x.children, 'children' );
197
- }
198
-
199
231
extension IconButtonChecks on Subject <IconButton > {
200
232
Subject <bool ?> get isSelected => has ((x) => x.isSelected, 'isSelected' );
201
233
}
0 commit comments