ArticleBasketOnTicket.fromMap constructor

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

Implementation

factory ArticleBasketOnTicket.fromMap(Map<String, dynamic> map) {
  return ArticleBasketOnTicket(
    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.basket,
    proxies: map['proxies'] != null
        ? List<ProxyArticle>.from(
            map['proxies']?.map((x) => ProxyArticle.fromMap(x)))
        : [],
    discountAmountSalesOnly:
        map['markupAmount'] == null ? 0 : (map['discountAmount'] as num),
    markupAmountSalesOnly:
        map['markupAmount'] == null ? 0 : (map['markupAmount'] as num),
  );
}