usuario_model.dart 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'basico_model.dart';
  2. class Usuario extends Basico {
  3. String? correo;
  4. String? clave;
  5. String? nombre;
  6. String? estatus;
  7. String? telefono;
  8. String? empresa;
  9. String? rol;
  10. Usuario({
  11. super.id,
  12. this.correo,
  13. this.clave,
  14. this.nombre,
  15. this.estatus,
  16. this.telefono,
  17. this.empresa,
  18. this.rol,
  19. });
  20. @override
  21. Map<String, dynamic> toJson() {
  22. return {
  23. 'id': id,
  24. 'correo': correo,
  25. 'clave': clave,
  26. 'nombre': nombre,
  27. 'estatus': estatus,
  28. 'telefono': telefono,
  29. 'empresa': empresa,
  30. 'rol': rol,
  31. }..addAll(super.toJson());
  32. }
  33. Usuario.fromJson(Map<String, dynamic> json) {
  34. super.parseJson(json);
  35. correo = Basico.parseString(json['correo']);
  36. clave = Basico.parseString(json['clave']);
  37. nombre = Basico.parseString(json['nombre']);
  38. estatus = Basico.parseString(json['estatus']);
  39. telefono = Basico.parseString(json['telefono']);
  40. empresa = Basico.parseString(json['empresa']);
  41. rol = Basico.parseString(json['rol']);
  42. }
  43. }