check_duplicate_asset_response.model.dart 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'dart:convert';
  2. class CheckDuplicateAssetResponse {
  3. final bool isExist;
  4. CheckDuplicateAssetResponse({
  5. required this.isExist,
  6. });
  7. CheckDuplicateAssetResponse copyWith({
  8. bool? isExist,
  9. }) {
  10. return CheckDuplicateAssetResponse(
  11. isExist: isExist ?? this.isExist,
  12. );
  13. }
  14. Map<String, dynamic> toMap() {
  15. final result = <String, dynamic>{};
  16. result.addAll({'isExist': isExist});
  17. return result;
  18. }
  19. factory CheckDuplicateAssetResponse.fromMap(Map<String, dynamic> map) {
  20. return CheckDuplicateAssetResponse(
  21. isExist: map['isExist'] ?? false,
  22. );
  23. }
  24. String toJson() => json.encode(toMap());
  25. factory CheckDuplicateAssetResponse.fromJson(String source) =>
  26. CheckDuplicateAssetResponse.fromMap(json.decode(source));
  27. @override
  28. String toString() => 'CheckDuplicateAssetResponse(isExist: $isExist)';
  29. @override
  30. bool operator ==(Object other) {
  31. if (identical(this, other)) return true;
  32. return other is CheckDuplicateAssetResponse && other.isExist == isExist;
  33. }
  34. @override
  35. int get hashCode => isExist.hashCode;
  36. }