37 lines
958 B
Dart
37 lines
958 B
Dart
class Session {
|
|
bool rememberMe;
|
|
String? host;
|
|
String? email;
|
|
String? token;
|
|
String? password;
|
|
String? instanceId;
|
|
|
|
Session({required this.rememberMe, this.host, this.email, this.token, this.password, this.instanceId});
|
|
|
|
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,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'rememberMe': rememberMe,
|
|
'host': host,
|
|
'email': email,
|
|
'token': token,
|
|
'password': password,
|
|
'instanceId': instanceId
|
|
};
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return '{rememberMe: $rememberMe, host: $host, email: $email, token: $token, password: $password, instanceId: $instanceId}';
|
|
}
|
|
} |