Gestión de usuarios y avatares en la aplicación. Gestión de traducciones de las palabras.
This commit is contained in:
@@ -204,7 +204,12 @@ class ServicioNearby extends ChangeNotifier {
|
||||
|
||||
// ==================== HOST ====================
|
||||
|
||||
Future<bool> iniciarHost(String nombreSala, String miNombre) async {
|
||||
Future<bool> iniciarHost(
|
||||
String nombreSala,
|
||||
String miNombre, {
|
||||
String? miNick,
|
||||
String? miAvatar,
|
||||
}) async {
|
||||
_nombreSala = nombreSala;
|
||||
_miNombre = miNombre;
|
||||
_roomId = DateTime.now().microsecondsSinceEpoch.toString();
|
||||
@@ -222,6 +227,9 @@ class ServicioNearby extends ChangeNotifier {
|
||||
final usuarioHost = Usuario(
|
||||
id: 'u-${_roomId!}-host',
|
||||
nombre: miNombre,
|
||||
nick: miNick,
|
||||
avatar: miAvatar,
|
||||
foto: miAvatar,
|
||||
creadoPorClienteId: _hostClientId,
|
||||
clienteIdSeleccionado: _hostClientId,
|
||||
);
|
||||
@@ -654,13 +662,21 @@ class ServicioNearby extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> crearUsuarioSala(String nombre, {bool seleccionar = true}) async {
|
||||
Future<void> crearUsuarioSala(
|
||||
String nombre, {
|
||||
bool seleccionar = true,
|
||||
String? nick,
|
||||
String? avatar,
|
||||
}) async {
|
||||
final nombreLimpio = nombre.trim();
|
||||
if (nombreLimpio.isEmpty) return;
|
||||
final clientId = _miClientId;
|
||||
final usuario = Usuario(
|
||||
id: 'u-${DateTime.now().microsecondsSinceEpoch}',
|
||||
nombre: nombreLimpio,
|
||||
nick: nick,
|
||||
avatar: avatar,
|
||||
foto: avatar,
|
||||
creadoPorClienteId: clientId,
|
||||
);
|
||||
if (_esHost && _estadoSala != null && clientId != null) {
|
||||
|
||||
Reference in New Issue
Block a user