@@ -13,7 +13,7 @@ import 'message.dart';
1313mixin DeserializeFinderFactory {
1414 /// Deserializes the finder from JSON generated by [SerializableFinder.serialize] .
1515 SerializableFinder deserializeFinder (Map <String , String > json) {
16- final String ? finderType = json['finderType' ];
16+ final String finderType = json['finderType' ];
1717 switch (finderType) {
1818 case 'ByType' : return ByType .deserialize (json);
1919 case 'ByValueKey' : return ByValueKey .deserialize (json);
@@ -41,7 +41,7 @@ DriverError _createInvalidKeyValueTypeError(String invalidType) {
4141/// and add more keys to the returned map.
4242abstract class CommandWithTarget extends Command {
4343 /// Constructs this command given a [finder] .
44- CommandWithTarget (this .finder, {Duration ? timeout}) : super (timeout: timeout) {
44+ CommandWithTarget (this .finder, {Duration timeout}) : super (timeout: timeout) {
4545 if (finder == null )
4646 throw DriverError ('$runtimeType target cannot be null' );
4747 }
@@ -73,7 +73,7 @@ class WaitFor extends CommandWithTarget {
7373 /// appear within the [timeout] amount of time.
7474 ///
7575 /// If [timeout] is not specified, the command defaults to no timeout.
76- WaitFor (SerializableFinder finder, {Duration ? timeout})
76+ WaitFor (SerializableFinder finder, {Duration timeout})
7777 : super (finder, timeout: timeout);
7878
7979 /// Deserializes this command from the value generated by [serialize] .
@@ -103,7 +103,7 @@ class WaitForAbsent extends CommandWithTarget {
103103 /// disappear within the [timeout] amount of time.
104104 ///
105105 /// If [timeout] is not specified, the command defaults to no timeout.
106- WaitForAbsent (SerializableFinder finder, {Duration ? timeout})
106+ WaitForAbsent (SerializableFinder finder, {Duration timeout})
107107 : super (finder, timeout: timeout);
108108
109109 /// Deserializes this command from the value generated by [serialize] .
@@ -165,7 +165,7 @@ class ByTooltipMessage extends SerializableFinder {
165165
166166 /// Deserializes the finder from JSON generated by [serialize] .
167167 static ByTooltipMessage deserialize (Map <String , String > json) {
168- return ByTooltipMessage (json['text' ]! );
168+ return ByTooltipMessage (json['text' ]);
169169 }
170170}
171171
@@ -203,7 +203,7 @@ class BySemanticsLabel extends SerializableFinder {
203203 /// Deserializes the finder from JSON generated by [serialize] .
204204 static BySemanticsLabel deserialize (Map <String , String > json) {
205205 final bool isRegExp = json['isRegExp' ] == 'true' ;
206- return BySemanticsLabel (isRegExp ? RegExp (json['label' ]! ) : json['label' ]! );
206+ return BySemanticsLabel (isRegExp ? RegExp (json['label' ]) : json['label' ]);
207207 }
208208}
209209
@@ -226,7 +226,7 @@ class ByText extends SerializableFinder {
226226
227227 /// Deserializes the finder from JSON generated by [serialize] .
228228 static ByText deserialize (Map <String , String > json) {
229- return ByText (json['text' ]! );
229+ return ByText (json['text' ]);
230230 }
231231}
232232
@@ -262,8 +262,8 @@ class ByValueKey extends SerializableFinder {
262262
263263 /// Deserializes the finder from JSON generated by [serialize] .
264264 static ByValueKey deserialize (Map <String , String > json) {
265- final String keyValueString = json['keyValueString' ]! ;
266- final String keyValueType = json['keyValueType' ]! ;
265+ final String keyValueString = json['keyValueString' ];
266+ final String keyValueType = json['keyValueType' ];
267267 switch (keyValueType) {
268268 case 'int' :
269269 return ByValueKey (int .parse (keyValueString));
@@ -293,7 +293,7 @@ class ByType extends SerializableFinder {
293293
294294 /// Deserializes the finder from JSON generated by [serialize] .
295295 static ByType deserialize (Map <String , String > json) {
296- return ByType (json['type' ]! );
296+ return ByType (json['type' ]);
297297 }
298298}
299299
@@ -319,8 +319,8 @@ class PageBack extends SerializableFinder {
319319class Descendant extends SerializableFinder {
320320 /// Creates a descendant finder.
321321 const Descendant ({
322- required this .of,
323- required this .matching,
322+ @ required this .of,
323+ @ required this .matching,
324324 this .matchRoot = false ,
325325 this .firstMatchOnly = false ,
326326 });
@@ -354,9 +354,9 @@ class Descendant extends SerializableFinder {
354354 /// Deserializes the finder from JSON generated by [serialize] .
355355 static Descendant deserialize (Map <String , String > json, DeserializeFinderFactory finderFactory) {
356356 final Map <String , String > jsonOfMatcher =
357- Map <String , String >.from (jsonDecode (json['of' ]! ) as Map <String , dynamic >);
357+ Map <String , String >.from (jsonDecode (json['of' ]) as Map <String , dynamic >);
358358 final Map <String , String > jsonMatchingMatcher =
359- Map <String , String >.from (jsonDecode (json['matching' ]! ) as Map <String , dynamic >);
359+ Map <String , String >.from (jsonDecode (json['matching' ]) as Map <String , dynamic >);
360360 return Descendant (
361361 of: finderFactory.deserializeFinder (jsonOfMatcher),
362362 matching: finderFactory.deserializeFinder (jsonMatchingMatcher),
@@ -374,8 +374,8 @@ class Descendant extends SerializableFinder {
374374class Ancestor extends SerializableFinder {
375375 /// Creates an ancestor finder.
376376 const Ancestor ({
377- required this .of,
378- required this .matching,
377+ @ required this .of,
378+ @ required this .matching,
379379 this .matchRoot = false ,
380380 this .firstMatchOnly = false ,
381381 });
@@ -409,9 +409,9 @@ class Ancestor extends SerializableFinder {
409409 /// Deserializes the finder from JSON generated by [serialize] .
410410 static Ancestor deserialize (Map <String , String > json, DeserializeFinderFactory finderFactory) {
411411 final Map <String , String > jsonOfMatcher =
412- Map <String , String >.from (jsonDecode (json['of' ]! ) as Map <String , dynamic >);
412+ Map <String , String >.from (jsonDecode (json['of' ]) as Map <String , dynamic >);
413413 final Map <String , String > jsonMatchingMatcher =
414- Map <String , String >.from (jsonDecode (json['matching' ]! ) as Map <String , dynamic >);
414+ Map <String , String >.from (jsonDecode (json['matching' ]) as Map <String , dynamic >);
415415 return Ancestor (
416416 of: finderFactory.deserializeFinder (jsonOfMatcher),
417417 matching: finderFactory.deserializeFinder (jsonMatchingMatcher),
@@ -436,7 +436,7 @@ class Ancestor extends SerializableFinder {
436436class GetSemanticsId extends CommandWithTarget {
437437
438438 /// Creates a command which finds a Widget and then looks up the semantic id.
439- GetSemanticsId (SerializableFinder finder, {Duration ? timeout}) : super (finder, timeout: timeout);
439+ GetSemanticsId (SerializableFinder finder, {Duration timeout}) : super (finder, timeout: timeout);
440440
441441 /// Creates a command from a JSON map.
442442 GetSemanticsId .deserialize (Map <String , String > json, DeserializeFinderFactory finderFactory)
0 commit comments