service_time_period_entity.g.dart 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/service_time_period_entity.dart';
  3. ServiceTimePeriodEntity $ServiceTimePeriodEntityFromJson(
  4. Map<String, dynamic> json) {
  5. final ServiceTimePeriodEntity serviceTimePeriodEntity = ServiceTimePeriodEntity();
  6. final String? timeText = jsonConvert.convert<String>(json['time_text']);
  7. if (timeText != null) {
  8. serviceTimePeriodEntity.timeText = timeText;
  9. }
  10. final String? time = jsonConvert.convert<String>(json['time']);
  11. if (time != null) {
  12. serviceTimePeriodEntity.time = time;
  13. }
  14. final bool? urgent = jsonConvert.convert<bool>(json['urgent']);
  15. if (urgent != null) {
  16. serviceTimePeriodEntity.urgent = urgent;
  17. }
  18. final bool? holiday = jsonConvert.convert<bool>(json['holiday']);
  19. if (holiday != null) {
  20. serviceTimePeriodEntity.holiday = holiday;
  21. }
  22. final bool? night = jsonConvert.convert<bool>(json['night']);
  23. if (night != null) {
  24. serviceTimePeriodEntity.night = night;
  25. }
  26. final bool? enable = jsonConvert.convert<bool>(json['enable']);
  27. if (enable != null) {
  28. serviceTimePeriodEntity.enable = enable;
  29. }
  30. return serviceTimePeriodEntity;
  31. }
  32. Map<String, dynamic> $ServiceTimePeriodEntityToJson(
  33. ServiceTimePeriodEntity entity) {
  34. final Map<String, dynamic> data = <String, dynamic>{};
  35. data['time_text'] = entity.timeText;
  36. data['time'] = entity.time;
  37. data['urgent'] = entity.urgent;
  38. data['holiday'] = entity.holiday;
  39. data['night'] = entity.night;
  40. data['enable'] = entity.enable;
  41. return data;
  42. }
  43. extension ServiceTimePeriodEntityExtension on ServiceTimePeriodEntity {
  44. ServiceTimePeriodEntity copyWith({
  45. String? timeText,
  46. String? time,
  47. bool? urgent,
  48. bool? holiday,
  49. bool? night,
  50. bool? enable,
  51. }) {
  52. return ServiceTimePeriodEntity()
  53. ..timeText = timeText ?? this.timeText
  54. ..time = time ?? this.time
  55. ..urgent = urgent ?? this.urgent
  56. ..holiday = holiday ?? this.holiday
  57. ..night = night ?? this.night
  58. ..enable = enable ?? this.enable;
  59. }
  60. }