ProxyArticle.fromMap constructor

ProxyArticle.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory ProxyArticle.fromMap(Map<String, dynamic> map) {
  return ProxyArticle(
    calibreId: map['calibreId'] != null
        ? map['calibreId'] as int
        : map['lineId'] != null
            ? map['lineId'] as int
            : map['productId'] as int,
    articleId: map['articleId'] as int,
    id: map['id'],
    proxyCalibreId: map['proxyCalibreId'] != null
        ? map['proxyCalibreId'] as int
        : map['proxyLineId'] != null
            ? map['proxyLineId'] as int
            : 0,
    proxyArticleId: map['proxyArticleId'],
    status: map['status'] ?? true,
    minimumUnitPerBasket: map['minimumUnitPerBasket'] == null
        ? 1.0
        : (map['minimumUnitPerBasket'] as num).toDouble(),
    articleWeight: map['articleWeight'] == null
        ? 1.0
        : (map['articleWeight'] as num).toDouble(),
  );
}