service_time_period_entity.g.dart 2.1 KB

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