✨ E2EE and Keypair
This commit is contained in:
@ -12,6 +12,7 @@ class Channel {
|
||||
Account account;
|
||||
int accountId;
|
||||
int? realmId;
|
||||
bool isEncrypted;
|
||||
|
||||
bool isAvailable = false;
|
||||
|
||||
@ -26,6 +27,7 @@ class Channel {
|
||||
required this.type,
|
||||
required this.account,
|
||||
required this.accountId,
|
||||
required this.isEncrypted,
|
||||
this.realmId,
|
||||
});
|
||||
|
||||
@ -41,6 +43,7 @@ class Channel {
|
||||
account: Account.fromJson(json['account']),
|
||||
accountId: json['account_id'],
|
||||
realmId: json['realm_id'],
|
||||
isEncrypted: json['is_encrypted'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
@ -55,6 +58,7 @@ class Channel {
|
||||
'account': account,
|
||||
'account_id': accountId,
|
||||
'realm_id': realmId,
|
||||
'is_encrypted': isEncrypted,
|
||||
};
|
||||
}
|
||||
|
||||
|
32
lib/models/keypair.dart
Normal file
32
lib/models/keypair.dart
Normal file
@ -0,0 +1,32 @@
|
||||
class Keypair {
|
||||
final String id;
|
||||
final String algorithm;
|
||||
final String publicKey;
|
||||
final String? privateKey;
|
||||
|
||||
final bool isOwned;
|
||||
|
||||
Keypair({
|
||||
required this.id,
|
||||
required this.algorithm,
|
||||
required this.publicKey,
|
||||
required this.privateKey,
|
||||
this.isOwned = false,
|
||||
});
|
||||
|
||||
factory Keypair.fromJson(Map<String, dynamic> json) => Keypair(
|
||||
id: json['id'],
|
||||
algorithm: json['algorithm'],
|
||||
publicKey: json['public_key'],
|
||||
privateKey: json['private_key'],
|
||||
isOwned: json['is_owned'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'id': id,
|
||||
'algorithm': algorithm,
|
||||
'public_key': publicKey,
|
||||
'private_key': privateKey,
|
||||
'is_owned': isOwned,
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user