Showing
1 changed file
with
4 additions
and
11 deletions
| @@ -92,8 +92,7 @@ class Barcode { | @@ -92,8 +92,7 @@ class Barcode { | ||
| 92 | 92 | ||
| 93 | /// Create a [Barcode] from native data. | 93 | /// Create a [Barcode] from native data. |
| 94 | Barcode.fromNative(Map data) | 94 | Barcode.fromNative(Map data) |
| 95 | - : corners = | ||
| 96 | - toCorners((data['corners'] as List?)?.cast<Map<String, Object?>>()), | 95 | + : corners = toCorners((data['corners'] as List?)?.cast<Map<Object?, Object?>>()), |
| 97 | format = toFormat(data['format'] as int), | 96 | format = toFormat(data['format'] as int), |
| 98 | rawBytes = data['rawBytes'] as Uint8List?, | 97 | rawBytes = data['rawBytes'] as Uint8List?, |
| 99 | rawValue = data['rawValue'] as String?, | 98 | rawValue = data['rawValue'] as String?, |
| @@ -150,12 +149,8 @@ class CalendarEvent { | @@ -150,12 +149,8 @@ class CalendarEvent { | ||
| 150 | /// Create a [CalendarEvent] from native data. | 149 | /// Create a [CalendarEvent] from native data. |
| 151 | CalendarEvent.fromNative(Map data) | 150 | CalendarEvent.fromNative(Map data) |
| 152 | : description = data['description'] as String?, | 151 | : description = data['description'] as String?, |
| 153 | - start = data['start'] != null | ||
| 154 | - ? DateTime.tryParse(data['start'] as String) | ||
| 155 | - : null, | ||
| 156 | - end = data['end'] != null | ||
| 157 | - ? DateTime.tryParse(data['end'] as String) | ||
| 158 | - : null, | 152 | + start = data['start'] != null ? DateTime.tryParse(data['start'] as String) : null, |
| 153 | + end = data['end'] != null ? DateTime.tryParse(data['end'] as String) : null, | ||
| 159 | location = data['location'] as String?, | 154 | location = data['location'] as String?, |
| 160 | organizer = data['organizer'] as String?, | 155 | organizer = data['organizer'] as String?, |
| 161 | status = data['status'] as String?, | 156 | status = data['status'] as String?, |
| @@ -202,9 +197,7 @@ class ContactInfo { | @@ -202,9 +197,7 @@ class ContactInfo { | ||
| 202 | /// Create a [ContactInfo] from native data. | 197 | /// Create a [ContactInfo] from native data. |
| 203 | ContactInfo.fromNative(Map data) | 198 | ContactInfo.fromNative(Map data) |
| 204 | : addresses = List.unmodifiable( | 199 | : addresses = List.unmodifiable( |
| 205 | - (data['addresses'] as List? ?? []) | ||
| 206 | - .cast<Map>() | ||
| 207 | - .map(Address.fromNative), | 200 | + (data['addresses'] as List? ?? []).cast<Map>().map(Address.fromNative), |
| 208 | ), | 201 | ), |
| 209 | emails = List.unmodifiable( | 202 | emails = List.unmodifiable( |
| 210 | (data['emails'] as List? ?? []).cast<Map>().map(Email.fromNative), | 203 | (data['emails'] as List? ?? []).cast<Map>().map(Email.fromNative), |
-
Please register or login to post a comment