class CartonSize {
  String id;
  String name;
  double length;
  double width;
  double height;
  CartonSize({this.id, this.name, this.length, this.width, this.height});

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'name': name,
      'length': length,
      'width': width,
      'height': height,
    };
  }

  factory CartonSize.fromMap(Map<String, dynamic> map, String id) {
    return CartonSize(
      id: id,
      name: map['name'],
      length: map['length'],
      width: map['width'],
      height: map['height'],
    );
  }

  bool isChangedForEdit(CartonSize cartonSize) {
    return cartonSize.name != this.name ||
        cartonSize.length != this.length ||
        cartonSize.width != this.width ||
        cartonSize.height != this.height;
  }
}
