diff --git a/lib/features/email/presentation/email_view.dart b/lib/features/email/presentation/email_view.dart index 11b61aabd..c67744c61 100644 --- a/lib/features/email/presentation/email_view.dart +++ b/lib/features/email/presentation/email_view.dart @@ -218,16 +218,11 @@ class EmailView extends GetWidget { ); if (PlatformInfo.isMobile) { - return ColoredBox( - color: controller.responsiveUtils.isWebDesktop(context) - ? AppColor.colorBgDesktop - : Colors.white, - child: SafeArea( - right: controller.responsiveUtils.isLandscapeMobile(context), - left: controller.responsiveUtils.isLandscapeMobile(context), - bottom: !PlatformInfo.isIOS, - child: bodyWidget, - ), + return SafeArea( + right: controller.responsiveUtils.isLandscapeMobile(context), + left: controller.responsiveUtils.isLandscapeMobile(context), + bottom: !PlatformInfo.isIOS, + child: bodyWidget, ); } else { return bodyWidget; @@ -235,14 +230,9 @@ class EmailView extends GetWidget { } BoxDecoration _getDecorationEmailView(BuildContext context) { - if (controller.responsiveUtils.isWebDesktop(context) && !isInsideThreadDetailView) { - return const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: Colors.white, - ); - } - - if (controller.currentEmail == null || isFirstEmailInThreadDetail) { + if ((controller.responsiveUtils.isWebDesktop(context) && !isInsideThreadDetailView) || + controller.currentEmail == null || + isFirstEmailInThreadDetail) { return const BoxDecoration(color: Colors.white); } diff --git a/lib/features/email/presentation/widgets/email_view_app_bar_widget.dart b/lib/features/email/presentation/widgets/email_view_app_bar_widget.dart index aa9be010a..1233f9320 100644 --- a/lib/features/email/presentation/widgets/email_view_app_bar_widget.dart +++ b/lib/features/email/presentation/widgets/email_view_app_bar_widget.dart @@ -73,10 +73,6 @@ class EmailViewAppBarWidget extends StatelessWidget { width: EmailViewAppBarWidgetStyles.bottomBorderWidth, ) ), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(EmailViewAppBarWidgetStyles.radius), - topRight: Radius.circular(EmailViewAppBarWidgetStyles.radius), - ), color: EmailViewAppBarWidgetStyles.backgroundColor, ), child: Row(mainAxisAlignment: MainAxisAlignment.end, children: [ diff --git a/lib/features/thread_detail/presentation/thread_detail_view.dart b/lib/features/thread_detail/presentation/thread_detail_view.dart index 060907c02..fd98e7aa0 100644 --- a/lib/features/thread_detail/presentation/thread_detail_view.dart +++ b/lib/features/thread_detail/presentation/thread_detail_view.dart @@ -97,17 +97,23 @@ class ThreadDetailView extends GetWidget { ); }), Obx(() { + final threadChildren = controller.getThreadDetailEmailViews(); + + late Widget threadBody; + + if (threadChildren.length == 1) { + threadBody = threadChildren.first; + } else { + threadBody = Column( + mainAxisSize: MainAxisSize.min, + children: threadChildren, + ); + } + final nonPageViewThread = Expanded( - child: Container( - color: Colors.white, - padding: _padding(context), - child: SingleChildScrollView( - controller: controller.scrollController, - child: Column( - mainAxisSize: MainAxisSize.min, - children: controller.getThreadDetailEmailViews() - ), - ), + child: SingleChildScrollView( + controller: controller.scrollController, + child: threadBody, ), ); @@ -127,13 +133,7 @@ class ThreadDetailView extends GetWidget { if (index != currentIndex) { return const SizedBox.shrink(); } - - return SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - children: controller.getThreadDetailEmailViews() - ), - ); + return SingleChildScrollView(child: threadBody); }, onPageChanged: controller.onThreadPageChanged, ), @@ -157,42 +157,30 @@ class ThreadDetailView extends GetWidget { return const SizedBox.shrink(); } - return Padding( - padding: controller.responsiveUtils.isDesktop(context) - ? const EdgeInsetsDirectional.only(end: 16) - : EdgeInsets.zero, - child: ClipRRect( - borderRadius: const BorderRadius.vertical( - bottom: Radius.circular(20), - ), - child: EmailViewBottomBarWidget( - key: const Key('email_view_button_bar'), - imagePaths: controller.imagePaths, - responsiveUtils: controller.responsiveUtils, - emailLoaded: currentEmailLoaded, - presentationEmail: expandedPresentationEmail, - userName: controller.session?.getOwnEmailAddress() ?? '', - emailActionCallback: (action, email) { - controller.mailboxDashBoardController - ..dispatchEmailUIAction(PerformEmailActionInThreadDetailAction( - emailActionType: action, - presentationEmail: email, - )) - ..dispatchEmailUIAction(EmailUIAction()); - }, - bottomBarDecoration: const BoxDecoration( - color: Colors.white, - border: Border( - top: BorderSide(color: AppColor.colorDividerEmailView), - ), - ), - padding: EdgeInsets.zero, + return EmailViewBottomBarWidget( + key: const Key('email_view_button_bar'), + imagePaths: controller.imagePaths, + responsiveUtils: controller.responsiveUtils, + emailLoaded: currentEmailLoaded, + presentationEmail: expandedPresentationEmail, + userName: controller.session?.getOwnEmailAddress() ?? '', + emailActionCallback: (action, email) { + controller.mailboxDashBoardController + ..dispatchEmailUIAction(PerformEmailActionInThreadDetailAction( + emailActionType: action, + presentationEmail: email, + )) + ..dispatchEmailUIAction(EmailUIAction()); + }, + bottomBarDecoration: const BoxDecoration( + color: Colors.white, + border: Border( + top: BorderSide(color: AppColor.colorDividerEmailView), ), ), + padding: EdgeInsets.zero, ); }), - if (controller.responsiveUtils.isDesktop(context)) - const SizedBox(height: 16), ], ); @@ -204,17 +192,19 @@ class ThreadDetailView extends GetWidget { bodyWidget = SelectionArea(child: bodyWidget); } - return ClipRRect( - borderRadius: const BorderRadius.vertical(bottom: Radius.circular(20)), - child: bodyWidget, - ); - } - - EdgeInsetsGeometry _padding(BuildContext context) { if (controller.responsiveUtils.isDesktop(context)) { - return const EdgeInsetsDirectional.only(end: 16); + return Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: Colors.white, + ), + margin: const EdgeInsetsDirectional.only(end: 16, bottom: 16), + clipBehavior: Clip.antiAlias, + child: bodyWidget, + ); + } else { + return ColoredBox(color: Colors.white, child: bodyWidget); } - return EdgeInsets.zero; } PresentationMailbox? _getMailboxContain() { diff --git a/lib/features/thread_detail/presentation/widgets/thread_detail_app_bar.dart b/lib/features/thread_detail/presentation/widgets/thread_detail_app_bar.dart index fa2a4faa3..28a60df8c 100644 --- a/lib/features/thread_detail/presentation/widgets/thread_detail_app_bar.dart +++ b/lib/features/thread_detail/presentation/widgets/thread_detail_app_bar.dart @@ -71,9 +71,6 @@ class ThreadDetailAppBar extends StatelessWidget { padding: PlatformInfo.isIOS ? EmailViewAppBarWidgetStyles.paddingIOS(context, responsiveUtils) : EmailViewAppBarWidgetStyles.padding, - margin: !PlatformInfo.isMobile && responsiveUtils.isDesktop(context) - ? const EdgeInsetsDirectional.only(end: 16) - : EdgeInsets.zero, decoration: const BoxDecoration( border: Border( bottom: BorderSide( @@ -81,9 +78,6 @@ class ThreadDetailAppBar extends StatelessWidget { width: EmailViewAppBarWidgetStyles.bottomBorderWidth, ), ), - borderRadius: BorderRadius.vertical( - top: Radius.circular(EmailViewAppBarWidgetStyles.radius), - ), color: EmailViewAppBarWidgetStyles.backgroundColor, ), child: Row(