You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
710B

  1. import 'package:equatable/equatable.dart';
  2. class ProductUnit extends Equatable {
  3. ProductUnit({
  4. this.id,
  5. this.key,
  6. this.name,
  7. });
  8. final int? id;
  9. final String? key;
  10. final String? name;
  11. ProductUnit copyWith({
  12. int? id,
  13. String? key,
  14. String? name,
  15. }) {
  16. return ProductUnit(
  17. id: id ?? this.id,
  18. key: key ?? this.key,
  19. name: name ?? this.name,
  20. );
  21. }
  22. factory ProductUnit.fromJson(Map<String, dynamic> json) {
  23. return ProductUnit(
  24. id: json["id"],
  25. key: json["key"],
  26. name: json["name"],
  27. );
  28. }
  29. Map<String, dynamic> toJson() => {"id": id, "key": key, "name": name};
  30. @override
  31. List<Object?> get props => [id, key, name];
  32. }