ArticleUncountable.fromMap constructor
ArticleUncountable.fromMap(
- Map<String, dynamic> map
)
Implementation
factory ArticleUncountable.fromMap(Map<String, dynamic> map) {
return ArticleUncountable(
calibreId: map['calibreId'] != null
? map['calibreId'] as int
: map['lineId'] != null
? map['lineId'] as int
: map['productId'] as int,
id: map['id'] as int,
designation: map['designation'] == null
? map['fullName'] as String
: map['designation'] as String,
kind: ArticleKind.uncountable,
price: Price((map['price'] ?? 0) as num).price,
cost: Cost((map['cost'] ?? 0) as num).cost,
creationDate: map['creationDate'] == null
? DatesWeebi.defaultDate
: DateTime.tryParse(map['creationDate']) ?? DatesWeebi.defaultDate,
updateDate: DateTime.tryParse(map['updateDate'] ?? ''),
status: map['status'] ?? true,
statusUpdateDate: DateTime.tryParse(map['statusUpdateDate'] ?? ''),
);
}