@@ -11,15 +11,13 @@ class WaitForCondition extends Command {
11
11
/// Creates a command that waits for the given [condition] is met.
12
12
///
13
13
/// The [condition] argument must not be null.
14
- const WaitForCondition (this .condition, {super .timeout})
15
- : assert (condition != null );
14
+ const WaitForCondition (this .condition, {super .timeout});
16
15
17
16
/// Deserializes this command from the value generated by [serialize] .
18
17
///
19
18
/// The [json] argument cannot be null.
20
19
WaitForCondition .deserialize (super .json)
21
- : assert (json != null ),
22
- condition = _deserialize (json),
20
+ : condition = _deserialize (json),
23
21
super .deserialize ();
24
22
25
23
/// The condition that this command shall wait for.
@@ -94,7 +92,6 @@ class NoTransientCallbacks extends SerializableWaitCondition {
94
92
///
95
93
/// The [json] argument must not be null.
96
94
factory NoTransientCallbacks .deserialize (Map <String , String > json) {
97
- assert (json != null );
98
95
if (json['conditionName' ] != 'NoTransientCallbacksCondition' ) {
99
96
throw SerializationException ('Error occurred during deserializing the NoTransientCallbacksCondition JSON string: $json ' );
100
97
}
@@ -115,7 +112,6 @@ class NoPendingFrame extends SerializableWaitCondition {
115
112
///
116
113
/// The [json] argument must not be null.
117
114
factory NoPendingFrame .deserialize (Map <String , String > json) {
118
- assert (json != null );
119
115
if (json['conditionName' ] != 'NoPendingFrameCondition' ) {
120
116
throw SerializationException ('Error occurred during deserializing the NoPendingFrameCondition JSON string: $json ' );
121
117
}
@@ -136,7 +132,6 @@ class FirstFrameRasterized extends SerializableWaitCondition {
136
132
///
137
133
/// The [json] argument must not be null.
138
134
factory FirstFrameRasterized .deserialize (Map <String , String > json) {
139
- assert (json != null );
140
135
if (json['conditionName' ] != 'FirstFrameRasterizedCondition' ) {
141
136
throw SerializationException ('Error occurred during deserializing the FirstFrameRasterizedCondition JSON string: $json ' );
142
137
}
@@ -160,7 +155,6 @@ class NoPendingPlatformMessages extends SerializableWaitCondition {
160
155
///
161
156
/// The [json] argument must not be null.
162
157
factory NoPendingPlatformMessages .deserialize (Map <String , String > json) {
163
- assert (json != null );
164
158
if (json['conditionName' ] != 'NoPendingPlatformMessagesCondition' ) {
165
159
throw SerializationException ('Error occurred during deserializing the NoPendingPlatformMessagesCondition JSON string: $json ' );
166
160
}
@@ -176,15 +170,13 @@ class CombinedCondition extends SerializableWaitCondition {
176
170
/// Creates a [CombinedCondition] condition.
177
171
///
178
172
/// The [conditions] argument must not be null.
179
- const CombinedCondition (this .conditions)
180
- : assert (conditions != null );
173
+ const CombinedCondition (this .conditions);
181
174
182
175
/// Factory constructor to parse a [CombinedCondition] instance from the
183
176
/// given JSON map.
184
177
///
185
178
/// The [jsonMap] argument must not be null.
186
179
factory CombinedCondition .deserialize (Map <String , String > jsonMap) {
187
- assert (jsonMap != null );
188
180
if (jsonMap['conditionName' ] != 'CombinedCondition' ) {
189
181
throw SerializationException ('Error occurred during deserializing the CombinedCondition JSON string: $jsonMap ' );
190
182
}
@@ -210,7 +202,6 @@ class CombinedCondition extends SerializableWaitCondition {
210
202
final Map <String , String > jsonMap = super .serialize ();
211
203
final List <Map <String , String >> jsonConditions = conditions.map (
212
204
(SerializableWaitCondition condition) {
213
- assert (condition != null );
214
205
return condition.serialize ();
215
206
}).toList ();
216
207
jsonMap['conditions' ] = json.encode (jsonConditions);
@@ -222,7 +213,6 @@ class CombinedCondition extends SerializableWaitCondition {
222
213
///
223
214
/// The [json] argument must not be null.
224
215
SerializableWaitCondition _deserialize (Map <String , String > json) {
225
- assert (json != null );
226
216
final String conditionName = json['conditionName' ]! ;
227
217
switch (conditionName) {
228
218
case 'NoTransientCallbacksCondition' :
0 commit comments