mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-07 05:32:26 -04:00
more refactor
This commit is contained in:
parent
ba4ef05a28
commit
b83aa3a64b
39 changed files with 722 additions and 514 deletions
22
lib/account_manager/models/account_info.dart
Normal file
22
lib/account_manager/models/account_info.dart
Normal file
|
@ -0,0 +1,22 @@
|
|||
import 'package:meta/meta.dart';
|
||||
import 'package:veilid_support/veilid_support.dart';
|
||||
|
||||
enum AccountInfoStatus {
|
||||
noAccount,
|
||||
accountInvalid,
|
||||
accountLocked,
|
||||
accountReady,
|
||||
}
|
||||
|
||||
@immutable
|
||||
class AccountInfo {
|
||||
const AccountInfo({
|
||||
required this.status,
|
||||
required this.active,
|
||||
this.accountRecord,
|
||||
});
|
||||
|
||||
final AccountInfoStatus status;
|
||||
final bool active;
|
||||
final DHTRecord? accountRecord;
|
||||
}
|
26
lib/account_manager/models/active_account_info.dart
Normal file
26
lib/account_manager/models/active_account_info.dart
Normal file
|
@ -0,0 +1,26 @@
|
|||
import 'package:meta/meta.dart';
|
||||
import 'package:veilid_support/veilid_support.dart';
|
||||
|
||||
import 'local_account/local_account.dart';
|
||||
import 'user_login/user_login.dart';
|
||||
|
||||
@immutable
|
||||
class ActiveAccountInfo {
|
||||
const ActiveAccountInfo({
|
||||
required this.localAccount,
|
||||
required this.userLogin,
|
||||
required this.accountRecord,
|
||||
});
|
||||
//
|
||||
|
||||
KeyPair getConversationWriter() {
|
||||
final identityKey = localAccount.identityMaster.identityPublicKey;
|
||||
final identitySecret = userLogin.identitySecret;
|
||||
return KeyPair(key: identityKey, secret: identitySecret.value);
|
||||
}
|
||||
|
||||
//
|
||||
final LocalAccount localAccount;
|
||||
final UserLogin userLogin;
|
||||
final DHTRecord accountRecord;
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
export 'account_info.dart';
|
||||
export 'active_account_info.dart';
|
||||
export 'encryption_key_type.dart';
|
||||
export 'local_account/local_account.dart';
|
||||
export 'new_profile_spec.dart';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue