Set default DividerTheme
(cherry picked from commit 9be02961277e990f8ded19106532f9c788eb1d7e)
This commit is contained in:
+2
-2
@@ -13,9 +13,9 @@ class DefaultWebAppBarThreadWidgetStyle {
|
||||
|
||||
static EdgeInsetsGeometry getPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isMobile(context) || responsiveUtils.isTabletLarge(context)) {
|
||||
return const EdgeInsets.symmetric(horizontal: 16, vertical: 8);
|
||||
return const EdgeInsets.symmetric(horizontal: 12, vertical: 8);
|
||||
} else {
|
||||
return const EdgeInsets.symmetric(horizontal: 32, vertical: 8);
|
||||
return const EdgeInsets.symmetric(horizontal: 24, vertical: 8);
|
||||
}
|
||||
}
|
||||
static const EdgeInsetsGeometry mailboxMenuPadding = EdgeInsets.all(5);
|
||||
|
||||
+2
-2
@@ -14,9 +14,9 @@ class SelectionWebAppBarThreadWidgetStyle {
|
||||
|
||||
static EdgeInsetsGeometry getPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isMobile(context) || responsiveUtils.isTabletLarge(context)) {
|
||||
return const EdgeInsets.symmetric(horizontal: 16, vertical: 8);
|
||||
return const EdgeInsets.symmetric(horizontal: 12, vertical: 8);
|
||||
} else {
|
||||
return const EdgeInsets.symmetric(horizontal: 32, vertical: 8);
|
||||
return const EdgeInsets.symmetric(horizontal: 24, vertical: 8);
|
||||
}
|
||||
}
|
||||
static const EdgeInsetsGeometry closeButtonPadding = EdgeInsets.all(3);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class ItemEmailTileStyles {
|
||||
@@ -18,31 +17,21 @@ class ItemEmailTileStyles {
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsetsGeometry getPaddingItemList(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
if (responsiveUtils.isDesktop(context)) {
|
||||
return const EdgeInsetsDirectional.only(start: 120);
|
||||
} else if (responsiveUtils.isMobile(context) || responsiveUtils.isTabletLarge(context)) {
|
||||
return const EdgeInsets.symmetric(horizontal: 16);
|
||||
} else {
|
||||
return const EdgeInsets.symmetric(horizontal: 32);
|
||||
}
|
||||
static EdgeInsetsGeometry getMobilePaddingItemList(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isPortraitMobile(context) || responsiveUtils.isLandscapeTablet(context)) {
|
||||
return const EdgeInsets.symmetric(horizontal: 16);
|
||||
} else {
|
||||
if (responsiveUtils.isPortraitMobile(context) || responsiveUtils.isLandscapeTablet(context)) {
|
||||
return const EdgeInsets.symmetric(horizontal: 16);
|
||||
} else {
|
||||
return const EdgeInsets.symmetric(horizontal: 32);
|
||||
}
|
||||
return const EdgeInsets.symmetric(horizontal: 32);
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsetsGeometry getPaddingDividerWeb(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isDesktop(context)) {
|
||||
return const EdgeInsetsDirectional.only(start: 120);
|
||||
} else if (responsiveUtils.isMobile(context) || responsiveUtils.isTabletLarge(context)) {
|
||||
return const EdgeInsets.symmetric(horizontal: 12);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.only(start: 120, top: 2);
|
||||
}else if (responsiveUtils.isTablet(context)) {
|
||||
return const EdgeInsets.symmetric(horizontal: 24);
|
||||
} else {
|
||||
return const EdgeInsets.symmetric(horizontal: 12);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,6 @@ import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SpamReportBannerStyles {
|
||||
static const double horizontalMargin = 16;
|
||||
static const double verticalMargin = 8;
|
||||
static const double padding = 12;
|
||||
static const double borderRadius = 12;
|
||||
static const double space = 8;
|
||||
|
||||
@@ -56,8 +56,8 @@ class ThreadView extends GetWidget<ThreadController>
|
||||
backgroundColor: Colors.white,
|
||||
body: Portal(
|
||||
child: Row(children: [
|
||||
if (supportVerticalDivider(context))
|
||||
const VerticalDivider(color: AppColor.colorDividerVertical, width: 1),
|
||||
if (_supportVerticalDivider(context))
|
||||
const VerticalDivider(),
|
||||
Expanded(child: SafeArea(
|
||||
right: controller.responsiveUtils.isLandscapeMobile(context),
|
||||
left: controller.responsiveUtils.isLandscapeMobile(context),
|
||||
@@ -101,20 +101,41 @@ class ThreadView extends GetWidget<ThreadController>
|
||||
: null
|
||||
);
|
||||
}),
|
||||
if (!PlatformInfo.isWeb)
|
||||
if (PlatformInfo.isMobile)
|
||||
Obx(() {
|
||||
if (!controller.networkConnectionController.isNetworkConnectionAvailable()) {
|
||||
return const Padding(
|
||||
padding: EdgeInsetsDirectional.only(bottom: 8),
|
||||
child: NetworkConnectionBannerWidget());
|
||||
return NetworkConnectionBannerWidget();
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}),
|
||||
_buildSearchBarView(context),
|
||||
const SpamReportBannerWidget(),
|
||||
const QuotasBannerWidget(),
|
||||
_buildVacationNotificationMessage(context),
|
||||
SearchBarView(
|
||||
key: const Key('email_search_bar_view'),
|
||||
imagePaths: controller.imagePaths,
|
||||
margin: _getBannerMargin(context, controller.responsiveUtils),
|
||||
hintTextSearch: AppLocalizations.of(context).search_emails,
|
||||
onOpenSearchViewAction: controller.goToSearchView
|
||||
),
|
||||
SpamReportBannerWidget(
|
||||
spamReportController: controller.mailboxDashBoardController.spamReportController,
|
||||
margin: _getBannerMargin(context, controller.responsiveUtils),
|
||||
),
|
||||
QuotasBannerWidget(
|
||||
margin: _getBannerMargin(context, controller.responsiveUtils),
|
||||
),
|
||||
Obx(() {
|
||||
final vacation = controller.mailboxDashBoardController.vacationResponse.value;
|
||||
if (vacation?.vacationResponderIsValid == true) {
|
||||
return VacationNotificationMessageWidget(
|
||||
margin: _getBannerMargin(context, controller.responsiveUtils),
|
||||
vacationResponse: vacation!,
|
||||
actionGotoVacationSetting: controller.mailboxDashBoardController.goToVacationSetting,
|
||||
actionEndNow: controller.mailboxDashBoardController.disableVacationResponder
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}),
|
||||
],
|
||||
Obx(() {
|
||||
if (controller.mailboxDashBoardController.isEmptyTrashBannerEnabledOnMobile(context)) {
|
||||
@@ -147,7 +168,21 @@ class ThreadView extends GetWidget<ThreadController>
|
||||
if (!controller.responsiveUtils.isDesktop(context))
|
||||
_buildMarkAsMailboxReadLoading(context),
|
||||
Obx(() => ThreadViewLoadingBarWidget(viewState: controller.viewState.value)),
|
||||
Expanded(child: _buildListEmail(context)),
|
||||
Expanded(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
color: Colors.white,
|
||||
child: Obx(() {
|
||||
return Visibility(
|
||||
visible: controller.openingEmail.isFalse,
|
||||
child: _buildResultListEmail(
|
||||
context,
|
||||
controller.mailboxDashBoardController.emailsInCurrentMailbox
|
||||
)
|
||||
);
|
||||
})
|
||||
)
|
||||
),
|
||||
Obx(() => ThreadViewBottomLoadingBarWidget(viewState: controller.viewState.value)),
|
||||
_buildListButtonSelectionForMobile(context),
|
||||
]
|
||||
@@ -181,7 +216,23 @@ class ThreadView extends GetWidget<ThreadController>
|
||||
);
|
||||
}
|
||||
|
||||
bool supportVerticalDivider(BuildContext context) {
|
||||
EdgeInsetsGeometry _getBannerMargin(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
if (responsiveUtils.isMobile(context) || responsiveUtils.isTabletLarge(context)) {
|
||||
return const EdgeInsetsDirectional.only(start: 12, end: 12, bottom: 8);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.only(start: 24, end: 24, bottom: 8);
|
||||
}
|
||||
} else {
|
||||
if (responsiveUtils.isPortraitMobile(context) || responsiveUtils.isLandscapeTablet(context)) {
|
||||
return const EdgeInsetsDirectional.only(start: 16, end: 16, bottom: 8);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.only(start: 32, end: 32, bottom: 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool _supportVerticalDivider(BuildContext context) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
return controller.responsiveUtils.isTabletLarge(context);
|
||||
} else {
|
||||
@@ -191,31 +242,6 @@ class ThreadView extends GetWidget<ThreadController>
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildSearchBarView(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
padding: ItemEmailTileStyles.getPaddingItemList(context, controller.responsiveUtils),
|
||||
margin: EdgeInsets.only(bottom: !controller.responsiveUtils.isWebDesktop(context) ? 8 : 0),
|
||||
child: SearchBarView(controller.imagePaths,
|
||||
hintTextSearch: AppLocalizations.of(context).search_emails,
|
||||
onOpenSearchViewAction: controller.goToSearchView));
|
||||
}
|
||||
|
||||
Widget _buildVacationNotificationMessage(BuildContext context) {
|
||||
return Obx(() {
|
||||
final vacation = controller.mailboxDashBoardController.vacationResponse.value;
|
||||
if (vacation?.vacationResponderIsValid == true) {
|
||||
return VacationNotificationMessageWidget(
|
||||
margin: const EdgeInsets.only(bottom: 12, left: 12, right: 12),
|
||||
vacationResponse: vacation!,
|
||||
actionGotoVacationSetting: controller.mailboxDashBoardController.goToVacationSetting,
|
||||
actionEndNow: controller.mailboxDashBoardController.disableVacationResponder);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildListButtonSelectionForMobile(BuildContext context) {
|
||||
return Obx(() {
|
||||
if ((PlatformInfo.isMobile || (PlatformInfo.isWeb && controller.isSelectionEnabled()
|
||||
@@ -296,21 +322,6 @@ class ThreadView extends GetWidget<ThreadController>
|
||||
.build()).toList();
|
||||
}
|
||||
|
||||
Widget _buildListEmail(BuildContext context) {
|
||||
return Container(
|
||||
padding: PlatformInfo.isWeb
|
||||
? const EdgeInsets.symmetric(horizontal: 4)
|
||||
: EdgeInsets.zero,
|
||||
alignment: Alignment.center,
|
||||
color: Colors.white,
|
||||
child: Obx(() {
|
||||
return Visibility(
|
||||
visible: controller.openingEmail.isFalse,
|
||||
child: _buildResultListEmail(context, controller.mailboxDashBoardController.emailsInCurrentMailbox));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildResultListEmail(BuildContext context, List<PresentationEmail> listPresentationEmail) {
|
||||
if (controller.mailboxDashBoardController.currentSelectMode.value == SelectMode.INACTIVE) {
|
||||
return listPresentationEmail.isNotEmpty
|
||||
@@ -354,8 +365,8 @@ class ThreadView extends GetWidget<ThreadController>
|
||||
separatorBuilder: (context, index) {
|
||||
if (index < listPresentationEmail.length - 1) {
|
||||
return Padding(
|
||||
padding: ItemEmailTileStyles.getPaddingItemList(context, controller.responsiveUtils),
|
||||
child: const Divider(color: AppColor.lineItemListColor, height: 1));
|
||||
padding: ItemEmailTileStyles.getMobilePaddingItemList(context, controller.responsiveUtils),
|
||||
child: const Divider());
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
@@ -379,9 +390,8 @@ class ThreadView extends GetWidget<ThreadController>
|
||||
child: Divider(
|
||||
color: index < listPresentationEmail.length - 1 &&
|
||||
controller.mailboxDashBoardController.currentSelectMode.value == SelectMode.INACTIVE
|
||||
? AppColor.lineItemListColor
|
||||
? null
|
||||
: Colors.white,
|
||||
height: 1
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
@@ -42,7 +42,7 @@ class EmailTileBuilder extends StatelessWidget with BaseEmailItemTile {
|
||||
type: MaterialType.transparency,
|
||||
child: ListTile(
|
||||
tileColor: isShowingEmailContent ? AppColor.colorItemEmailSelectedDesktop : null,
|
||||
contentPadding: padding ?? ItemEmailTileStyles.getPaddingItemList(context, responsiveUtils),
|
||||
contentPadding: padding ?? ItemEmailTileStyles.getMobilePaddingItemList(context, responsiveUtils),
|
||||
onTap: () => emailActionClick?.call(
|
||||
EmailActionType.preview,
|
||||
presentationEmail),
|
||||
@@ -98,7 +98,7 @@ class EmailTileBuilder extends StatelessWidget with BaseEmailItemTile {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(top: 6),
|
||||
padding: const EdgeInsetsDirectional.only(top: 2),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -121,7 +121,7 @@ class EmailTileBuilder extends StatelessWidget with BaseEmailItemTile {
|
||||
],
|
||||
)),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(top: 6),
|
||||
padding: const EdgeInsetsDirectional.only(top: 2),
|
||||
child: Row(children: [
|
||||
Expanded(child: buildEmailPartialContent(
|
||||
context,
|
||||
|
||||
@@ -50,14 +50,11 @@ class _EmailTileBuilderState extends State<EmailTileBuilder> with BaseEmailItem
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: _getMarginItem(context),
|
||||
padding: widget.padding ?? _getPaddingItem(context),
|
||||
decoration: _getDecorationItem(),
|
||||
alignment: Alignment.center,
|
||||
child: ResponsiveWidget(
|
||||
responsiveUtils: responsiveUtils,
|
||||
mobile: InkWell(
|
||||
return ResponsiveWidget(
|
||||
responsiveUtils: responsiveUtils,
|
||||
mobile: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
EmailActionType.preview,
|
||||
widget.presentationEmail
|
||||
@@ -66,151 +63,36 @@ class _EmailTileBuilderState extends State<EmailTileBuilder> with BaseEmailItem
|
||||
EmailActionType.selection,
|
||||
widget.presentationEmail
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
widget.selectAllMode == SelectMode.ACTIVE
|
||||
? EmailActionType.selection
|
||||
: EmailActionType.preview,
|
||||
widget.presentationEmail
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(top: 8, end: 12),
|
||||
child: _buildAvatarIcon(context: context),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(children: [
|
||||
Row(children: [
|
||||
if (!widget.presentationEmail.hasRead)
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(end: 5),
|
||||
child: SvgPicture.asset(
|
||||
imagePaths.icUnreadStatus,
|
||||
width: 9,
|
||||
height: 9,
|
||||
fit: BoxFit.fill
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
child: buildInformationSender(
|
||||
context,
|
||||
widget.presentationEmail,
|
||||
widget.mailboxContain,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.searchQuery
|
||||
)
|
||||
),
|
||||
buildIconAnsweredOrForwarded(
|
||||
width: 16,
|
||||
height: 16,
|
||||
presentationEmail: widget.presentationEmail
|
||||
),
|
||||
if (widget.presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 8),
|
||||
child: SvgPicture.asset(
|
||||
imagePaths.icAttachment,
|
||||
width: 16,
|
||||
height: 16,
|
||||
fit: BoxFit.fill
|
||||
)
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(
|
||||
end: 4,
|
||||
start: 8
|
||||
),
|
||||
child: buildDateTime(context, widget.presentationEmail)
|
||||
),
|
||||
buildIconChevron()
|
||||
]),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (widget.presentationEmail.hasCalendarEvent)
|
||||
buildCalendarEventIcon(
|
||||
context: context,
|
||||
presentationEmail: widget.presentationEmail
|
||||
),
|
||||
Expanded(
|
||||
child: buildEmailTitle(
|
||||
context,
|
||||
widget.presentationEmail,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.searchQuery
|
||||
)
|
||||
),
|
||||
buildMailboxContain(
|
||||
context,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.presentationEmail
|
||||
),
|
||||
if (widget.presentationEmail.hasStarred)
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 8),
|
||||
child: buildIconStar(),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
padding: widget.padding ?? _getPaddingItem(context),
|
||||
decoration: _getDecorationItem(),
|
||||
alignment: Alignment.center,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
widget.selectAllMode == SelectMode.ACTIVE
|
||||
? EmailActionType.selection
|
||||
: EmailActionType.preview,
|
||||
widget.presentationEmail
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(children: [
|
||||
Expanded(
|
||||
child: buildEmailPartialContent(
|
||||
context,
|
||||
widget.presentationEmail,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.searchQuery
|
||||
)
|
||||
),
|
||||
]),
|
||||
]),
|
||||
)
|
||||
]
|
||||
)
|
||||
),
|
||||
tablet: InkWell(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
EmailActionType.preview,
|
||||
widget.presentationEmail
|
||||
),
|
||||
onHover: (value) => _hoverNotifier.value = value,
|
||||
child: Stack(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
EmailActionType.selection,
|
||||
widget.presentationEmail
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(top: 8, end: 12),
|
||||
child: ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
return _buildAvatarIcon(
|
||||
context: context,
|
||||
isHovered: value
|
||||
);
|
||||
}
|
||||
)
|
||||
)
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(top: 8, end: 12),
|
||||
child: _buildAvatarIcon(context: context),
|
||||
),
|
||||
Expanded(child: Column(children: [
|
||||
),
|
||||
Expanded(
|
||||
child: Column(children: [
|
||||
Row(children: [
|
||||
if (!widget.presentationEmail.hasRead)
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(end: 5),
|
||||
child: SvgPicture.asset(
|
||||
imagePaths.icUnreadStatus,
|
||||
width: 9,
|
||||
height: 9,
|
||||
fit: BoxFit.fill
|
||||
imagePaths.icUnreadStatus,
|
||||
width: 9,
|
||||
height: 9,
|
||||
fit: BoxFit.fill
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
@@ -222,18 +104,31 @@ class _EmailTileBuilderState extends State<EmailTileBuilder> with BaseEmailItem
|
||||
widget.searchQuery
|
||||
)
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
if (value) {
|
||||
return const SizedBox(width: 120);
|
||||
} else {
|
||||
return _buildDateTimeForMobileTabletScreen(context);
|
||||
}
|
||||
}
|
||||
buildIconAnsweredOrForwarded(
|
||||
width: 16,
|
||||
height: 16,
|
||||
presentationEmail: widget.presentationEmail
|
||||
),
|
||||
if (widget.presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 8),
|
||||
child: SvgPicture.asset(
|
||||
imagePaths.icAttachment,
|
||||
width: 16,
|
||||
height: 16,
|
||||
fit: BoxFit.fill
|
||||
)
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(
|
||||
end: 4,
|
||||
start: 8
|
||||
),
|
||||
child: buildDateTime(context, widget.presentationEmail)
|
||||
),
|
||||
buildIconChevron()
|
||||
]),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 2),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -259,10 +154,10 @@ class _EmailTileBuilderState extends State<EmailTileBuilder> with BaseEmailItem
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 8),
|
||||
child: buildIconStar(),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 2),
|
||||
Row(children: [
|
||||
Expanded(
|
||||
child: buildEmailPartialContent(
|
||||
@@ -273,153 +168,280 @@ class _EmailTileBuilderState extends State<EmailTileBuilder> with BaseEmailItem
|
||||
)
|
||||
),
|
||||
]),
|
||||
]))
|
||||
]
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
if (value) {
|
||||
return Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
child: Transform(
|
||||
transform: Matrix4.translationValues(
|
||||
0.0,
|
||||
widget.selectAllMode == SelectMode.INACTIVE ? -5.0 : 0.0,
|
||||
0.0
|
||||
),
|
||||
child: _buildListActionButtonWhenHover(context)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
)
|
||||
]
|
||||
),
|
||||
)
|
||||
),
|
||||
desktop: InkWell(
|
||||
),
|
||||
tablet: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
EmailActionType.preview,
|
||||
widget.presentationEmail
|
||||
),
|
||||
onHover: (value) => _hoverNotifier.value = value,
|
||||
child: Row(children: [
|
||||
Container(
|
||||
padding: const EdgeInsetsDirectional.symmetric(horizontal: 16),
|
||||
child: Container(
|
||||
padding: widget.padding ?? _getPaddingItem(context),
|
||||
decoration: _getDecorationItem(),
|
||||
alignment: Alignment.center,
|
||||
child: Stack(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
EmailActionType.selection,
|
||||
widget.presentationEmail
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(top: 8, end: 12),
|
||||
child: ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
return _buildAvatarIcon(
|
||||
context: context,
|
||||
isHovered: value
|
||||
);
|
||||
}
|
||||
)
|
||||
)
|
||||
),
|
||||
Expanded(child: Column(children: [
|
||||
Row(children: [
|
||||
if (!widget.presentationEmail.hasRead)
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(end: 5),
|
||||
child: SvgPicture.asset(
|
||||
imagePaths.icUnreadStatus,
|
||||
width: 9,
|
||||
height: 9,
|
||||
fit: BoxFit.fill
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
child: buildInformationSender(
|
||||
context,
|
||||
widget.presentationEmail,
|
||||
widget.mailboxContain,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.searchQuery
|
||||
)
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
if (value) {
|
||||
return const SizedBox(width: 120);
|
||||
} else {
|
||||
return _buildDateTimeForMobileTabletScreen(context);
|
||||
}
|
||||
}
|
||||
),
|
||||
]),
|
||||
const SizedBox(height: 2),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (widget.presentationEmail.hasCalendarEvent)
|
||||
buildCalendarEventIcon(
|
||||
context: context,
|
||||
presentationEmail: widget.presentationEmail
|
||||
),
|
||||
Expanded(
|
||||
child: buildEmailTitle(
|
||||
context,
|
||||
widget.presentationEmail,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.searchQuery
|
||||
)
|
||||
),
|
||||
buildMailboxContain(
|
||||
context,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.presentationEmail
|
||||
),
|
||||
if (widget.presentationEmail.hasStarred)
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 8),
|
||||
child: buildIconStar(),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Row(children: [
|
||||
Expanded(
|
||||
child: buildEmailPartialContent(
|
||||
context,
|
||||
widget.presentationEmail,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.searchQuery
|
||||
)
|
||||
),
|
||||
]),
|
||||
]))
|
||||
]
|
||||
),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
if (value) {
|
||||
return Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
child: Transform(
|
||||
transform: Matrix4.translationValues(
|
||||
0.0,
|
||||
widget.selectAllMode == SelectMode.INACTIVE ? -5.0 : 0.0,
|
||||
0.0
|
||||
),
|
||||
child: _buildListActionButtonWhenHover(context)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
desktop: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(
|
||||
top: 2,
|
||||
start: 3,
|
||||
end: 3,
|
||||
),
|
||||
child: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
EmailActionType.preview,
|
||||
widget.presentationEmail
|
||||
),
|
||||
onHover: (value) => _hoverNotifier.value = value,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
||||
child: Container(
|
||||
padding: widget.padding ?? _getPaddingItem(context),
|
||||
decoration: _getDecorationItem(),
|
||||
alignment: Alignment.center,
|
||||
child: !widget.presentationEmail.hasRead
|
||||
? SvgPicture.asset(
|
||||
imagePaths.icUnreadStatus,
|
||||
width: 9,
|
||||
height: 9,
|
||||
child: Row(children: [
|
||||
Container(
|
||||
padding: const EdgeInsetsDirectional.symmetric(horizontal: 16),
|
||||
alignment: Alignment.center,
|
||||
child: !widget.presentationEmail.hasRead
|
||||
? SvgPicture.asset(
|
||||
imagePaths.icUnreadStatus,
|
||||
width: 9,
|
||||
height: 9,
|
||||
fit: BoxFit.fill
|
||||
)
|
||||
: const SizedBox(width: 9)
|
||||
),
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
widget.presentationEmail.hasStarred
|
||||
? imagePaths.icStar
|
||||
: imagePaths.icUnStar,
|
||||
width: 16,
|
||||
height: 16,
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
tooltip: widget.presentationEmail.hasStarred
|
||||
? AppLocalizations.of(context).starred
|
||||
: AppLocalizations.of(context).not_starred,
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
widget.presentationEmail.hasStarred
|
||||
? EmailActionType.unMarkAsStarred
|
||||
: EmailActionType.markAsStarred,
|
||||
widget.presentationEmail
|
||||
)
|
||||
: const SizedBox(width: 9)
|
||||
),
|
||||
buildIconWeb(
|
||||
icon: buildIconAnsweredOrForwarded(presentationEmail: widget.presentationEmail),
|
||||
tooltip: messageToolTipForAnsweredOrForwarded(context, widget.presentationEmail),
|
||||
iconPadding: const EdgeInsetsDirectional.only(end: 12),
|
||||
splashRadius: 1
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
EmailActionType.selection,
|
||||
widget.presentationEmail
|
||||
),
|
||||
child: ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
return _buildAvatarIcon(
|
||||
context: context,
|
||||
isHovered: value,
|
||||
iconSize: 32,
|
||||
textStyle: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white
|
||||
)
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
SizedBox(
|
||||
width: 160,
|
||||
child: buildInformationSender(
|
||||
context,
|
||||
widget.presentationEmail,
|
||||
widget.mailboxContain,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.searchQuery
|
||||
)
|
||||
),
|
||||
const SizedBox(width: 24),
|
||||
Expanded(child: _buildSubjectAndContent()),
|
||||
const SizedBox(width: 16),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
if (value) {
|
||||
return _buildListActionButtonWhenHover(context);
|
||||
} else {
|
||||
return _buildDateTimeForDesktopScreen(context);
|
||||
}
|
||||
}
|
||||
),
|
||||
]),
|
||||
),
|
||||
buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
widget.presentationEmail.hasStarred
|
||||
? imagePaths.icStar
|
||||
: imagePaths.icUnStar,
|
||||
width: 16,
|
||||
height: 16,
|
||||
fit: BoxFit.fill
|
||||
),
|
||||
tooltip: widget.presentationEmail.hasStarred
|
||||
? AppLocalizations.of(context).starred
|
||||
: AppLocalizations.of(context).not_starred,
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
widget.presentationEmail.hasStarred
|
||||
? EmailActionType.unMarkAsStarred
|
||||
: EmailActionType.markAsStarred,
|
||||
widget.presentationEmail
|
||||
)
|
||||
),
|
||||
buildIconWeb(
|
||||
icon: buildIconAnsweredOrForwarded(presentationEmail: widget.presentationEmail),
|
||||
tooltip: messageToolTipForAnsweredOrForwarded(context, widget.presentationEmail),
|
||||
iconPadding: const EdgeInsetsDirectional.only(end: 12),
|
||||
splashRadius: 1
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => widget.emailActionClick?.call(
|
||||
EmailActionType.selection,
|
||||
widget.presentationEmail
|
||||
),
|
||||
child: ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
return _buildAvatarIcon(
|
||||
context: context,
|
||||
isHovered: value,
|
||||
iconSize: 32,
|
||||
textStyle: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white
|
||||
)
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
SizedBox(
|
||||
width: 160,
|
||||
child: buildInformationSender(
|
||||
context,
|
||||
widget.presentationEmail,
|
||||
widget.mailboxContain,
|
||||
widget.isSearchEmailRunning,
|
||||
widget.searchQuery
|
||||
)
|
||||
),
|
||||
const SizedBox(width: 24),
|
||||
Expanded(child: _buildSubjectAndContent()),
|
||||
const SizedBox(width: 16),
|
||||
ValueListenableBuilder(
|
||||
valueListenable: _hoverNotifier,
|
||||
builder: (context, value, child) {
|
||||
if (value) {
|
||||
return _buildListActionButtonWhenHover(context);
|
||||
} else {
|
||||
return _buildDateTimeForDesktopScreen(context);
|
||||
}
|
||||
}
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
EdgeInsetsGeometry _getMarginItem(BuildContext context) {
|
||||
if (responsiveUtils.isDesktop(context)) {
|
||||
return const EdgeInsets.only(top: 3);
|
||||
} else if (responsiveUtils.isTablet(context)) {
|
||||
return const EdgeInsetsDirectional.only(top: 3, start: 24, end: 24);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.only(top: 3, start: 12, end: 12);
|
||||
}
|
||||
}
|
||||
|
||||
EdgeInsetsGeometry _getPaddingItem(BuildContext context) {
|
||||
if (responsiveUtils.isDesktop(context)) {
|
||||
return const EdgeInsets.symmetric(vertical: 4);
|
||||
} else if (responsiveUtils.isTablet(context)) {
|
||||
return const EdgeInsetsDirectional.symmetric(vertical: 8, horizontal: 24);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.only(bottom: 4, end: 8, top: 4);
|
||||
return const EdgeInsetsDirectional.symmetric(vertical: 8, horizontal: 12);
|
||||
}
|
||||
}
|
||||
|
||||
BoxDecoration _getDecorationItem() {
|
||||
if ((widget.selectAllMode == SelectMode.ACTIVE && widget.presentationEmail.selectMode == SelectMode.ACTIVE) || widget.isDrag || widget.isShowingEmailContent) {
|
||||
BoxDecoration? _getDecorationItem() {
|
||||
if (((widget.selectAllMode == SelectMode.ACTIVE && widget.presentationEmail.selectMode == SelectMode.ACTIVE) || widget.isDrag) &&
|
||||
responsiveUtils.isDesktop(context)
|
||||
) {
|
||||
return const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||
color: AppColor.colorItemEmailSelectedDesktop);
|
||||
} else if (widget.isShowingEmailContent && responsiveUtils.isTabletLarge(context)) {
|
||||
return const BoxDecoration(color: AppColor.colorItemEmailSelectedDesktop);
|
||||
} else {
|
||||
return const BoxDecoration(color: Colors.white);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,22 +8,24 @@ import 'package:tmail_ui_user/features/thread/presentation/widgets/spam_banner/s
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class SpamReportBannerWidget extends StatelessWidget {
|
||||
const SpamReportBannerWidget({ Key? key }) : super(key: key);
|
||||
final EdgeInsetsGeometry? margin;
|
||||
final SpamReportController spamReportController;
|
||||
|
||||
const SpamReportBannerWidget({
|
||||
Key? key,
|
||||
required this.spamReportController,
|
||||
this.margin
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
final spamReportController = Get.find<SpamReportController>();
|
||||
|
||||
return Obx(() {
|
||||
if (!spamReportController.enableSpamReport || spamReportController.notShowSpamReportBanner) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Container(
|
||||
margin: const EdgeInsetsDirectional.only(
|
||||
start: SpamReportBannerStyles.horizontalMargin,
|
||||
end: SpamReportBannerStyles.horizontalMargin,
|
||||
bottom: SpamReportBannerStyles.verticalMargin
|
||||
),
|
||||
margin: margin,
|
||||
padding: const EdgeInsetsDirectional.all(SpamReportBannerStyles.padding),
|
||||
decoration: ShapeDecoration(
|
||||
color: SpamReportBannerStyles.backgroundColor,
|
||||
|
||||
Reference in New Issue
Block a user