TF-3763 Update style for button actions in advanced search view
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
+1
-4
@@ -10,7 +10,6 @@ class InputFieldFocusManager {
|
||||
late FocusNode notKeywordFieldFocusNode;
|
||||
late FocusNode mailboxFieldFocusNode;
|
||||
late FocusNode attachmentCheckboxFocusNode;
|
||||
late FocusNode searchButtonFocusNode;
|
||||
|
||||
InputFieldFocusManager() {
|
||||
fromFieldFocusNode = FocusNode();
|
||||
@@ -19,8 +18,7 @@ class InputFieldFocusManager {
|
||||
hasKeywordFieldFocusNode = FocusNode();
|
||||
notKeywordFieldFocusNode = FocusNode();
|
||||
mailboxFieldFocusNode = FocusNode();
|
||||
attachmentCheckboxFocusNode = FocusNode(skipTraversal: true);
|
||||
searchButtonFocusNode = FocusNode();
|
||||
attachmentCheckboxFocusNode = FocusNode();
|
||||
}
|
||||
|
||||
factory InputFieldFocusManager.initial() {
|
||||
@@ -35,6 +33,5 @@ class InputFieldFocusManager {
|
||||
notKeywordFieldFocusNode.dispose();
|
||||
mailboxFieldFocusNode.dispose();
|
||||
attachmentCheckboxFocusNode.dispose();
|
||||
searchButtonFocusNode.dispose();
|
||||
}
|
||||
}
|
||||
+43
-95
@@ -1,7 +1,6 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/button/icon_button_web.dart';
|
||||
import 'package:core/presentation/views/checkbox/custom_icon_labeled_checkbox.dart';
|
||||
import 'package:core/presentation/views/dialog/confirm_dialog_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -28,76 +27,49 @@ class AdvancedSearchFilterFormBottomView extends GetWidget<AdvancedFilterControl
|
||||
context,
|
||||
focusManager.attachmentCheckboxFocusNode,
|
||||
),
|
||||
_buildListButton(context, controller.responsiveUtils),
|
||||
_buildListButton(context),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildListButton(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (!responsiveUtils.isWebDesktop(context)) {
|
||||
return Row(children: [
|
||||
Expanded(
|
||||
child: _buildButton(
|
||||
onAction: () {
|
||||
controller.clearSearchFilter();
|
||||
popBack();
|
||||
},
|
||||
colorButton: Colors.white,
|
||||
colorText: AppColor.colorContentEmail,
|
||||
text: AppLocalizations.of(context).clearFilter,
|
||||
context: context,
|
||||
responsiveUtils: responsiveUtils,
|
||||
Widget _buildListButton(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(minWidth: 92),
|
||||
height: 48,
|
||||
child: ConfirmDialogButton(
|
||||
label: AppLocalizations.of(context).clearFilter,
|
||||
onTapAction: _onClickCancelButton,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _buildButton(
|
||||
onAction: () {
|
||||
controller.applyAdvancedSearchFilter();
|
||||
popBack();
|
||||
const SizedBox(width: 8),
|
||||
Flexible(
|
||||
child: KeyboardListener(
|
||||
focusNode: FocusNode(),
|
||||
onKeyEvent: (event) {
|
||||
if (event is KeyDownEvent &&
|
||||
event.logicalKey == LogicalKeyboardKey.tab) {
|
||||
focusManager.fromFieldFocusNode.requestFocus();
|
||||
}
|
||||
},
|
||||
colorButton: AppColor.primaryColor,
|
||||
colorText: AppColor.primaryLightColor,
|
||||
text: AppLocalizations.of(context).search,
|
||||
context: context,
|
||||
responsiveUtils: responsiveUtils,
|
||||
currentFocusNode: focusManager.searchButtonFocusNode,
|
||||
nextFocusNode: focusManager.fromFieldFocusNode
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(minWidth: 112),
|
||||
height: 48,
|
||||
child: ConfirmDialogButton(
|
||||
label: AppLocalizations.of(context).search,
|
||||
backgroundColor: AppColor.primaryMain,
|
||||
textColor: Colors.white,
|
||||
onTapAction: _onClickSearchButton,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
return Row(children: [
|
||||
const Spacer(),
|
||||
_buildButton(
|
||||
onAction: () {
|
||||
controller.clearSearchFilter();
|
||||
popBack();
|
||||
},
|
||||
colorButton: Colors.transparent,
|
||||
colorText: AppColor.colorContentEmail,
|
||||
text: AppLocalizations.of(context).clearFilter,
|
||||
context: context,
|
||||
responsiveUtils: responsiveUtils,
|
||||
minWidth: 92
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
_buildButton(
|
||||
onAction: () {
|
||||
controller.applyAdvancedSearchFilter();
|
||||
popBack();
|
||||
},
|
||||
colorButton: AppColor.primaryColor,
|
||||
colorText: AppColor.primaryLightColor,
|
||||
text: AppLocalizations.of(context).search,
|
||||
context: context,
|
||||
responsiveUtils: responsiveUtils,
|
||||
minWidth: 144,
|
||||
currentFocusNode: focusManager.searchButtonFocusNode,
|
||||
nextFocusNode: focusManager.fromFieldFocusNode
|
||||
),
|
||||
]);
|
||||
}
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCheckboxHasAttachment(
|
||||
@@ -116,37 +88,13 @@ class AdvancedSearchFilterFormBottomView extends GetWidget<AdvancedFilterControl
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildButton({
|
||||
required Color colorButton,
|
||||
required Color colorText,
|
||||
required String text,
|
||||
required VoidCallback onAction,
|
||||
required BuildContext context,
|
||||
required ResponsiveUtils responsiveUtils,
|
||||
FocusNode? currentFocusNode,
|
||||
FocusNode? nextFocusNode,
|
||||
double? minWidth,
|
||||
}) {
|
||||
return KeyboardListener(
|
||||
focusNode: FocusNode(),
|
||||
onKeyEvent: (event) {
|
||||
if (event is KeyDownEvent &&
|
||||
event.logicalKey == LogicalKeyboardKey.tab) {
|
||||
nextFocusNode?.requestFocus();
|
||||
}
|
||||
},
|
||||
child: buildButtonWrapText(
|
||||
text,
|
||||
focusNode: currentFocusNode,
|
||||
radius: 10,
|
||||
height: 44,
|
||||
minWidth: minWidth,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 17,
|
||||
color: colorText,
|
||||
fontWeight: FontWeight.w500),
|
||||
bgColor: colorButton,
|
||||
onTap: onAction),
|
||||
);
|
||||
void _onClickCancelButton() {
|
||||
controller.clearSearchFilter();
|
||||
popBack();
|
||||
}
|
||||
|
||||
void _onClickSearchButton() {
|
||||
controller.applyAdvancedSearchFilter();
|
||||
popBack();
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/advanced_filter_controller.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/search_controller.dart' as search;
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class IconOpenAdvancedSearchWidget extends StatelessWidget {
|
||||
IconOpenAdvancedSearchWidget({Key? key}) : super(key: key);
|
||||
@@ -31,7 +30,6 @@ class IconOpenAdvancedSearchWidget extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(4),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 12),
|
||||
backgroundColor: Colors.transparent,
|
||||
tooltipMessage: AppLocalizations.of(context).advancedSearch,
|
||||
onTapActionCallback: () => _onClickOpenAdvancedSearchView(context),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -262,7 +262,6 @@ class SearchInputFormWidget extends StatelessWidget with AppLoaderMixin {
|
||||
iconSize: 22,
|
||||
backgroundColor: Colors.transparent,
|
||||
padding: const EdgeInsets.all(4),
|
||||
tooltipMessage: AppLocalizations.of(context).search,
|
||||
onTapActionCallback: () => _invokeSearchEmailAction(_searchController.searchInputController.text.trim())
|
||||
)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user