usuario_model.dart 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'basico_model.dart';
  2. class Usuario extends Basico {
  3. String? email;
  4. String? clave;
  5. String? name;
  6. String? estatus;
  7. String? telefono;
  8. String? empresa;
  9. String? rol;
  10. static const MEN_ADMN_VER = 'MEN-ADMN-VER';
  11. Usuario({
  12. super.id,
  13. this.email,
  14. this.clave,
  15. this.name,
  16. this.estatus,
  17. this.telefono,
  18. this.empresa,
  19. this.rol,
  20. });
  21. @override
  22. Map<String, dynamic> toJson() {
  23. return {
  24. 'id': id,
  25. 'email': email,
  26. 'clave': clave,
  27. 'name': name,
  28. 'estatus': estatus,
  29. 'telefono': telefono,
  30. 'rol': rol,
  31. }..addAll(super.toJson());
  32. }
  33. Usuario.fromJson(Map<String, dynamic> json) {
  34. super.parseJson(json);
  35. email = Basico.parseString(json['correo']);
  36. clave = Basico.parseString(json['clave']);
  37. name = 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. }