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