class Session { bool isRememberMe; String host; String email; String password; Session({this.isRememberMe, this.host, this.email, this.password}); factory Session.fromJson(Map json) { return new Session( isRememberMe: json['isRememberMe'] as bool, host: json['host'] as String, email: json['email'] as String, password: json['password'] as String ); } Map toMap() { return { 'isRememberMe': isRememberMe, 'host': host, 'email': email, 'password': password }; } @override String toString() { return '{isRememberMe: $isRememberMe, host: $host, email: $email, password: $password}'; } }