TF-2323 Implement from criterion with selection and follow search recommendation

(cherry picked from commit 23817c87d602c370fc9a0ea5fc86e660d61b7f07)
This commit is contained in:
hieubt
2023-11-26 13:51:38 +07:00
committed by Dat H. Pham
parent 7ac76486ed
commit d4f72b7d81
4 changed files with 64 additions and 30 deletions
@@ -78,25 +78,34 @@ class ContactView extends GetWidget<ContactController> {
onTextChangeSearchAction: controller.onTextSearchChange,
onSearchTextAction: controller.onSearchTextAction,
),
if (PlatformInfo.isWeb && !controller.responsiveUtils.isMobile(context))
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Column(
children: [
Obx(() => ContactSuggestionBoxItem(
controller.getFromMeSuggestion(context),
padding: ContactUtils.getPaddingSearchResultList(context, controller.responsiveUtils),
selectedContactCallbackAction: (contact) {
controller.selectContact(context, contact);
},
)),
Padding(
padding: ContactUtils.getPaddingDividerSearchResultList(context, controller.responsiveUtils),
child: const Divider(height: 1, color: AppColor.colorDivider),
if (PlatformInfo.isWeb)
Obx(() {
final userEmail = controller.userProfile.value?.email;
if (userEmail != null && userEmail.isNotEmpty) {
final userEmailAddress = EmailAddress(AppLocalizations.of(context).me, controller.userProfile.value?.email);
final fromMeSuggestionEmailAddress = SuggestionEmailAddress(userEmailAddress, state: SuggestionEmailState.valid);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Column(
children: [
ContactSuggestionBoxItem(
fromMeSuggestionEmailAddress,
padding: ContactUtils.getPaddingSearchResultList(context, controller.responsiveUtils),
selectedContactCallbackAction: (contact) {
controller.selectContact(context, contact);
},
),
Padding(
padding: ContactUtils.getPaddingDividerSearchResultList(context, controller.responsiveUtils),
child: const Divider(height: 1, color: AppColor.colorDivider),
),
],
),
],
),
),
);
} else {
return const SizedBox.shrink();
}
}),
Expanded(child: Obx(() {
if (controller.listContactSearched.isNotEmpty) {
if (PlatformInfo.isMobile) {