fluxcloud/lib/user.dart

37 lines
754 B
Dart
Raw Normal View History

2025-07-22 14:35:22 +05:00
import 'dart:convert';
class Connection {
String? host;
int? port;
String? username;
String? privateKeyFilePath;
String? password;
Connection();
Connection.fromJson(Map<String, dynamic> json) {
host = json['host'];
port = json['port'];
username = json['username'];
privateKeyFilePath = json['privateKeyFilePath)'];
password = json['password'];
}
String get toJson => jsonEncode({
'host': host,
'port': port,
'username': username,
'privateKeyFilePath': privateKeyFilePath,
'password': password
});
bool assertComplete() {
assert(host != null);
assert(port != null);
assert(username != null);
assert(privateKeyFilePath != null || password != null);
return true;
}
}