Files
prosappweb/lib/models/usuario.dart
T
Lizandro GuarnizoandClaude Sonnet 4.6 15175c1b91 replace: swap prosappweb content for prosapp_web_app (more complete version)
prosapp_web_app has chat, dashboard, calendar, support, 13 providers and
Fluro URL routing. Keep Dockerfile + nginx.conf from previous prosappweb.
Upgrade google_fonts 6.2.1 → 8.1.0 (Dart 3.12 compat fix).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 15:26:32 -05:00

67 lines
1.6 KiB
Dart

import 'package:prosapp_web_app/models/pro_state.dart';
class Usuario {
final String id;
final String? email;
final String? phone;
final String name;
final String? nickname;
final String? city;
final String? picture;
final String? birthday;
final String? gender;
final ProState proState;
final String? token;
Usuario({
required this.id,
required this.email,
required this.phone,
required this.name,
required this.nickname,
required this.city,
required this.picture,
required this.birthday,
required this.gender,
required this.proState,
required this.token,
});
Map<String, Object?> toDocument() {
return {
'id': id,
'email': email,
'phone': phone,
'name': name,
'nickname': name.toLowerCase().trim().replaceAll(' ', '_'),
'city': city,
'picture': picture,
'birthday': birthday,
'gender': gender,
'professional_state': enumToInt(proState),
'token': token,
};
}
static Usuario fromDocument(Map<String, dynamic> doc) {
return Usuario(
id: doc['id'],
email: doc['email'],
phone: doc['phone'],
name: doc['name'] ?? '',
nickname: doc['nickname'],
city: doc['city'],
picture: doc['picture'],
birthday: doc['birthday'],
gender: doc['gender'],
proState: intToEnum(doc['professional_state'] as int),
token: doc['token'],
);
}
@override
String toString() {
return 'User(id: $id, email: $email, phone: $phone, name: $name, nickname: $nickname, city: $city, picture: $picture, birthday: $birthday, gender: $gender, proState: $proState, token: $token)';
}
}