manager-app/lib/Models/session.dart
2026-03-13 17:40:55 +01:00

40 lines
1.0 KiB
Dart

class Session {
bool rememberMe;
String? host;
String? email;
String? token;
String? password;
String? instanceId;
int? role;
Session({required this.rememberMe, this.host, this.email, this.token, this.password, this.instanceId, this.role});
factory Session.fromJson(Map<String, dynamic> json) {
return new Session(
rememberMe: json['rememberMe'] as bool,
host: json['host'] as String?,
email: json['email'] as String?,
token: json['token'] as String?,
password: json['password'] as String?,
instanceId: json['instanceId'] as String?,
role: json['role'] as int?,
);
}
Map<String, dynamic> toMap() {
return {
'rememberMe': rememberMe,
'host': host,
'email': email,
'token': token,
'password': password,
'instanceId': instanceId,
'role': role,
};
}
@override
String toString() {
return '{rememberMe: $rememberMe, host: $host, email: $email, token: $token, password: $password, instanceId: $instanceId, role: $role}';
}
}