form done
This commit is contained in:
parent
02dc3e5757
commit
bd8884787d
10 changed files with 200 additions and 28 deletions
36
lib/user.dart
Normal file
36
lib/user.dart
Normal file
|
@ -0,0 +1,36 @@
|
|||
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue