Gestión de usuarios y avatares en la aplicación. Gestión de traducciones de las palabras.
This commit is contained in:
@@ -2,14 +2,18 @@
|
||||
class Usuario {
|
||||
final String id;
|
||||
final String nombre;
|
||||
final String? nick;
|
||||
final String? avatar;
|
||||
final String? foto;
|
||||
final String? creadoPorClienteId;
|
||||
final String? clienteIdSeleccionado;
|
||||
|
||||
Usuario({
|
||||
required this.id,
|
||||
required this.nombre,
|
||||
this.nick,
|
||||
this.avatar,
|
||||
this.foto,
|
||||
this.creadoPorClienteId,
|
||||
this.clienteIdSeleccionado,
|
||||
});
|
||||
@@ -20,7 +24,9 @@ class Usuario {
|
||||
Usuario copiar({
|
||||
String? id,
|
||||
String? nombre,
|
||||
String? nick,
|
||||
String? avatar,
|
||||
String? foto,
|
||||
String? creadoPorClienteId,
|
||||
String? clienteIdSeleccionado,
|
||||
bool liberarSeleccion = false,
|
||||
@@ -28,7 +34,9 @@ class Usuario {
|
||||
return Usuario(
|
||||
id: id ?? this.id,
|
||||
nombre: nombre ?? this.nombre,
|
||||
nick: nick ?? this.nick,
|
||||
avatar: avatar ?? this.avatar,
|
||||
foto: foto ?? this.foto,
|
||||
creadoPorClienteId: creadoPorClienteId ?? this.creadoPorClienteId,
|
||||
clienteIdSeleccionado: liberarSeleccion
|
||||
? null
|
||||
@@ -39,7 +47,9 @@ class Usuario {
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'nombre': nombre,
|
||||
if (nick != null) 'nick': nick,
|
||||
if (avatar != null) 'avatar': avatar,
|
||||
if (foto != null) 'foto': foto,
|
||||
if (creadoPorClienteId != null) 'creadoPorClienteId': creadoPorClienteId,
|
||||
if (clienteIdSeleccionado != null)
|
||||
'clienteIdSeleccionado': clienteIdSeleccionado,
|
||||
@@ -48,7 +58,9 @@ class Usuario {
|
||||
factory Usuario.fromJson(Map<String, dynamic> json) => Usuario(
|
||||
id: json['id'] as String,
|
||||
nombre: json['nombre'] as String,
|
||||
nick: json['nick'] as String?,
|
||||
avatar: json['avatar'] as String?,
|
||||
foto: json['foto'] as String?,
|
||||
creadoPorClienteId: json['creadoPorClienteId'] as String?,
|
||||
clienteIdSeleccionado: json['clienteIdSeleccionado'] as String?,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user