@@ -38,8 +38,8 @@ class AdInfoFromDash {
38
38
39
39
/// Parse the ad information from a map. Returns null if the map is null or empty. Otherwise, returns a new instance of [AdInfoFromDash] .
40
40
static AdInfoFromDash ? fromAdInfoMap (Map <Object ?, Object ?>? adInfo) {
41
- if (adInfo! .isNotEmpty) {
42
- final int adId = adInfo['id' ]! as int ;
41
+ if (adInfo? .isNotEmpty ?? false ) {
42
+ final int adId = adInfo! ['id' ]! as int ;
43
43
final int startTime = adInfo['start_ms' ]! as int ;
44
44
final int endTime = adInfo['end_ms' ]! as int ;
45
45
final int durationTime = adInfo['duration_ms' ]! as int ;
@@ -48,13 +48,12 @@ class AdInfoFromDash {
48
48
final bool cancelIndicator = adInfo['cancel_indicator' ]! as bool ;
49
49
50
50
return AdInfoFromDash (
51
- adId: adId,
52
- cancelIndicator: cancelIndicator,
53
- startTime: startTime,
54
- endTime: endTime,
55
- durationTime: durationTime,
56
- outOfNetworkIndicator: outOfNetworkIndicator,
57
- );
51
+ adId: adId,
52
+ cancelIndicator: cancelIndicator,
53
+ startTime: startTime,
54
+ endTime: endTime,
55
+ durationTime: durationTime,
56
+ outOfNetworkIndicator: outOfNetworkIndicator);
58
57
}
59
58
60
59
return null ;
@@ -84,12 +83,6 @@ class AdInfoFromDash {
84
83
outOfNetworkIndicator == other.outOfNetworkIndicator;
85
84
86
85
@override
87
- int get hashCode => Object .hash (
88
- adId,
89
- cancelIndicator,
90
- startTime,
91
- endTime,
92
- durationTime,
93
- outOfNetworkIndicator,
94
- );
86
+ int get hashCode => Object .hash (adId, cancelIndicator, startTime, endTime,
87
+ durationTime, outOfNetworkIndicator);
95
88
}
0 commit comments