ClosingStockBoutiqueArticle.fromMap constructor

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

Implementation

factory ClosingStockBoutiqueArticle.fromMap(Map<String, dynamic> map) {
  return ClosingStockBoutiqueArticle(
    DateTime.tryParse(map['closingDate'] ?? '') ?? DatesWeebi.defaultDate,
    boutiqueId: map['boutiqueId'] as int,
    calibreId: map['calibreId'] as int,
    id: map['id'] as int,
    designation: map['designation'] as String,
    unitsInOnePiece: map['unitsInOnePiece'] == null
        ? 1.0
        : (map['unitsInOnePiece'] as num).toDouble(),
    quantityIn: map['quantityIn'] == null
        ? 0.0
        : (map['quantityIn'] as num).toDouble(),
    quantityOut: map['quantityOut'] == null
        ? 0.0
        : (map['quantityOut'] as num).toDouble(),
    initialQtCl: map['initialQtCl'] == null
        ? 0.0
        : (map['initialQtCl'] as num).toDouble(),
    finalQtCl:
        map['finalQtCl'] == null ? 0.0 : (map['finalQtCl'] as num).toDouble(),
  );
}