TF-1014: [Dev] Show quota at the bottom of mailbox

This commit is contained in:
ManhNTX
2022-11-09 16:49:01 +07:00
committed by Dat H. Pham
parent 21f027246b
commit 75495e7d1f
28 changed files with 508 additions and 6 deletions
@@ -0,0 +1,23 @@
import 'dart:core';
import 'package:core/core.dart';
import 'package:dartz/dartz.dart';
import 'package:jmap_dart_client/jmap/account_id.dart';
import 'package:tmail_ui_user/features/quotas/domain/repository/quotas_repository.dart';
import 'package:tmail_ui_user/features/quotas/domain/state/get_quotas_state.dart';
class GetQuotasInteractor {
final QuotasRepository quotasRepository;
GetQuotasInteractor(this.quotasRepository);
Stream<Either<Failure, Success>> execute(AccountId accountId) async* {
try {
yield Right<Failure, Success>(LoadingState());
final response = await quotasRepository.getQuotas(accountId);
yield Right(GetQuotasSuccess(response.quotas, response.state));
} catch (exception) {
yield Left(GetQuotasFailure(exception));
}
}
}