TF-2351 Apply scrollbar for email event calendar view

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 7e1207dba5fb801fd31a42ffa161824793ad68c4)
This commit is contained in:
dab246
2023-11-27 15:10:21 +07:00
committed by Dat H. Pham
parent af7c0982a7
commit 6469776a7b
2 changed files with 43 additions and 26 deletions
@@ -95,6 +95,7 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
final emailSupervisorController = Get.find<EmailSupervisorController>(); final emailSupervisorController = Get.find<EmailSupervisorController>();
final _downloadManager = Get.find<DownloadManager>(); final _downloadManager = Get.find<DownloadManager>();
final _attachmentListScrollController = ScrollController(); final _attachmentListScrollController = ScrollController();
final emailContentScrollController = ScrollController();
final GetEmailContentInteractor _getEmailContentInteractor; final GetEmailContentInteractor _getEmailContentInteractor;
final MarkAsEmailReadInteractor _markAsEmailReadInteractor; final MarkAsEmailReadInteractor _markAsEmailReadInteractor;
@@ -154,6 +155,7 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
void onClose() { void onClose() {
_downloadProgressStateController.close(); _downloadProgressStateController.close();
_attachmentListScrollController.dispose(); _attachmentListScrollController.dispose();
emailContentScrollController.dispose();
super.onClose(); super.onClose();
} }
+41 -26
View File
@@ -16,6 +16,7 @@ import 'package:model/extensions/presentation_mailbox_extension.dart';
import 'package:model/mailbox/presentation_mailbox.dart'; import 'package:model/mailbox/presentation_mailbox.dart';
import 'package:pointer_interceptor/pointer_interceptor.dart'; import 'package:pointer_interceptor/pointer_interceptor.dart';
import 'package:tmail_ui_user/features/base/widget/popup_item_widget.dart'; import 'package:tmail_ui_user/features/base/widget/popup_item_widget.dart';
import 'package:tmail_ui_user/features/base/widget/scrollbar_list_view.dart';
import 'package:tmail_ui_user/features/composer/presentation/extensions/email_action_type_extension.dart'; import 'package:tmail_ui_user/features/composer/presentation/extensions/email_action_type_extension.dart';
import 'package:tmail_ui_user/features/email/presentation/controller/single_email_controller.dart'; import 'package:tmail_ui_user/features/email/presentation/controller/single_email_controller.dart';
import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_event_extension.dart'; import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_event_extension.dart';
@@ -153,19 +154,26 @@ class EmailView extends GetWidget<SingleEmailController> {
return Obx(() { return Obx(() {
final calendarEvent = controller.calendarEvent.value; final calendarEvent = controller.calendarEvent.value;
if (currentEmail.hasCalendarEvent && calendarEvent != null) { if (currentEmail.hasCalendarEvent && calendarEvent != null) {
return SingleChildScrollView( return Padding(
physics : const ClampingScrollPhysics(), padding: const EdgeInsetsDirectional.symmetric(horizontal: 4),
child: Container( child: ScrollbarListView(
width: double.infinity, scrollController: controller.emailContentScrollController,
alignment: Alignment.center, child: SingleChildScrollView(
color: Colors.white, physics : const ClampingScrollPhysics(),
child: _buildEmailMessage( controller: controller.emailContentScrollController,
context: context, child: Container(
presentationEmail: currentEmail, width: double.infinity,
calendarEvent: calendarEvent, alignment: Alignment.center,
emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(), color: Colors.white,
) child: _buildEmailMessage(
) context: context,
presentationEmail: currentEmail,
calendarEvent: calendarEvent,
emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(),
)
)
),
),
); );
} else { } else {
return _buildEmailMessage( return _buildEmailMessage(
@@ -196,19 +204,26 @@ class EmailView extends GetWidget<SingleEmailController> {
return Obx(() { return Obx(() {
final calendarEvent = controller.calendarEvent.value; final calendarEvent = controller.calendarEvent.value;
if (currentEmail.hasCalendarEvent && calendarEvent != null) { if (currentEmail.hasCalendarEvent && calendarEvent != null) {
return SingleChildScrollView( return Padding(
physics : const ClampingScrollPhysics(), padding: const EdgeInsetsDirectional.symmetric(horizontal: 4),
child: Container( child: ScrollbarListView(
width: double.infinity, scrollController: controller.emailContentScrollController,
alignment: Alignment.center, child: SingleChildScrollView(
color: Colors.white, physics : const ClampingScrollPhysics(),
child: _buildEmailMessage( controller: controller.emailContentScrollController,
context: context, child: Container(
presentationEmail: currentEmail, width: double.infinity,
calendarEvent: calendarEvent, alignment: Alignment.center,
emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(), color: Colors.white,
) child: _buildEmailMessage(
) context: context,
presentationEmail: currentEmail,
calendarEvent: calendarEvent,
emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(),
)
)
),
),
); );
} else { } else {
return _buildEmailMessage( return _buildEmailMessage(