TF-56 Create object LoadingState

This commit is contained in:
dab246
2021-09-17 18:00:22 +07:00
committed by Dat H. Pham
parent 926f249897
commit 430f21bdaf
9 changed files with 108 additions and 103 deletions
@@ -14,7 +14,7 @@ class GetAllMailboxInteractor {
Stream<Either<Failure, Success>> execute(AccountId accountId, {Properties? properties}) async* {
try {
yield Right<Failure, Success>(UIState.loading);
yield Right<Failure, Success>(LoadingState());
final mailboxList = await mailboxRepository.getAllMailbox(accountId, properties: properties);
final tupleList = mailboxList.splitMailboxList((mailbox) => mailbox.hasRole());
yield Right<Failure, Success>(GetAllMailboxSuccess(defaultMailboxList: tupleList.value1, folderMailboxList: tupleList.value2));
@@ -110,7 +110,7 @@ class MailboxView extends GetWidget<MailboxController> {
Widget _buildLoadingView() {
return Obx(() => controller.viewState.value.fold(
(failure) => SizedBox.shrink(),
(success) => success == UIState.loading
(success) => success is LoadingState
? Center(child: Padding(
padding: EdgeInsets.only(top: 16),
child: SizedBox(