TF-1317 Update authentication account to store AccountId
This commit is contained in:
@@ -1,13 +1,30 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:model/account/authentication_type.dart';
|
||||
|
||||
class Account with EquatableMixin {
|
||||
final String id;
|
||||
final AuthenticationType authenticationType;
|
||||
final bool isSelected;
|
||||
final AccountId? accountId;
|
||||
final String? apiUrl;
|
||||
|
||||
Account(this.id, this.authenticationType, {required this.isSelected});
|
||||
Account(
|
||||
this.id,
|
||||
this.authenticationType,
|
||||
{
|
||||
required this.isSelected,
|
||||
this.accountId,
|
||||
this.apiUrl,
|
||||
}
|
||||
);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, authenticationType, isSelected];
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
authenticationType,
|
||||
isSelected,
|
||||
accountId,
|
||||
apiUrl
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:model/account/account.dart';
|
||||
|
||||
extension AccountExtension on Account {
|
||||
|
||||
Account fromAccountId({required AccountId accountId, required String apiUrl}) {
|
||||
return Account(
|
||||
id,
|
||||
authenticationType,
|
||||
isSelected: isSelected,
|
||||
accountId: accountId,
|
||||
apiUrl: apiUrl
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,7 @@ export 'extensions/user_profile_extension.dart';
|
||||
export 'extensions/utc_date_extension.dart';
|
||||
export 'extensions/email_filter_condition_extension.dart';
|
||||
export 'extensions/list_email_header_extension.dart';
|
||||
export 'extensions/account_extension.dart';
|
||||
// Identity
|
||||
export 'identity/identity_request_dto.dart';
|
||||
export 'mailbox/expand_mode.dart';
|
||||
|
||||
Reference in New Issue
Block a user