TF-3947 Thread Detail Thread level move & delete
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
@@ -23,6 +24,7 @@ class ThreadDetailAppBar extends StatelessWidget {
|
||||
required this.threadActionReady,
|
||||
required this.threadDetailIsStarred,
|
||||
required this.isThreadDetailEnabled,
|
||||
required this.threadDetailCanPermanentlyDelete,
|
||||
this.mailboxContain,
|
||||
this.optionWidgets = const [],
|
||||
this.onThreadActionClick,
|
||||
@@ -36,6 +38,7 @@ class ThreadDetailAppBar extends StatelessWidget {
|
||||
final bool threadActionReady;
|
||||
final bool threadDetailIsStarred;
|
||||
final bool isThreadDetailEnabled;
|
||||
final bool threadDetailCanPermanentlyDelete;
|
||||
final PresentationMailbox? mailboxContain;
|
||||
final List<Widget> optionWidgets;
|
||||
final OnThreadActionClick? onThreadActionClick;
|
||||
@@ -81,7 +84,7 @@ class ThreadDetailAppBar extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
if (_supportDisplayMailboxNameTitle(context)) backButton,
|
||||
if (isThreadDetailEnabled && threadActionReady)
|
||||
if (isThreadDetailEnabled && threadActionReady) ...[
|
||||
_ThreadDetailAppBarButton(
|
||||
icon: threadDetailIsStarred
|
||||
? imagePaths.icStar
|
||||
@@ -95,6 +98,26 @@ class ThreadDetailAppBar extends StatelessWidget {
|
||||
? (_) => onThreadActionClick?.call(EmailActionType.unMarkAsStarred)
|
||||
: (_) => onThreadActionClick?.call(EmailActionType.markAsStarred),
|
||||
),
|
||||
_ThreadDetailAppBarButton(
|
||||
icon: imagePaths.icMoveEmail,
|
||||
tooltipMessage: AppLocalizations.of(context).moveMessage,
|
||||
responsiveUtils: responsiveUtils,
|
||||
onTapActionCallback: (_) => onThreadActionClick?.call(EmailActionType.moveToMailbox),
|
||||
),
|
||||
_ThreadDetailAppBarButton(
|
||||
icon: imagePaths.icDeleteComposer,
|
||||
iconColor: threadDetailCanPermanentlyDelete
|
||||
? AppColor.redFF3347
|
||||
: EmailViewAppBarWidgetStyles.iconColor,
|
||||
tooltipMessage: threadDetailCanPermanentlyDelete
|
||||
? AppLocalizations.of(context).delete_permanently
|
||||
: AppLocalizations.of(context).move_to_trash,
|
||||
responsiveUtils: responsiveUtils,
|
||||
onTapActionCallback: threadDetailCanPermanentlyDelete
|
||||
? (_) => onThreadActionClick?.call(EmailActionType.deletePermanently)
|
||||
: (_) => onThreadActionClick?.call(EmailActionType.moveToTrash),
|
||||
),
|
||||
],
|
||||
if (!responsiveUtils.isMobile(context)) const Spacer(),
|
||||
if (AppUtils.getCurrentDirection(context) == TextDirection.rtl)
|
||||
...optionWidgets.reversed
|
||||
|
||||
Reference in New Issue
Block a user