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