38 lines
734 B
Dart
38 lines
734 B
Dart
class ServerCommand {
|
|
String name;
|
|
String ip;
|
|
String username;
|
|
String password;
|
|
String command;
|
|
|
|
ServerCommand({
|
|
required this.name,
|
|
required this.ip,
|
|
required this.username,
|
|
required this.password,
|
|
required this.command,
|
|
});
|
|
|
|
// Convert Object to Map
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'name': name,
|
|
'ip': ip,
|
|
'username': username,
|
|
'password': password,
|
|
'command': command,
|
|
};
|
|
}
|
|
|
|
// Create Object from Map
|
|
factory ServerCommand.fromMap(Map<String, dynamic> map) {
|
|
return ServerCommand(
|
|
name: map['name'],
|
|
ip: map['ip'],
|
|
username: map['username'],
|
|
password: map['password'],
|
|
command: map['command'],
|
|
);
|
|
}
|
|
}
|