Fix HtmlElementView with too long content being cut off on Safari
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -63,149 +63,147 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SelectionArea(
|
return ColoredBox(
|
||||||
child: ColoredBox(
|
color: controller.responsiveUtils.isWebDesktop(context)
|
||||||
color: controller.responsiveUtils.isWebDesktop(context)
|
? AppColor.colorBgDesktop
|
||||||
? AppColor.colorBgDesktop
|
: Colors.white,
|
||||||
: Colors.white,
|
child: SafeArea(
|
||||||
child: SafeArea(
|
right: controller.responsiveUtils.isLandscapeMobile(context),
|
||||||
right: controller.responsiveUtils.isLandscapeMobile(context),
|
left: controller.responsiveUtils.isLandscapeMobile(context),
|
||||||
left: controller.responsiveUtils.isLandscapeMobile(context),
|
bottom: !PlatformInfo.isIOS,
|
||||||
bottom: !PlatformInfo.isIOS,
|
child: Container(
|
||||||
child: Container(
|
clipBehavior: Clip.antiAlias,
|
||||||
clipBehavior: Clip.antiAlias,
|
decoration: _getDecorationEmailView(context),
|
||||||
decoration: _getDecorationEmailView(context),
|
margin: _getMarginEmailView(context),
|
||||||
margin: _getMarginEmailView(context),
|
child: Obx(() {
|
||||||
child: Obx(() {
|
final currentEmailListener = Rxn(controller.currentEmail);
|
||||||
final currentEmailListener = Rxn(controller.currentEmail);
|
final currentEmail = currentEmailListener.value;
|
||||||
final currentEmail = currentEmailListener.value;
|
if (currentEmail != null) {
|
||||||
if (currentEmail != null) {
|
return Column(children: [
|
||||||
return Column(children: [
|
if (!isInsideThreadDetailView)
|
||||||
if (!isInsideThreadDetailView)
|
Obx(() => EmailViewAppBarWidget(
|
||||||
Obx(() => EmailViewAppBarWidget(
|
key: const Key('email_view_app_bar_widget'),
|
||||||
key: const Key('email_view_app_bar_widget'),
|
presentationEmail: currentEmail,
|
||||||
presentationEmail: currentEmail,
|
mailboxContain: _getMailboxContain(currentEmail),
|
||||||
mailboxContain: _getMailboxContain(currentEmail),
|
isSearchActivated: controller.mailboxDashBoardController.searchController.isSearchEmailRunning,
|
||||||
isSearchActivated: controller.mailboxDashBoardController.searchController.isSearchEmailRunning,
|
onBackAction: () => controller.closeEmailView(context: context),
|
||||||
onBackAction: () => controller.closeEmailView(context: context),
|
onEmailActionClick: (email, action) => controller.handleEmailAction(context, email, action),
|
||||||
onEmailActionClick: (email, action) => controller.handleEmailAction(context, email, action),
|
onMoreActionClick: (presentationEmail, position) => controller.emailActionReactor.handleMoreEmailAction(
|
||||||
onMoreActionClick: (presentationEmail, position) => controller.emailActionReactor.handleMoreEmailAction(
|
mailboxContain: controller.getMailboxContain(presentationEmail),
|
||||||
mailboxContain: controller.getMailboxContain(presentationEmail),
|
presentationEmail: presentationEmail,
|
||||||
presentationEmail: presentationEmail,
|
position: position,
|
||||||
position: position,
|
responsiveUtils: controller.responsiveUtils,
|
||||||
responsiveUtils: controller.responsiveUtils,
|
imagePaths: controller.imagePaths,
|
||||||
imagePaths: controller.imagePaths,
|
username: controller.session?.username,
|
||||||
username: controller.session?.username,
|
handleEmailAction: (email, action) => controller.handleEmailAction(context, email, action),
|
||||||
handleEmailAction: (email, action) => controller.handleEmailAction(context, email, action),
|
additionalActions: [],
|
||||||
additionalActions: [],
|
emailIsRead: presentationEmail.hasRead,
|
||||||
emailIsRead: presentationEmail.hasRead,
|
openBottomSheetContextMenu: controller.mailboxDashBoardController.openBottomSheetContextMenu,
|
||||||
openBottomSheetContextMenu: controller.mailboxDashBoardController.openBottomSheetContextMenu,
|
openPopupMenu: controller.mailboxDashBoardController.openPopupMenu,
|
||||||
openPopupMenu: controller.mailboxDashBoardController.openPopupMenu,
|
),
|
||||||
),
|
supportBackAction: !isInsideThreadDetailView,
|
||||||
supportBackAction: !isInsideThreadDetailView,
|
appBarDecoration: isInsideThreadDetailView
|
||||||
appBarDecoration: isInsideThreadDetailView
|
? const BoxDecoration(border: Border(bottom: BorderSide(
|
||||||
? const BoxDecoration(border: Border(bottom: BorderSide(
|
color: AppColor.colorDividerEmailView,
|
||||||
color: AppColor.colorDividerEmailView,
|
)))
|
||||||
)))
|
: null,
|
||||||
: null,
|
emailLoaded: controller.currentEmailLoaded.value,
|
||||||
emailLoaded: controller.currentEmailLoaded.value,
|
isInsideThreadDetailView: isInsideThreadDetailView,
|
||||||
isInsideThreadDetailView: isInsideThreadDetailView,
|
)),
|
||||||
)),
|
Obx(() {
|
||||||
Obx(() {
|
final vacation = controller.mailboxDashBoardController.vacationResponse.value;
|
||||||
final vacation = controller.mailboxDashBoardController.vacationResponse.value;
|
if (vacation?.vacationResponderIsValid == true &&
|
||||||
if (vacation?.vacationResponderIsValid == true &&
|
(
|
||||||
(
|
controller.responsiveUtils.isMobile(context) ||
|
||||||
controller.responsiveUtils.isMobile(context) ||
|
controller.responsiveUtils.isTablet(context) ||
|
||||||
controller.responsiveUtils.isTablet(context) ||
|
controller.responsiveUtils.isLandscapeMobile(context)
|
||||||
controller.responsiveUtils.isLandscapeMobile(context)
|
)
|
||||||
|
) {
|
||||||
|
return VacationNotificationMessageWidget(
|
||||||
|
margin: const EdgeInsetsDirectional.only(start: 12, end: 12, top: 8),
|
||||||
|
vacationResponse: vacation!,
|
||||||
|
actionGotoVacationSetting: controller.mailboxDashBoardController.goToVacationSetting,
|
||||||
|
actionEndNow: controller.mailboxDashBoardController.disableVacationResponder
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
OptionalExpanded(
|
||||||
|
expandedEnabled: !isInsideThreadDetailView,
|
||||||
|
child: LayoutBuilder(builder: (context, constraints) {
|
||||||
|
if (PlatformInfo.isMobile) {
|
||||||
|
return OptionalScroll(
|
||||||
|
scrollEnabled: !isInsideThreadDetailView,
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Obx(() => _buildEmailMessage(
|
||||||
|
context: context,
|
||||||
|
presentationEmail: currentEmail,
|
||||||
|
calendarEvent: controller.calendarEvent,
|
||||||
|
maxBodyHeight: constraints.maxHeight
|
||||||
|
))
|
||||||
)
|
)
|
||||||
) {
|
|
||||||
return VacationNotificationMessageWidget(
|
|
||||||
margin: const EdgeInsetsDirectional.only(start: 12, end: 12, top: 8),
|
|
||||||
vacationResponse: vacation!,
|
|
||||||
actionGotoVacationSetting: controller.mailboxDashBoardController.goToVacationSetting,
|
|
||||||
actionEndNow: controller.mailboxDashBoardController.disableVacationResponder
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox.shrink();
|
return Obx(() {
|
||||||
}
|
final calendarEvent = controller.calendarEvent;
|
||||||
}),
|
if (currentEmail.hasCalendarEvent && calendarEvent != null) {
|
||||||
OptionalExpanded(
|
return Padding(
|
||||||
expandedEnabled: !isInsideThreadDetailView,
|
padding: const EdgeInsetsDirectional.symmetric(horizontal: 4),
|
||||||
child: LayoutBuilder(builder: (context, constraints) {
|
child: OptionalScroll(
|
||||||
if (PlatformInfo.isMobile) {
|
scrollEnabled: !isInsideThreadDetailView,
|
||||||
return OptionalScroll(
|
child: Container(
|
||||||
scrollEnabled: !isInsideThreadDetailView,
|
width: double.infinity,
|
||||||
child: Container(
|
alignment: Alignment.center,
|
||||||
width: double.infinity,
|
color: Colors.white,
|
||||||
alignment: Alignment.center,
|
child: _buildEmailMessage(
|
||||||
color: Colors.white,
|
context: context,
|
||||||
child: Obx(() => _buildEmailMessage(
|
presentationEmail: currentEmail,
|
||||||
context: context,
|
calendarEvent: calendarEvent,
|
||||||
presentationEmail: currentEmail,
|
emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(),
|
||||||
calendarEvent: controller.calendarEvent,
|
maxBodyHeight: constraints.maxHeight
|
||||||
maxBodyHeight: constraints.maxHeight
|
|
||||||
))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Obx(() {
|
|
||||||
final calendarEvent = controller.calendarEvent;
|
|
||||||
if (currentEmail.hasCalendarEvent && calendarEvent != null) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.symmetric(horizontal: 4),
|
|
||||||
child: OptionalScroll(
|
|
||||||
scrollEnabled: !isInsideThreadDetailView,
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
color: Colors.white,
|
|
||||||
child: _buildEmailMessage(
|
|
||||||
context: context,
|
|
||||||
presentationEmail: currentEmail,
|
|
||||||
calendarEvent: calendarEvent,
|
|
||||||
emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(),
|
|
||||||
maxBodyHeight: constraints.maxHeight
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
);
|
),
|
||||||
} else {
|
);
|
||||||
return _buildEmailMessage(
|
} else {
|
||||||
context: context,
|
return _buildEmailMessage(
|
||||||
presentationEmail: currentEmail,
|
context: context,
|
||||||
maxBodyHeight: constraints.maxHeight
|
presentationEmail: currentEmail,
|
||||||
);
|
maxBodyHeight: constraints.maxHeight
|
||||||
}
|
);
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
}),
|
|
||||||
),
|
|
||||||
Obx(() {
|
|
||||||
final emailLoaded = controller.currentEmailLoaded.value;
|
|
||||||
|
|
||||||
if (emailLoaded == null || isInsideThreadDetailView) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return EmailViewBottomBarWidget(
|
|
||||||
key: const Key('email_view_button_bar'),
|
|
||||||
imagePaths: controller.imagePaths,
|
|
||||||
responsiveUtils: controller.responsiveUtils,
|
|
||||||
emailLoaded: emailLoaded,
|
|
||||||
presentationEmail: currentEmail,
|
|
||||||
userName: controller.getOwnEmailAddress(),
|
|
||||||
emailActionCallback: controller.pressEmailAction,
|
|
||||||
);
|
|
||||||
}),
|
}),
|
||||||
]);
|
),
|
||||||
} else {
|
Obx(() {
|
||||||
return const EmailViewEmptyWidget();
|
final emailLoaded = controller.currentEmailLoaded.value;
|
||||||
}
|
|
||||||
})
|
if (emailLoaded == null || isInsideThreadDetailView) {
|
||||||
)
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
|
||||||
|
return EmailViewBottomBarWidget(
|
||||||
|
key: const Key('email_view_button_bar'),
|
||||||
|
imagePaths: controller.imagePaths,
|
||||||
|
responsiveUtils: controller.responsiveUtils,
|
||||||
|
emailLoaded: emailLoaded,
|
||||||
|
presentationEmail: currentEmail,
|
||||||
|
userName: controller.getOwnEmailAddress(),
|
||||||
|
emailActionCallback: controller.pressEmailAction,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
return const EmailViewEmptyWidget();
|
||||||
|
}
|
||||||
|
})
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user