TF-2684 Enable selectable in blue bar
This commit is contained in:
@@ -11,8 +11,8 @@ class HyperLinkWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return RichText(
|
return Text.rich(
|
||||||
text: TextSpan(
|
TextSpan(
|
||||||
text: urlString,
|
text: urlString,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: HyperLinkWidgetStyles.textColor,
|
color: HyperLinkWidgetStyles.textColor,
|
||||||
|
|||||||
@@ -46,215 +46,215 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return SelectionArea(
|
||||||
backgroundColor: controller.responsiveUtils.isWebDesktop(context)
|
child: Scaffold(
|
||||||
? AppColor.colorBgDesktop
|
backgroundColor: controller.responsiveUtils.isWebDesktop(context)
|
||||||
: Colors.white,
|
? AppColor.colorBgDesktop
|
||||||
appBar: PlatformInfo.isIOS
|
: Colors.white,
|
||||||
? PreferredSize(
|
appBar: PlatformInfo.isIOS
|
||||||
preferredSize: const Size(double.infinity, 100),
|
? PreferredSize(
|
||||||
|
preferredSize: const Size(double.infinity, 100),
|
||||||
|
child: Obx(() {
|
||||||
|
if (controller.currentEmail != null) {
|
||||||
|
return SafeArea(
|
||||||
|
top: false,
|
||||||
|
bottom: false,
|
||||||
|
child: EmailViewAppBarWidget(
|
||||||
|
key: const Key('email_view_app_bar_widget'),
|
||||||
|
presentationEmail: controller.currentEmail!,
|
||||||
|
mailboxContain: _getMailboxContain(controller.currentEmail!),
|
||||||
|
isSearchActivated: controller.mailboxDashBoardController.searchController.isSearchEmailRunning,
|
||||||
|
onBackAction: () => controller.closeEmailView(context: context),
|
||||||
|
onEmailActionClick: (email, action) => controller.handleEmailAction(context, email, action),
|
||||||
|
onMoreActionClick: (presentationEmail, position) => _handleMoreEmailAction(context: context, presentationEmail: presentationEmail, position: position)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
body: SafeArea(
|
||||||
|
right: controller.responsiveUtils.isLandscapeMobile(context),
|
||||||
|
left: controller.responsiveUtils.isLandscapeMobile(context),
|
||||||
|
bottom: !PlatformInfo.isIOS,
|
||||||
|
child: Container(
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
decoration: controller.responsiveUtils.isWebDesktop(context)
|
||||||
|
? BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
border: Border.all(color: AppColor.colorBorderBodyThread, width: 1),
|
||||||
|
color: Colors.white)
|
||||||
|
: const BoxDecoration(color: Colors.white),
|
||||||
|
margin: _getMarginEmailView(context),
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
if (controller.currentEmail != null) {
|
final currentEmail = controller.currentEmail;
|
||||||
return SafeArea(
|
if (currentEmail != null) {
|
||||||
top: false,
|
return Column(children: [
|
||||||
bottom: false,
|
if (!PlatformInfo.isIOS)
|
||||||
child: EmailViewAppBarWidget(
|
Obx(() => EmailViewAppBarWidget(
|
||||||
key: const Key('email_view_app_bar_widget'),
|
key: const Key('email_view_app_bar_widget'),
|
||||||
presentationEmail: controller.currentEmail!,
|
presentationEmail: currentEmail,
|
||||||
mailboxContain: _getMailboxContain(controller.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) => _handleMoreEmailAction(context: context, presentationEmail: presentationEmail, position: position)
|
onMoreActionClick: (presentationEmail, position) => _handleMoreEmailAction(context: context, presentationEmail: presentationEmail, position: position),
|
||||||
|
optionsWidget: PlatformInfo.isWeb && controller.emailSupervisorController.supportedPageView.isTrue
|
||||||
|
? _buildNavigatorPageViewWidgets(context)
|
||||||
|
: null,
|
||||||
|
)),
|
||||||
|
Obx(() {
|
||||||
|
final vacation = controller.mailboxDashBoardController.vacationResponse.value;
|
||||||
|
if (vacation?.vacationResponderIsValid == true &&
|
||||||
|
(
|
||||||
|
controller.responsiveUtils.isMobile(context) ||
|
||||||
|
controller.responsiveUtils.isTablet(context) ||
|
||||||
|
controller.responsiveUtils.isLandscapeMobile(context)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return VacationNotificationMessageWidget(
|
||||||
|
margin: const EdgeInsets.only(left: 12, right: 12, bottom: 5),
|
||||||
|
vacationResponse: vacation!,
|
||||||
|
actionGotoVacationSetting: controller.mailboxDashBoardController.goToVacationSetting,
|
||||||
|
actionEndNow: controller.mailboxDashBoardController.disableVacationResponder
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
Expanded(
|
||||||
|
child: LayoutBuilder(builder: (context, constraints) {
|
||||||
|
log('EmailView::build: EMAIL_BODY_MAX_HEIGHT = ${constraints.maxHeight}');
|
||||||
|
return Obx(() {
|
||||||
|
if (controller.emailSupervisorController.supportedPageView.isTrue) {
|
||||||
|
final currentListEmail = controller.emailSupervisorController.currentListEmail;
|
||||||
|
return PageView.builder(
|
||||||
|
physics: controller.emailSupervisorController.scrollPhysicsPageView.value,
|
||||||
|
itemCount: currentListEmail.length,
|
||||||
|
allowImplicitScrolling: true,
|
||||||
|
controller: controller.emailSupervisorController.pageController,
|
||||||
|
onPageChanged: controller.emailSupervisorController.onPageChanged,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final currentEmail = currentListEmail[index];
|
||||||
|
if (PlatformInfo.isMobile) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
physics : const ClampingScrollPhysics(),
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Obx(() => _buildEmailMessage(
|
||||||
|
context: context,
|
||||||
|
presentationEmail: currentEmail,
|
||||||
|
calendarEvent: controller.calendarEvent.value,
|
||||||
|
maxBodyHeight: constraints.maxHeight
|
||||||
|
))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Obx(() {
|
||||||
|
final calendarEvent = controller.calendarEvent.value;
|
||||||
|
if (currentEmail.hasCalendarEvent && calendarEvent != null) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.symmetric(horizontal: 4),
|
||||||
|
child: ScrollbarListView(
|
||||||
|
scrollController: controller.emailContentScrollController,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
physics : const ClampingScrollPhysics(),
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
color: Colors.white,
|
||||||
|
child: _buildEmailMessage(
|
||||||
|
context: context,
|
||||||
|
presentationEmail: currentEmail,
|
||||||
|
calendarEvent: calendarEvent,
|
||||||
|
emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return _buildEmailMessage(
|
||||||
|
context: context,
|
||||||
|
presentationEmail: currentEmail,
|
||||||
|
maxBodyHeight: constraints.maxHeight
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if (PlatformInfo.isMobile) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
physics : const ClampingScrollPhysics(),
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Obx(() => _buildEmailMessage(
|
||||||
|
context: context,
|
||||||
|
presentationEmail: currentEmail,
|
||||||
|
calendarEvent: controller.calendarEvent.value,
|
||||||
|
maxBodyHeight: constraints.maxHeight
|
||||||
|
))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Obx(() {
|
||||||
|
final calendarEvent = controller.calendarEvent.value;
|
||||||
|
if (currentEmail.hasCalendarEvent && calendarEvent != null) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.symmetric(horizontal: 4),
|
||||||
|
child: ScrollbarListView(
|
||||||
|
scrollController: controller.emailContentScrollController,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
physics : const ClampingScrollPhysics(),
|
||||||
|
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(
|
||||||
|
context: context,
|
||||||
|
presentationEmail: currentEmail,
|
||||||
|
maxBodyHeight: constraints.maxHeight
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
);
|
EmailViewBottomBarWidget(
|
||||||
|
key: const Key('email_view_button_bar'),
|
||||||
|
presentationEmail: currentEmail,
|
||||||
|
emailActionCallback: controller.pressEmailAction
|
||||||
|
),
|
||||||
|
]);
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox.shrink();
|
return const EmailViewEmptyWidget();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
: null,
|
|
||||||
body: SafeArea(
|
|
||||||
right: controller.responsiveUtils.isLandscapeMobile(context),
|
|
||||||
left: controller.responsiveUtils.isLandscapeMobile(context),
|
|
||||||
bottom: !PlatformInfo.isIOS,
|
|
||||||
child: Container(
|
|
||||||
clipBehavior: Clip.antiAlias,
|
|
||||||
decoration: controller.responsiveUtils.isWebDesktop(context)
|
|
||||||
? BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
border: Border.all(color: AppColor.colorBorderBodyThread, width: 1),
|
|
||||||
color: Colors.white)
|
|
||||||
: const BoxDecoration(color: Colors.white),
|
|
||||||
margin: _getMarginEmailView(context),
|
|
||||||
child: Obx(() {
|
|
||||||
final currentEmail = controller.currentEmail;
|
|
||||||
if (currentEmail != null) {
|
|
||||||
return Column(children: [
|
|
||||||
if (!PlatformInfo.isIOS)
|
|
||||||
Obx(() => EmailViewAppBarWidget(
|
|
||||||
key: const Key('email_view_app_bar_widget'),
|
|
||||||
presentationEmail: currentEmail,
|
|
||||||
mailboxContain: _getMailboxContain(currentEmail),
|
|
||||||
isSearchActivated: controller.mailboxDashBoardController.searchController.isSearchEmailRunning,
|
|
||||||
onBackAction: () => controller.closeEmailView(context: context),
|
|
||||||
onEmailActionClick: (email, action) => controller.handleEmailAction(context, email, action),
|
|
||||||
onMoreActionClick: (presentationEmail, position) => _handleMoreEmailAction(context: context, presentationEmail: presentationEmail, position: position),
|
|
||||||
optionsWidget: PlatformInfo.isWeb && controller.emailSupervisorController.supportedPageView.isTrue
|
|
||||||
? _buildNavigatorPageViewWidgets(context)
|
|
||||||
: null,
|
|
||||||
)),
|
|
||||||
Obx(() {
|
|
||||||
final vacation = controller.mailboxDashBoardController.vacationResponse.value;
|
|
||||||
if (vacation?.vacationResponderIsValid == true &&
|
|
||||||
(
|
|
||||||
controller.responsiveUtils.isMobile(context) ||
|
|
||||||
controller.responsiveUtils.isTablet(context) ||
|
|
||||||
controller.responsiveUtils.isLandscapeMobile(context)
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return VacationNotificationMessageWidget(
|
|
||||||
margin: const EdgeInsets.only(left: 12, right: 12, bottom: 5),
|
|
||||||
vacationResponse: vacation!,
|
|
||||||
actionGotoVacationSetting: controller.mailboxDashBoardController.goToVacationSetting,
|
|
||||||
actionEndNow: controller.mailboxDashBoardController.disableVacationResponder
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
Expanded(
|
|
||||||
child: LayoutBuilder(builder: (context, constraints) {
|
|
||||||
log('EmailView::build: EMAIL_BODY_MAX_HEIGHT = ${constraints.maxHeight}');
|
|
||||||
return Obx(() {
|
|
||||||
if (controller.emailSupervisorController.supportedPageView.isTrue) {
|
|
||||||
final currentListEmail = controller.emailSupervisorController.currentListEmail;
|
|
||||||
return PageView.builder(
|
|
||||||
physics: controller.emailSupervisorController.scrollPhysicsPageView.value,
|
|
||||||
itemCount: currentListEmail.length,
|
|
||||||
allowImplicitScrolling: true,
|
|
||||||
controller: controller.emailSupervisorController.pageController,
|
|
||||||
onPageChanged: controller.emailSupervisorController.onPageChanged,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final currentEmail = currentListEmail[index];
|
|
||||||
if (PlatformInfo.isMobile) {
|
|
||||||
return SingleChildScrollView(
|
|
||||||
physics : const ClampingScrollPhysics(),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
color: Colors.white,
|
|
||||||
child: Obx(() => _buildEmailMessage(
|
|
||||||
context: context,
|
|
||||||
presentationEmail: currentEmail,
|
|
||||||
calendarEvent: controller.calendarEvent,
|
|
||||||
maxBodyHeight: constraints.maxHeight
|
|
||||||
))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Obx(() {
|
|
||||||
final calendarEvent = controller.calendarEvent;
|
|
||||||
if (currentEmail.hasCalendarEvent && calendarEvent != null) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.symmetric(horizontal: 4),
|
|
||||||
child: ScrollbarListView(
|
|
||||||
scrollController: controller.emailContentScrollController,
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
physics : const ClampingScrollPhysics(),
|
|
||||||
controller: controller.emailContentScrollController,
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
color: Colors.white,
|
|
||||||
child: _buildEmailMessage(
|
|
||||||
context: context,
|
|
||||||
presentationEmail: currentEmail,
|
|
||||||
calendarEvent: calendarEvent,
|
|
||||||
emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return _buildEmailMessage(
|
|
||||||
context: context,
|
|
||||||
presentationEmail: currentEmail,
|
|
||||||
maxBodyHeight: constraints.maxHeight
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
if (PlatformInfo.isMobile) {
|
|
||||||
return SingleChildScrollView(
|
|
||||||
physics : const ClampingScrollPhysics(),
|
|
||||||
child: Container(
|
|
||||||
width: double.infinity,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
color: Colors.white,
|
|
||||||
child: Obx(() => _buildEmailMessage(
|
|
||||||
context: context,
|
|
||||||
presentationEmail: currentEmail,
|
|
||||||
calendarEvent: controller.calendarEvent,
|
|
||||||
maxBodyHeight: constraints.maxHeight
|
|
||||||
))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Obx(() {
|
|
||||||
final calendarEvent = controller.calendarEvent;
|
|
||||||
if (currentEmail.hasCalendarEvent && calendarEvent != null) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.symmetric(horizontal: 4),
|
|
||||||
child: ScrollbarListView(
|
|
||||||
scrollController: controller.emailContentScrollController,
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
physics : const ClampingScrollPhysics(),
|
|
||||||
controller: controller.emailContentScrollController,
|
|
||||||
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(
|
|
||||||
context: context,
|
|
||||||
presentationEmail: currentEmail,
|
|
||||||
maxBodyHeight: constraints.maxHeight
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
EmailViewBottomBarWidget(
|
|
||||||
key: const Key('email_view_button_bar'),
|
|
||||||
presentationEmail: currentEmail,
|
|
||||||
emailActionCallback: controller.pressEmailAction
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
return const EmailViewEmptyWidget();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
)
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
|
|||||||
class EmailSubjectStyles {
|
class EmailSubjectStyles {
|
||||||
static const double textSize = 20;
|
static const double textSize = 20;
|
||||||
static const int? maxLines = PlatformInfo.isWeb ? 2 : null;
|
static const int? maxLines = PlatformInfo.isWeb ? 2 : null;
|
||||||
static const int? minLines = PlatformInfo.isWeb ? 1 : null;
|
|
||||||
|
|
||||||
static const Color textColor = AppColor.colorNameEmail;
|
static const Color textColor = AppColor.colorNameEmail;
|
||||||
static const Color cursorColor = AppColor.colorTextButton;
|
static const Color cursorColor = AppColor.colorTextButton;
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ class AttendeeWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return RichText(
|
return Text.rich(
|
||||||
text: TextSpan(
|
TextSpan(
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: AttendeeWidgetStyles.textSize,
|
fontSize: AttendeeWidgetStyles.textSize,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
|
|||||||
+2
-2
@@ -48,8 +48,8 @@ class CalendarEventActionBannerWidget extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
RichText(
|
Text.rich(
|
||||||
text: TextSpan(
|
TextSpan(
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: CalendarEventActionBannerStyles.titleTextSize,
|
fontSize: CalendarEventActionBannerStyles.titleTextSize,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
|
|||||||
+4
-4
@@ -76,8 +76,8 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
RichText(
|
Text.rich(
|
||||||
text: TextSpan(
|
TextSpan(
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: CalendarEventInformationWidgetStyles.invitationMessageTextSize,
|
fontSize: CalendarEventInformationWidgetStyles.invitationMessageTextSize,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
@@ -147,8 +147,8 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
RichText(
|
Text.rich(
|
||||||
text: TextSpan(
|
TextSpan(
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: CalendarEventInformationWidgetStyles.invitationMessageTextSize,
|
fontSize: CalendarEventInformationWidgetStyles.invitationMessageTextSize,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
|
|||||||
+2
-2
@@ -36,8 +36,8 @@ class EventAttendeeInformationWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(child: RichText(
|
Expanded(child: Text.rich(
|
||||||
text: TextSpan(
|
TextSpan(
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: EventAttendeeInformationWidgetStyles.textSize,
|
fontSize: EventAttendeeInformationWidgetStyles.textSize,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ class OrganizerWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return RichText(
|
return Text.rich(
|
||||||
text: TextSpan(
|
TextSpan(
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: OrganizerWidgetStyles.textSize,
|
fontSize: OrganizerWidgetStyles.textSize,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
|
|
||||||
|
import 'package:collection/collection.dart';
|
||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
import 'package:core/presentation/resources/image_paths.dart';
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:core/presentation/utils/style_utils.dart';
|
|
||||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||||
import 'package:core/utils/direction_utils.dart';
|
|
||||||
import 'package:core/utils/platform_info.dart';
|
import 'package:core/utils/platform_info.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -14,10 +13,9 @@ import 'package:model/email/presentation_email.dart';
|
|||||||
import 'package:model/extensions/email_address_extension.dart';
|
import 'package:model/extensions/email_address_extension.dart';
|
||||||
import 'package:model/extensions/list_email_address_extension.dart';
|
import 'package:model/extensions/list_email_address_extension.dart';
|
||||||
import 'package:model/extensions/presentation_email_extension.dart';
|
import 'package:model/extensions/presentation_email_extension.dart';
|
||||||
import 'package:tmail_ui_user/features/base/widget/material_text_button.dart';
|
|
||||||
import 'package:tmail_ui_user/features/base/widget/scrollbar_list_view.dart';
|
|
||||||
import 'package:tmail_ui_user/features/composer/presentation/extensions/prefix_email_address_extension.dart';
|
import 'package:tmail_ui_user/features/composer/presentation/extensions/prefix_email_address_extension.dart';
|
||||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_sender_builder.dart';
|
import 'package:tmail_ui_user/features/email/presentation/widgets/email_sender_builder.dart';
|
||||||
|
import 'package:tmail_ui_user/features/email/presentation/widgets/prefix_recipient_widget.dart';
|
||||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||||
|
|
||||||
@@ -47,233 +45,253 @@ class _EmailReceiverWidgetState extends State<EmailReceiverWidget> {
|
|||||||
|
|
||||||
final _imagePaths = Get.find<ImagePaths>();
|
final _imagePaths = Get.find<ImagePaths>();
|
||||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||||
final _scrollController = ScrollController();
|
|
||||||
|
|
||||||
bool _isDisplayAll = false;
|
bool _isDisplayAll = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
if (PlatformInfo.isWeb) {
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
if (_isDisplayAll) {
|
||||||
children: [
|
return Row(
|
||||||
Expanded(child: Padding(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
padding: EdgeInsets.only(top: _isDisplayAll
|
children: [
|
||||||
? DirectionUtils.isDirectionRTLByLanguage(context) ? 3 : 5.5
|
Expanded(
|
||||||
: 0),
|
child: Container(
|
||||||
child: PlatformInfo.isWeb
|
constraints: BoxConstraints(maxHeight: _maxHeight),
|
||||||
? Container(
|
child: ListView(
|
||||||
constraints: BoxConstraints(
|
primary: false,
|
||||||
maxHeight: _isDisplayAll && widget.maxHeight != null
|
shrinkWrap: true,
|
||||||
? widget.maxHeight! / 2 - _offsetTop
|
padding: EdgeInsets.zero,
|
||||||
: double.infinity
|
children: [
|
||||||
),
|
if (widget.emailSelected.to.numberEmailAddress() > 0)
|
||||||
child: ScrollbarListView(
|
_buildRecipientsWidgetToDisplayFull(
|
||||||
scrollController: _scrollController,
|
context: context,
|
||||||
child: SingleChildScrollView(
|
prefixEmailAddress: PrefixEmailAddress.to,
|
||||||
controller: _scrollController,
|
listEmailAddress: PrefixEmailAddress.to.listEmailAddress(widget.emailSelected)
|
||||||
child: _buildEmailAddressOfReceiver(
|
),
|
||||||
context,
|
if (widget.emailSelected.cc.numberEmailAddress() > 0)
|
||||||
widget.emailSelected,
|
_buildRecipientsWidgetToDisplayFull(
|
||||||
_isDisplayAll,
|
context: context,
|
||||||
widget.maxWidth
|
prefixEmailAddress: PrefixEmailAddress.cc,
|
||||||
),
|
listEmailAddress: PrefixEmailAddress.cc.listEmailAddress(widget.emailSelected)
|
||||||
),
|
),
|
||||||
|
if (widget.emailSelected.bcc.numberEmailAddress() > 0)
|
||||||
|
_buildRecipientsWidgetToDisplayFull(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.bcc,
|
||||||
|
listEmailAddress: PrefixEmailAddress.bcc.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: _buildEmailAddressOfReceiver(
|
),
|
||||||
context,
|
TMailButtonWidget.fromText(
|
||||||
widget.emailSelected,
|
text: AppLocalizations.of(context).hide,
|
||||||
_isDisplayAll,
|
textStyle: Theme.of(context).textTheme.labelMedium?.copyWith(
|
||||||
widget.maxWidth
|
color: AppColor.primaryColor,
|
||||||
|
fontSize: 15
|
||||||
),
|
),
|
||||||
)),
|
|
||||||
if (_isDisplayAll)
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
vertical: DirectionUtils.isDirectionRTLByLanguage(context) ? 0 : 6),
|
|
||||||
child: MaterialTextButton(
|
|
||||||
padding: DirectionUtils.isDirectionRTLByLanguage(context)
|
|
||||||
? const EdgeInsets.symmetric(horizontal: 8, vertical: 4)
|
|
||||||
: null,
|
|
||||||
onTap: () => setState(() => _isDisplayAll = false),
|
|
||||||
label: AppLocalizations.of(context).hide,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildEmailAddressOfReceiver(
|
|
||||||
BuildContext context,
|
|
||||||
PresentationEmail presentationEmail,
|
|
||||||
bool isDisplayFull,
|
|
||||||
double maxWidth
|
|
||||||
) {
|
|
||||||
if (!isDisplayFull && presentationEmail.numberOfAllEmailAddress() > 1) {
|
|
||||||
return Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
height: 40,
|
|
||||||
color: Colors.white,
|
|
||||||
constraints: BoxConstraints(maxWidth: _getMaxWidthEmailAddressDisplayed(context, maxWidth)),
|
|
||||||
child: ListView(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
shrinkWrap: true,
|
|
||||||
children: [
|
|
||||||
if (presentationEmail.to.numberEmailAddress() > 0)
|
|
||||||
_buildEmailAddressByPrefix(
|
|
||||||
context,
|
|
||||||
presentationEmail,
|
|
||||||
PrefixEmailAddress.to,
|
|
||||||
isDisplayFull
|
|
||||||
),
|
|
||||||
if (presentationEmail.cc.numberEmailAddress() > 0)
|
|
||||||
_buildEmailAddressByPrefix(
|
|
||||||
context,
|
|
||||||
presentationEmail,
|
|
||||||
PrefixEmailAddress.cc,
|
|
||||||
isDisplayFull
|
|
||||||
),
|
|
||||||
if (presentationEmail.bcc.numberEmailAddress() > 0)
|
|
||||||
_buildEmailAddressByPrefix(
|
|
||||||
context,
|
|
||||||
presentationEmail,
|
|
||||||
PrefixEmailAddress.bcc,
|
|
||||||
isDisplayFull
|
|
||||||
),
|
|
||||||
]
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Transform(
|
|
||||||
transform: Matrix4.translationValues(0.0, -5.0, 0.0),
|
|
||||||
child: TMailButtonWidget.fromIcon(
|
|
||||||
icon: _imagePaths.icChevronDown,
|
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
onTapActionCallback: () => setState(() => _isDisplayAll = true),
|
onTapActionCallback: () => setState(() => _isDisplayAll = false),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxWidth: _getMaxWidth(context),
|
||||||
|
maxHeight: 34,
|
||||||
|
),
|
||||||
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
shrinkWrap: true,
|
||||||
|
children: [
|
||||||
|
if (widget.emailSelected.to.numberEmailAddress() > 0)
|
||||||
|
..._buildRecipientsWidget(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.to,
|
||||||
|
listEmailAddress: PrefixEmailAddress.to.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
if (widget.emailSelected.cc.numberEmailAddress() > 0)
|
||||||
|
..._buildRecipientsWidget(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.cc,
|
||||||
|
listEmailAddress: PrefixEmailAddress.cc.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
if (widget.emailSelected.bcc.numberEmailAddress() > 0)
|
||||||
|
..._buildRecipientsWidget(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.bcc,
|
||||||
|
listEmailAddress: PrefixEmailAddress.bcc.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
if (widget.emailSelected.numberOfAllEmailAddress() > 1)
|
||||||
]
|
TMailButtonWidget.fromIcon(
|
||||||
);
|
icon: _imagePaths.icChevronDown,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
onTapActionCallback: () => setState(() => _isDisplayAll = true),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return Column(
|
if (_isDisplayAll) {
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
if (presentationEmail.to.numberEmailAddress() > 0)
|
Expanded(
|
||||||
_buildEmailAddressByPrefix(
|
child: Container(
|
||||||
context,
|
constraints: BoxConstraints(maxHeight: _maxHeight),
|
||||||
presentationEmail,
|
child: Column(
|
||||||
PrefixEmailAddress.to,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
isDisplayFull
|
children: [
|
||||||
|
if (widget.emailSelected.to.numberEmailAddress() > 0)
|
||||||
|
_buildRecipientsWidgetToDisplayFull(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.to,
|
||||||
|
listEmailAddress: PrefixEmailAddress.to.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
if (widget.emailSelected.cc.numberEmailAddress() > 0)
|
||||||
|
_buildRecipientsWidgetToDisplayFull(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.cc,
|
||||||
|
listEmailAddress: PrefixEmailAddress.cc.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
if (widget.emailSelected.bcc.numberEmailAddress() > 0)
|
||||||
|
_buildRecipientsWidgetToDisplayFull(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.bcc,
|
||||||
|
listEmailAddress: PrefixEmailAddress.bcc.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
TMailButtonWidget.fromText(
|
||||||
|
text: AppLocalizations.of(context).hide,
|
||||||
|
textStyle: Theme.of(context).textTheme.labelMedium?.copyWith(
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
fontSize: 15
|
||||||
|
),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
onTapActionCallback: () => setState(() => _isDisplayAll = false),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 40,
|
||||||
|
constraints: BoxConstraints(maxWidth: _getMaxWidth(context)),
|
||||||
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
shrinkWrap: true,
|
||||||
|
children: [
|
||||||
|
if (widget.emailSelected.to.numberEmailAddress() > 0)
|
||||||
|
..._buildRecipientsWidget(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.to,
|
||||||
|
listEmailAddress: PrefixEmailAddress.to.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
if (widget.emailSelected.cc.numberEmailAddress() > 0)
|
||||||
|
..._buildRecipientsWidget(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.cc,
|
||||||
|
listEmailAddress: PrefixEmailAddress.cc.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
if (widget.emailSelected.bcc.numberEmailAddress() > 0)
|
||||||
|
..._buildRecipientsWidget(
|
||||||
|
context: context,
|
||||||
|
prefixEmailAddress: PrefixEmailAddress.bcc,
|
||||||
|
listEmailAddress: PrefixEmailAddress.bcc.listEmailAddress(widget.emailSelected)
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
),
|
),
|
||||||
if (presentationEmail.cc.numberEmailAddress() > 0)
|
if (widget.emailSelected.numberOfAllEmailAddress() > 1)
|
||||||
_buildEmailAddressByPrefix(
|
TMailButtonWidget.fromIcon(
|
||||||
context,
|
icon: _imagePaths.icChevronDown,
|
||||||
presentationEmail,
|
backgroundColor: Colors.transparent,
|
||||||
PrefixEmailAddress.cc,
|
onTapActionCallback: () => setState(() => _isDisplayAll = true),
|
||||||
isDisplayFull
|
)
|
||||||
),
|
]
|
||||||
if (presentationEmail.bcc.numberEmailAddress() > 0)
|
);
|
||||||
_buildEmailAddressByPrefix(
|
}
|
||||||
context,
|
|
||||||
presentationEmail,
|
|
||||||
PrefixEmailAddress.bcc,
|
|
||||||
isDisplayFull
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildEmailAddressByPrefix(
|
List<Widget> _buildRecipientsTag({required List<EmailAddress> listEmailAddress}) {
|
||||||
BuildContext context,
|
return listEmailAddress
|
||||||
PresentationEmail presentationEmail,
|
.mapIndexed((index, emailAddress) => TMailButtonWidget.fromText(
|
||||||
PrefixEmailAddress prefixEmailAddress,
|
text: index == listEmailAddress.length - 1
|
||||||
bool isDisplayFull
|
? emailAddress.asString()
|
||||||
) {
|
: '${emailAddress.asString()},',
|
||||||
|
textStyle: Theme.of(context).textTheme.labelSmall?.copyWith(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
padding: const EdgeInsetsDirectional.symmetric(vertical: 5, horizontal: 8),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
onTapActionCallback: () => widget.openEmailAddressDetailAction?.call(context, emailAddress),
|
||||||
|
onLongPressActionCallback: () => AppUtils.copyEmailAddressToClipboard(context, emailAddress.emailAddress),
|
||||||
|
))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Widget _buildRecipientsWidgetToDisplayFull({
|
||||||
|
required BuildContext context,
|
||||||
|
required PrefixEmailAddress prefixEmailAddress,
|
||||||
|
required List<EmailAddress> listEmailAddress,
|
||||||
|
}) {
|
||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
PrefixRecipientWidget(prefixEmailAddress: prefixEmailAddress),
|
||||||
padding: const EdgeInsets.only(top: 5),
|
Expanded(
|
||||||
child: Text(
|
child: Wrap(
|
||||||
'${prefixEmailAddress.asName(context)}:',
|
children: _buildRecipientsTag(listEmailAddress: listEmailAddress)
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: AppColor.colorEmailAddressFull
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (!isDisplayFull && presentationEmail.numberOfAllEmailAddress() > 1)
|
|
||||||
_buildListEmailAddressWidget(
|
|
||||||
context,
|
|
||||||
prefixEmailAddress.listEmailAddress(presentationEmail),
|
|
||||||
isDisplayFull
|
|
||||||
)
|
)
|
||||||
else
|
)
|
||||||
Expanded(child: _buildListEmailAddressWidget(
|
],
|
||||||
context,
|
|
||||||
prefixEmailAddress.listEmailAddress(presentationEmail),
|
|
||||||
isDisplayFull
|
|
||||||
))
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildListEmailAddressWidget(
|
List<Widget> _buildRecipientsWidget({
|
||||||
BuildContext context,
|
required BuildContext context,
|
||||||
List<EmailAddress> listEmailAddress,
|
required PrefixEmailAddress prefixEmailAddress,
|
||||||
bool isDisplayFull
|
required List<EmailAddress> listEmailAddress,
|
||||||
) {
|
}) {
|
||||||
final lastEmailAddress = listEmailAddress.last;
|
return [
|
||||||
final emailAddressWidgets = listEmailAddress.map((emailAddress) {
|
PrefixRecipientWidget(prefixEmailAddress: prefixEmailAddress),
|
||||||
return MaterialTextButton(
|
..._buildRecipientsTag(listEmailAddress: listEmailAddress)
|
||||||
label: lastEmailAddress == emailAddress
|
];
|
||||||
? emailAddress.asString()
|
|
||||||
: '${emailAddress.asString()},',
|
|
||||||
onTap: () => widget.openEmailAddressDetailAction?.call(context, emailAddress),
|
|
||||||
onLongPress: () {
|
|
||||||
AppUtils.copyEmailAddressToClipboard(context, emailAddress.emailAddress);
|
|
||||||
},
|
|
||||||
borderRadius: 8,
|
|
||||||
labelColor: Colors.black,
|
|
||||||
labelSize: 16,
|
|
||||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
|
||||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
|
||||||
);
|
|
||||||
}).toList();
|
|
||||||
|
|
||||||
if (isDisplayFull) {
|
|
||||||
return Wrap(children: emailAddressWidgets);
|
|
||||||
} else {
|
|
||||||
return SingleChildScrollView(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment:CrossAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: emailAddressWidgets
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double _getMaxWidthEmailAddressDisplayed(BuildContext context, double maxWidth) {
|
double _getMaxWidth(BuildContext context) {
|
||||||
if (_responsiveUtils.isPortraitMobile(context)) {
|
if (_responsiveUtils.isPortraitMobile(context)) {
|
||||||
return maxWidth - _maxSizeFullDisplayEmailAddressArrowDownButton;
|
return widget.maxWidth - _maxSizeFullDisplayEmailAddressArrowDownButton;
|
||||||
} else if (_responsiveUtils.isWebDesktop(context)) {
|
} else if (_responsiveUtils.isWebDesktop(context)) {
|
||||||
return maxWidth / 2;
|
return widget.maxWidth / 2;
|
||||||
} else {
|
} else {
|
||||||
return maxWidth * 3/4;
|
return widget.maxWidth * 3/4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
double get _maxHeight {
|
||||||
void dispose() {
|
return _isDisplayAll && widget.maxHeight != null
|
||||||
_scrollController.dispose();
|
? widget.maxHeight! / 2 - _offsetTop
|
||||||
super.dispose();
|
: double.infinity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,11 +12,9 @@ class EmailSubjectWidget extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EmailSubjectStyles.padding,
|
padding: EmailSubjectStyles.padding,
|
||||||
child: SelectableText(
|
child: Text(
|
||||||
presentationEmail.getEmailTitle(),
|
presentationEmail.getEmailTitle(),
|
||||||
maxLines: EmailSubjectStyles.maxLines,
|
maxLines: EmailSubjectStyles.maxLines,
|
||||||
minLines: EmailSubjectStyles.minLines,
|
|
||||||
cursorColor: EmailSubjectStyles.cursorColor,
|
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: EmailSubjectStyles.textSize,
|
fontSize: EmailSubjectStyles.textSize,
|
||||||
color: EmailSubjectStyles.textColor,
|
color: EmailSubjectStyles.textColor,
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:model/email/prefix_email_address.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/presentation/extensions/prefix_email_address_extension.dart';
|
||||||
|
|
||||||
|
class PrefixRecipientWidget extends StatelessWidget {
|
||||||
|
final PrefixEmailAddress prefixEmailAddress;
|
||||||
|
|
||||||
|
const PrefixRecipientWidget({super.key, required this.prefixEmailAddress});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 6),
|
||||||
|
child: Text(
|
||||||
|
'${prefixEmailAddress.asName(context)}:',
|
||||||
|
style: Theme.of(context).textTheme.labelMedium?.copyWith(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColor.colorEmailAddressFull
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user