TF-2536 Change the logic to get all mailbox
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import 'package:tmail_ui_user/features/mailbox/domain/model/mailbox_response.dart';
|
||||
|
||||
class CacheMailboxResponse extends MailboxResponse {
|
||||
|
||||
CacheMailboxResponse({required super.mailboxes, super.state});
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import 'package:tmail_ui_user/features/mailbox/domain/model/mailbox_response.dart';
|
||||
|
||||
class FullMailboxResponse extends MailboxResponse {
|
||||
|
||||
FullMailboxResponse({required super.mailboxes, super.state});
|
||||
}
|
||||
@@ -3,21 +3,15 @@ import 'package:equatable/equatable.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/state.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||
|
||||
class MailboxResponse with EquatableMixin {
|
||||
final List<Mailbox>? mailboxes;
|
||||
abstract class MailboxResponse with EquatableMixin {
|
||||
final List<Mailbox> mailboxes;
|
||||
final State? state;
|
||||
|
||||
MailboxResponse({
|
||||
this.mailboxes,
|
||||
required this.mailboxes,
|
||||
this.state
|
||||
});
|
||||
|
||||
bool hasData() {
|
||||
return mailboxes != null
|
||||
&& mailboxes!.isNotEmpty
|
||||
&& state != null;
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [mailboxes, state];
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/domain/model/mailbox_response.dart';
|
||||
|
||||
class PartialMailboxResponse extends MailboxResponse {
|
||||
|
||||
final List<Id> mailboxNotFound;
|
||||
|
||||
PartialMailboxResponse({
|
||||
required this.mailboxNotFound,
|
||||
required super.mailboxes,
|
||||
super.state,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [mailboxNotFound, ...super.props];
|
||||
}
|
||||
Reference in New Issue
Block a user