TF-56 Create object LoadingState
This commit is contained in:
@@ -13,7 +13,7 @@ class GetEmailContentInteractor {
|
||||
|
||||
Stream<Either<Failure, Success>> execute(AccountId accountId, EmailId emailId) async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(UIState.loading);
|
||||
yield Right<Failure, Success>(LoadingState());
|
||||
final email = await emailRepository.getEmailContent(accountId, emailId);
|
||||
yield Right<Failure, Success>(GetEmailContentSuccess(email.toEmailContent()));
|
||||
} catch (e) {
|
||||
|
||||
@@ -115,7 +115,7 @@ class EmailView extends GetWidget {
|
||||
Widget _buildLoadingView() {
|
||||
return Obx(() => emailController.viewState.value.fold(
|
||||
(failure) => SizedBox.shrink(),
|
||||
(success) => success == UIState.loading
|
||||
(success) => success is LoadingState
|
||||
? Center(child: Padding(
|
||||
padding: EdgeInsets.only(top: 25, bottom: 16),
|
||||
child: SizedBox(
|
||||
|
||||
Reference in New Issue
Block a user