CustomerService.dart 635 B

123456789101112131415161718192021222324
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'CustomerService.g.dart';
  3. @JsonSerializable()
  4. class CustomerService {
  5. CustomerService(this.id, this.serviceName, this.icon, this.telephone,this.wchat,this.qq);
  6. int id;
  7. String serviceName;
  8. String icon;
  9. String telephone;
  10. String wchat;
  11. String qq;
  12. factory CustomerService.fromJson(Map<String, dynamic> json) =>
  13. _$CustomerServiceFromJson(json);
  14. Map<String, dynamic> toJson() => _$CustomerServiceToJson(this);
  15. // 命名构造函数
  16. CustomerService.empty();
  17. @override
  18. String toString() {
  19. return _$CustomerServiceToJson(this).toString();
  20. }
  21. }