TF-2078 Fix ScrollController is currently attached to more than one ScrollPosition

(cherry picked from commit 96521061d8f0d4a6038180070cc9af6edc7dd70a)
This commit is contained in:
dab246
2023-08-10 19:32:56 +07:00
committed by Dat Vu
parent c938cc3d74
commit 5b87045b8a
2 changed files with 10 additions and 11 deletions
@@ -223,6 +223,7 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
log('SingleEmailController::_handleOpenEmailDetailedView(): email unselected'); log('SingleEmailController::_handleOpenEmailDetailedView(): email unselected');
return; return;
} }
dispatchState(Right<Failure, Success>(GetEmailContentLoading()));
emailSupervisorController.updateNewCurrentListEmail(); emailSupervisorController.updateNewCurrentListEmail();
_updateCurrentEmailId(selectedEmail.id); _updateCurrentEmailId(selectedEmail.id);
@@ -364,7 +365,6 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
final emailLoaded = emailSupervisorController.getEmailInQueueByEmailId(emailId); final emailLoaded = emailSupervisorController.getEmailInQueueByEmailId(emailId);
if (emailLoaded != null) { if (emailLoaded != null) {
dispatchState(Right<Failure, Success>(GetEmailContentLoading()));
consumeState(Stream.value(Right<Failure, Success>( consumeState(Stream.value(Right<Failure, Success>(
GetEmailContentSuccess( GetEmailContentSuccess(
emailContent: emailLoaded.emailContent, emailContent: emailLoaded.emailContent,
@@ -233,16 +233,15 @@ class EmailView extends GetWidget<SingleEmailController> with AppLoaderMixin {
return _buildEmailMessage(context, email); return _buildEmailMessage(context, email);
} else { } else {
return SingleChildScrollView( return SingleChildScrollView(
primary: true, physics : const ClampingScrollPhysics(),
physics : const ClampingScrollPhysics(), child: Container(
child: Container( margin: EdgeInsets.zero,
margin: EdgeInsets.zero, width: double.infinity,
width: double.infinity, alignment: Alignment.center,
alignment: Alignment.center, padding: EdgeInsets.zero,
padding: EdgeInsets.zero, color: Colors.white,
color: Colors.white, child: _buildEmailMessage(context, email)
child: _buildEmailMessage(context, email) )
)
); );
} }
} }