TF-976 Fix red screen error on destination picker
This commit is contained in:
@@ -27,12 +27,12 @@ class DestinationPickerController extends BaseMailboxController {
|
|||||||
|
|
||||||
final mailboxAction = Rxn<MailboxActions>();
|
final mailboxAction = Rxn<MailboxActions>();
|
||||||
final listMailboxSearched = <PresentationMailbox>[].obs;
|
final listMailboxSearched = <PresentationMailbox>[].obs;
|
||||||
final mailboxIdSelected = Rxn<MailboxId>();
|
|
||||||
final searchState = SearchState.initial().obs;
|
final searchState = SearchState.initial().obs;
|
||||||
final searchQuery = SearchQuery.initial().obs;
|
final searchQuery = SearchQuery.initial().obs;
|
||||||
final mailboxCategoriesExpandMode = MailboxCategoriesExpandMode.initial().obs;
|
final mailboxCategoriesExpandMode = MailboxCategoriesExpandMode.initial().obs;
|
||||||
|
|
||||||
AccountId? accountId;
|
AccountId? accountId;
|
||||||
|
MailboxId? mailboxIdSelected;
|
||||||
final searchInputController = TextEditingController();
|
final searchInputController = TextEditingController();
|
||||||
final searchFocus = FocusNode();
|
final searchFocus = FocusNode();
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ class DestinationPickerController extends BaseMailboxController {
|
|||||||
final arguments = Get.arguments;
|
final arguments = Get.arguments;
|
||||||
if (arguments != null && arguments is DestinationPickerArguments) {
|
if (arguments != null && arguments is DestinationPickerArguments) {
|
||||||
mailboxAction.value = arguments.mailboxAction;
|
mailboxAction.value = arguments.mailboxAction;
|
||||||
mailboxIdSelected.value = arguments.mailboxIdSelected;
|
mailboxIdSelected = arguments.mailboxIdSelected;
|
||||||
accountId = arguments.accountId;
|
accountId = arguments.accountId;
|
||||||
getAllMailboxAction();
|
getAllMailboxAction();
|
||||||
}
|
}
|
||||||
@@ -59,9 +59,9 @@ class DestinationPickerController extends BaseMailboxController {
|
|||||||
super.onData(newState);
|
super.onData(newState);
|
||||||
newState.map((success) {
|
newState.map((success) {
|
||||||
if (success is GetAllMailboxSuccess) {
|
if (success is GetAllMailboxSuccess) {
|
||||||
if (mailboxAction.value == MailboxActions.move && mailboxIdSelected.value != null) {
|
if (mailboxAction.value == MailboxActions.move && mailboxIdSelected != null) {
|
||||||
final newMailboxList = success.mailboxList
|
final newMailboxList = success.mailboxList
|
||||||
.where((mailbox) => mailbox.id != mailboxIdSelected.value)
|
.where((mailbox) => mailbox.id != mailboxIdSelected)
|
||||||
.toList();
|
.toList();
|
||||||
buildTree(newMailboxList);
|
buildTree(newMailboxList);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:core/core.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||||
import 'package:model/model.dart';
|
import 'package:model/model.dart';
|
||||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||||
import 'package:tmail_ui_user/features/base/mixin/app_loader_mixin.dart';
|
import 'package:tmail_ui_user/features/base/mixin/app_loader_mixin.dart';
|
||||||
@@ -29,9 +30,11 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
MailboxActions? actions;
|
MailboxActions? actions;
|
||||||
|
MailboxId? mailboxIdSelected;
|
||||||
final arguments = Get.arguments;
|
final arguments = Get.arguments;
|
||||||
if (arguments != null && arguments is DestinationPickerArguments) {
|
if (arguments != null && arguments is DestinationPickerArguments) {
|
||||||
actions = arguments.mailboxAction;
|
actions = arguments.mailboxAction;
|
||||||
|
mailboxIdSelected = arguments.mailboxIdSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BuildUtils.isWeb) {
|
if (BuildUtils.isWeb) {
|
||||||
@@ -57,7 +60,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () => {},
|
onTap: () => {},
|
||||||
child: _buildDestinationPickerWebWidget(context, actions))
|
child: _buildDestinationPickerWebWidget(context, actions, mailboxIdSelected))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -67,6 +70,11 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final bodyMailboxLocation = _buildBodyMailboxLocation(
|
||||||
|
context,
|
||||||
|
actions,
|
||||||
|
mailboxIdSelected);
|
||||||
|
|
||||||
if (actions == MailboxActions.create) {
|
if (actions == MailboxActions.create) {
|
||||||
return PointerInterceptor(child: Card(
|
return PointerInterceptor(child: Card(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
@@ -77,32 +85,32 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
child: ResponsiveWidget(
|
child: ResponsiveWidget(
|
||||||
responsiveUtils: _responsiveUtils,
|
responsiveUtils: _responsiveUtils,
|
||||||
mobile: SizedBox(
|
mobile: SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: double.infinity),
|
width: double.infinity),
|
||||||
landscapeMobile: Row(children: [
|
landscapeMobile: Row(children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: ResponsiveUtils.defaultSizeDrawer),
|
width: ResponsiveUtils.defaultSizeDrawer),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
tablet: Row(children: [
|
tablet: Row(children: [
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: _responsiveUtils.getSizeScreenWidth(context) -
|
width: _responsiveUtils.getSizeScreenWidth(context) -
|
||||||
ResponsiveUtils.defaultSizeDrawer),
|
ResponsiveUtils.defaultSizeDrawer),
|
||||||
]),
|
]),
|
||||||
landscapeTablet: Row(children: [
|
landscapeTablet: Row(children: [
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: _responsiveUtils.getSizeScreenWidth(context) -
|
width: _responsiveUtils.getSizeScreenWidth(context) -
|
||||||
ResponsiveUtils.defaultSizeLeftMenuMobile),
|
ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
]),
|
]),
|
||||||
tabletLarge: Row(children: [
|
tabletLarge: Row(children: [
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: _responsiveUtils.getSizeScreenWidth(context) -
|
width: _responsiveUtils.getSizeScreenWidth(context) -
|
||||||
ResponsiveUtils.defaultSizeLeftMenuMobile),
|
ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
]),
|
]),
|
||||||
@@ -119,29 +127,29 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
child: ResponsiveWidget(
|
child: ResponsiveWidget(
|
||||||
responsiveUtils: _responsiveUtils,
|
responsiveUtils: _responsiveUtils,
|
||||||
mobile: SizedBox(
|
mobile: SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: double.infinity),
|
width: double.infinity),
|
||||||
landscapeMobile: Row(children: [
|
landscapeMobile: Row(children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: ResponsiveUtils.defaultSizeDrawer),
|
width: ResponsiveUtils.defaultSizeDrawer),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
tablet: Row(children: [
|
tablet: Row(children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: ResponsiveUtils.defaultSizeDrawer),
|
width: ResponsiveUtils.defaultSizeDrawer),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
landscapeTablet: Row(children: [
|
landscapeTablet: Row(children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: ResponsiveUtils.defaultSizeLeftMenuMobile),
|
width: ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
tabletLarge: Row(children: [
|
tabletLarge: Row(children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: _buildBodyMailboxLocation(context, actions),
|
child: bodyMailboxLocation,
|
||||||
width: ResponsiveUtils.defaultSizeLeftMenuMobile),
|
width: ResponsiveUtils.defaultSizeLeftMenuMobile),
|
||||||
Expanded(child: Container(color: Colors.transparent)),
|
Expanded(child: Container(color: Colors.transparent)),
|
||||||
]),
|
]),
|
||||||
@@ -151,7 +159,11 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDestinationPickerWebWidget(BuildContext context, MailboxActions? actions) {
|
Widget _buildDestinationPickerWebWidget(
|
||||||
|
BuildContext context,
|
||||||
|
MailboxActions? actions,
|
||||||
|
MailboxId? mailboxIdSelected
|
||||||
|
) {
|
||||||
return Column(children: [
|
return Column(children: [
|
||||||
Obx(() => TopBarDestinationPickerWebBuilder(
|
Obx(() => TopBarDestinationPickerWebBuilder(
|
||||||
controller.mailboxAction.value,
|
controller.mailboxAction.value,
|
||||||
@@ -161,11 +173,15 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
: const SizedBox.shrink()),
|
: const SizedBox.shrink()),
|
||||||
Expanded(child: Container(
|
Expanded(child: Container(
|
||||||
color: actions?.getBackgroundColor(),
|
color: actions?.getBackgroundColor(),
|
||||||
child: _buildBodyDestinationPicker(context, actions)))
|
child: _buildBodyDestinationPicker(context, actions, mailboxIdSelected)))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBodyMailboxLocation(BuildContext context, MailboxActions? actions) {
|
Widget _buildBodyMailboxLocation(
|
||||||
|
BuildContext context,
|
||||||
|
MailboxActions? actions,
|
||||||
|
MailboxId? mailboxIdSelected
|
||||||
|
) {
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
top: !BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context),
|
top: !BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context),
|
||||||
bottom: false,
|
bottom: false,
|
||||||
@@ -211,7 +227,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
left: !BuildUtils.isWeb &&
|
left: !BuildUtils.isWeb &&
|
||||||
_responsiveUtils.isLandscapeMobile(context),
|
_responsiveUtils.isLandscapeMobile(context),
|
||||||
right: false,
|
right: false,
|
||||||
child: _buildBodyDestinationPicker(context, actions))))
|
child: _buildBodyDestinationPicker(context, actions, mailboxIdSelected))))
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@@ -238,13 +254,17 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
onOpenSearchViewAction: controller.enableSearch));
|
onOpenSearchViewAction: controller.enableSearch));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBodyDestinationPicker(BuildContext context, MailboxActions? actions) {
|
Widget _buildBodyDestinationPicker(
|
||||||
|
BuildContext context,
|
||||||
|
MailboxActions? actions,
|
||||||
|
MailboxId? mailboxIdSelected
|
||||||
|
) {
|
||||||
return RefreshIndicator(
|
return RefreshIndicator(
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
onRefresh: () async => controller.getAllMailboxAction(),
|
onRefresh: () async => controller.getAllMailboxAction(),
|
||||||
child: Obx(() => controller.isSearchActive()
|
child: Obx(() => controller.isSearchActive()
|
||||||
? _buildListMailboxSearched(context, actions)
|
? _buildListMailboxSearched(context, actions, mailboxIdSelected)
|
||||||
: _buildListMailbox(context, actions)));
|
: _buildListMailbox(context, actions, mailboxIdSelected)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildLoadingView() {
|
Widget _buildLoadingView() {
|
||||||
@@ -257,7 +277,11 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
: const SizedBox.shrink()));
|
: const SizedBox.shrink()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildListMailbox(BuildContext context, MailboxActions? actions) {
|
Widget _buildListMailbox(
|
||||||
|
BuildContext context,
|
||||||
|
MailboxActions? actions,
|
||||||
|
MailboxId? mailboxIdSelected
|
||||||
|
) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
physics: const ClampingScrollPhysics(),
|
physics: const ClampingScrollPhysics(),
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
@@ -268,7 +292,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
if (actions?.hasAllMailboxDefault() == true)
|
if (actions?.hasAllMailboxDefault() == true)
|
||||||
...[
|
...[
|
||||||
_buildUnifiedMailbox(context, actions),
|
_buildUnifiedMailbox(context, actions, mailboxIdSelected),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
if (actions != MailboxActions.create &&
|
if (actions != MailboxActions.create &&
|
||||||
(
|
(
|
||||||
@@ -290,7 +314,12 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
thickness: 0.2)),
|
thickness: 0.2)),
|
||||||
],
|
],
|
||||||
Obx(() => controller.defaultMailboxHasChild
|
Obx(() => controller.defaultMailboxHasChild
|
||||||
? _buildMailboxCategory(context, MailboxCategories.exchange, controller.defaultRootNode, actions)
|
? _buildMailboxCategory(
|
||||||
|
context,
|
||||||
|
MailboxCategories.exchange,
|
||||||
|
controller.defaultRootNode,
|
||||||
|
actions,
|
||||||
|
mailboxIdSelected)
|
||||||
: const SizedBox.shrink()),
|
: const SizedBox.shrink()),
|
||||||
if (actions == MailboxActions.create) const SizedBox(height: 12),
|
if (actions == MailboxActions.create) const SizedBox(height: 12),
|
||||||
if (actions != MailboxActions.create && !BuildUtils.isWeb)
|
if (actions != MailboxActions.create && !BuildUtils.isWeb)
|
||||||
@@ -298,23 +327,44 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
padding: EdgeInsets.only(left: 55, right: 20),
|
padding: EdgeInsets.only(left: 55, right: 20),
|
||||||
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
||||||
Obx(() => controller.folderMailboxHasChild
|
Obx(() => controller.folderMailboxHasChild
|
||||||
? _buildMailboxCategory(context, MailboxCategories.folders, controller.folderRootNode, actions)
|
? _buildMailboxCategory(
|
||||||
|
context,
|
||||||
|
MailboxCategories.folders,
|
||||||
|
controller.folderRootNode,
|
||||||
|
actions,
|
||||||
|
mailboxIdSelected)
|
||||||
: const SizedBox.shrink()),
|
: const SizedBox.shrink()),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMailboxCategory(BuildContext context, MailboxCategories categories, MailboxNode mailboxNode, MailboxActions? actions) {
|
Widget _buildMailboxCategory(
|
||||||
|
BuildContext context,
|
||||||
|
MailboxCategories categories,
|
||||||
|
MailboxNode mailboxNode,
|
||||||
|
MailboxActions? actions,
|
||||||
|
MailboxId? mailboxIdSelected
|
||||||
|
) {
|
||||||
if (actions?.canCollapseMailboxGroup() == false) {
|
if (actions?.canCollapseMailboxGroup() == false) {
|
||||||
return _buildBodyMailboxCategory(context, categories, mailboxNode, actions);
|
return _buildBodyMailboxCategory(
|
||||||
|
context,
|
||||||
|
categories,
|
||||||
|
mailboxNode,
|
||||||
|
actions,
|
||||||
|
mailboxIdSelected);
|
||||||
}
|
}
|
||||||
return Column(children: [
|
return Column(children: [
|
||||||
_buildHeaderMailboxCategory(context, categories),
|
_buildHeaderMailboxCategory(context, categories),
|
||||||
AnimatedContainer(
|
AnimatedContainer(
|
||||||
duration: const Duration(milliseconds: 400),
|
duration: const Duration(milliseconds: 400),
|
||||||
child: categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND
|
child: categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND
|
||||||
? _buildBodyMailboxCategory(context, categories, mailboxNode, actions)
|
? _buildBodyMailboxCategory(
|
||||||
|
context,
|
||||||
|
categories,
|
||||||
|
mailboxNode,
|
||||||
|
actions,
|
||||||
|
mailboxIdSelected)
|
||||||
: const Offstage())
|
: const Offstage())
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -341,7 +391,13 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBodyMailboxCategory(BuildContext context, MailboxCategories categories, MailboxNode mailboxNode, MailboxActions? actions) {
|
Widget _buildBodyMailboxCategory(
|
||||||
|
BuildContext context,
|
||||||
|
MailboxCategories categories,
|
||||||
|
MailboxNode mailboxNode,
|
||||||
|
MailboxActions? actions,
|
||||||
|
MailboxId? mailboxIdSelected
|
||||||
|
) {
|
||||||
final lastNode = mailboxNode.childrenItems?.last;
|
final lastNode = mailboxNode.childrenItems?.last;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
@@ -353,6 +409,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
children: _buildListChildTileWidget(
|
children: _buildListChildTileWidget(
|
||||||
context,
|
context,
|
||||||
mailboxNode,
|
mailboxNode,
|
||||||
|
mailboxIdSelected,
|
||||||
lastNode: lastNode,
|
lastNode: lastNode,
|
||||||
actions: actions)));
|
actions: actions)));
|
||||||
}
|
}
|
||||||
@@ -386,6 +443,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
List<Widget> _buildListChildTileWidget(
|
List<Widget> _buildListChildTileWidget(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
MailboxNode parentNode,
|
MailboxNode parentNode,
|
||||||
|
MailboxId? mailboxIdSelected,
|
||||||
{
|
{
|
||||||
MailboxNode? lastNode,
|
MailboxNode? lastNode,
|
||||||
MailboxActions? actions
|
MailboxActions? actions
|
||||||
@@ -403,12 +461,12 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
mailboxNode,
|
mailboxNode,
|
||||||
lastNode: lastNode,
|
lastNode: lastNode,
|
||||||
mailboxActions: actions,
|
mailboxActions: actions,
|
||||||
mailboxIdSelected: controller.mailboxIdSelected.value,
|
mailboxIdSelected: mailboxIdSelected,
|
||||||
mailboxDisplayed: MailboxDisplayed.destinationPicker)
|
mailboxDisplayed: MailboxDisplayed.destinationPicker)
|
||||||
..addOnOpenMailboxFolderClick(_handleOpenMailboxClick)
|
..addOnOpenMailboxFolderClick(_handleOpenMailboxClick)
|
||||||
..addOnExpandFolderActionClick((mailboxNode) => controller.toggleMailboxFolder(mailboxNode)))
|
..addOnExpandFolderActionClick((mailboxNode) => controller.toggleMailboxFolder(mailboxNode)))
|
||||||
.build(),
|
.build(),
|
||||||
children: _buildListChildTileWidget(context, mailboxNode, actions: actions)
|
children: _buildListChildTileWidget(context, mailboxNode, mailboxIdSelected, actions: actions)
|
||||||
).build()
|
).build()
|
||||||
: (MailBoxFolderTileBuilder(
|
: (MailBoxFolderTileBuilder(
|
||||||
context,
|
context,
|
||||||
@@ -416,14 +474,18 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
mailboxNode,
|
mailboxNode,
|
||||||
lastNode: lastNode,
|
lastNode: lastNode,
|
||||||
mailboxDisplayed: MailboxDisplayed.destinationPicker,
|
mailboxDisplayed: MailboxDisplayed.destinationPicker,
|
||||||
mailboxIdSelected: controller.mailboxIdSelected.value,
|
mailboxIdSelected: mailboxIdSelected,
|
||||||
mailboxActions: actions)
|
mailboxActions: actions)
|
||||||
..addOnOpenMailboxFolderClick(_handleOpenMailboxClick))
|
..addOnOpenMailboxFolderClick(_handleOpenMailboxClick))
|
||||||
.build())
|
.build())
|
||||||
.toList() ?? <Widget>[];
|
.toList() ?? <Widget>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildListMailboxSearched(BuildContext context, MailboxActions? actions) {
|
Widget _buildListMailboxSearched(
|
||||||
|
BuildContext context,
|
||||||
|
MailboxActions? actions,
|
||||||
|
MailboxId? mailboxIdSelected
|
||||||
|
) {
|
||||||
return Obx(() => Container(
|
return Obx(() => Container(
|
||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsets.only(
|
||||||
right: 8,
|
right: 8,
|
||||||
@@ -447,7 +509,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
_responsiveUtils,
|
_responsiveUtils,
|
||||||
controller.listMailboxSearched[index],
|
controller.listMailboxSearched[index],
|
||||||
mailboxActions: actions,
|
mailboxActions: actions,
|
||||||
mailboxIdSelected: controller.mailboxIdSelected.value,
|
mailboxIdSelected: mailboxIdSelected,
|
||||||
mailboxDisplayed: MailboxDisplayed.destinationPicker,
|
mailboxDisplayed: MailboxDisplayed.destinationPicker,
|
||||||
lastMailbox: controller.listMailboxSearched.last)
|
lastMailbox: controller.listMailboxSearched.last)
|
||||||
..addOnOpenMailboxAction((mailbox) => controller.selectMailboxAction(mailbox)))
|
..addOnOpenMailboxAction((mailbox) => controller.selectMailboxAction(mailbox)))
|
||||||
@@ -456,7 +518,11 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildUnifiedMailbox(BuildContext context, MailboxActions? actions) {
|
Widget _buildUnifiedMailbox(
|
||||||
|
BuildContext context,
|
||||||
|
MailboxActions? actions,
|
||||||
|
MailboxId? mailboxIdSelected
|
||||||
|
) {
|
||||||
if (actions == MailboxActions.move || actions == MailboxActions.select) {
|
if (actions == MailboxActions.move || actions == MailboxActions.select) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => controller.selectMailboxAction(PresentationMailbox.unifiedMailbox),
|
onTap: () => controller.selectMailboxAction(PresentationMailbox.unifiedMailbox),
|
||||||
@@ -497,21 +563,16 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
fontWeight: FontWeight.normal),
|
fontWeight: FontWeight.normal),
|
||||||
)),
|
)),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Obx(() {
|
if (actions == MailboxActions.select && (mailboxIdSelected == null ||
|
||||||
if (actions == MailboxActions.select &&
|
mailboxIdSelected == PresentationMailbox.unifiedMailbox.id))
|
||||||
(controller.mailboxIdSelected.value == null ||
|
Padding(
|
||||||
controller.mailboxIdSelected.value == PresentationMailbox.unifiedMailbox.id)) {
|
padding: const EdgeInsets.only(right: 30.0),
|
||||||
return Padding(
|
child: SvgPicture.asset(
|
||||||
padding: const EdgeInsets.only(right: 30.0),
|
_imagePaths.icFilterSelected,
|
||||||
child: SvgPicture.asset(
|
width: 20,
|
||||||
_imagePaths.icFilterSelected,
|
height: 20,
|
||||||
width: 20,
|
fit: BoxFit.fill),
|
||||||
height: 20,
|
)
|
||||||
fit: BoxFit.fill),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
})
|
|
||||||
])
|
])
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user