diff --git a/lib/features/rules_filter_creator/presentation/rules_filter_creator_controller.dart b/lib/features/rules_filter_creator/presentation/rules_filter_creator_controller.dart index 5f70f24817..062c7a90ae 100644 --- a/lib/features/rules_filter_creator/presentation/rules_filter_creator_controller.dart +++ b/lib/features/rules_filter_creator/presentation/rules_filter_creator_controller.dart @@ -184,11 +184,11 @@ class RulesFilterCreatorController extends BaseMailboxController { ); listRuleCondition.add(currentRule); RulesFilterInputFieldArguments newRuleConditionValueArguments = RulesFilterInputFieldArguments( - focusNode: FocusNode(), - errorText: '', - controller: TextEditingController(), - ); - listRuleConditionValueArguments.add(newRuleConditionValueArguments); + focusNode: FocusNode(), + errorText: '', + controller: TextEditingController(), + ); + listRuleConditionValueArguments.add(newRuleConditionValueArguments); emailRuleFilterActionSelected.value = EmailRuleFilterAction.moveMessage; _setValueInputField( listRuleConditionValueArguments[0].controller, @@ -311,10 +311,11 @@ class RulesFilterCreatorController extends BaseMailboxController { } } - void createNewRuleFilter(BuildContext context) async { + void createNewRuleFilter(BuildContext context) { KeyboardUtils.hideKeyboard(context); final errorName = _getErrorStringByInputValue(context, _newRuleName); + log('RulesFilterCreatorController::createNewRuleFilter:errorName: $errorName'); if (errorName?.isNotEmpty == true) { errorRuleName.value = errorName; inputRuleNameFocusNode.requestFocus(); @@ -322,23 +323,28 @@ class RulesFilterCreatorController extends BaseMailboxController { } if (listRuleCondition.isNotEmpty) { + String? errorConditionString; for (var ruleCondition in listRuleCondition) { - String? errorString = _getErrorStringByInputValue(context, ruleCondition.value); - if (errorString != null) { + errorConditionString = _getErrorStringByInputValue(context, ruleCondition.value); + log('RulesFilterCreatorController::createNewRuleFilter:errorConditionString: $errorConditionString'); + if (errorConditionString != null) { int ruleConditionIndex = listRuleCondition.indexOf(ruleCondition); RulesFilterInputFieldArguments newRuleConditionValueArguments = RulesFilterInputFieldArguments( focusNode: listRuleConditionValueArguments[ruleConditionIndex].focusNode, - errorText: errorString, + errorText: errorConditionString, controller: listRuleConditionValueArguments[ruleConditionIndex].controller, ); listRuleConditionValueArguments[ruleConditionIndex] = newRuleConditionValueArguments; listRuleConditionValueArguments[listRuleCondition.indexOf(ruleCondition)].focusNode.requestFocus(); } } - return; + if (errorConditionString?.isNotEmpty == true) { + return; + } } final errorAction = _getErrorStringByInputValue(context, mailboxSelected.value?.getDisplayName(context)); + log('RulesFilterCreatorController::createNewRuleFilter:errorAction: $errorAction'); if (errorAction?.isNotEmpty == true) { errorRuleActionValue.value = errorAction; if (currentOverlayContext != null && currentContext != null) { diff --git a/lib/features/rules_filter_creator/presentation/rules_filter_creator_view.dart b/lib/features/rules_filter_creator/presentation/rules_filter_creator_view.dart index dc33991aa8..83122c8d10 100644 --- a/lib/features/rules_filter_creator/presentation/rules_filter_creator_view.dart +++ b/lib/features/rules_filter_creator/presentation/rules_filter_creator_view.dart @@ -147,31 +147,31 @@ class RuleFilterCreatorView extends GetWidget { color: Colors.black)), const SizedBox(height: 24), _buildListRuleFilterConditionList(context, RuleFilterConditionScreenType.desktop), - Container( - padding: const EdgeInsets.only(top: 8), - child: InkWell( - onTap: controller.tapAddCondition, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - _imagePaths.icAddNewFolder, - fit: BoxFit.fill, - ), - const SizedBox(width: 15,), - Text( - AppLocalizations.of(context).addCondition, - maxLines: 1, - style: const TextStyle( - fontWeight: FontWeight.w500, - fontSize: 17, - color: AppColor.primaryColor - ) - ) - ], - ), - ), - ), + // Container( + // padding: const EdgeInsets.only(top: 8), + // child: InkWell( + // onTap: controller.tapAddCondition, + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // SvgPicture.asset( + // _imagePaths.icAddNewFolder, + // fit: BoxFit.fill, + // ), + // const SizedBox(width: 15,), + // Text( + // AppLocalizations.of(context).addCondition, + // maxLines: 1, + // style: const TextStyle( + // fontWeight: FontWeight.w500, + // fontSize: 17, + // color: AppColor.primaryColor + // ) + // ) + // ], + // ), + // ), + // ), const SizedBox(height: 24), Text(AppLocalizations.of(context).actionTitleRulesFilter, overflow: CommonTextStyle.defaultTextOverFlow, @@ -298,31 +298,31 @@ class RuleFilterCreatorView extends GetWidget { color: Colors.black)), const SizedBox(height: 24), _buildListRuleFilterConditionList(context, RuleFilterConditionScreenType.tablet), - Container( - padding: const EdgeInsets.only(top: 8), - child: InkWell( - onTap: controller.tapAddCondition, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - _imagePaths.icAddNewFolder, - fit: BoxFit.fill, - ), - const SizedBox(width: 15,), - Text( - AppLocalizations.of(context).addCondition, - maxLines: 1, - style: const TextStyle( - fontWeight: FontWeight.w500, - fontSize: 17, - color: AppColor.primaryColor - ) - ) - ], - ), - ), - ), + // Container( + // padding: const EdgeInsets.only(top: 8), + // child: InkWell( + // onTap: controller.tapAddCondition, + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // SvgPicture.asset( + // _imagePaths.icAddNewFolder, + // fit: BoxFit.fill, + // ), + // const SizedBox(width: 15,), + // Text( + // AppLocalizations.of(context).addCondition, + // maxLines: 1, + // style: const TextStyle( + // fontWeight: FontWeight.w500, + // fontSize: 17, + // color: AppColor.primaryColor + // ) + // ) + // ], + // ), + // ), + // ), const SizedBox(height: 24), Text(AppLocalizations.of(context).actionTitleRulesFilter, overflow: CommonTextStyle.defaultTextOverFlow, @@ -455,32 +455,32 @@ class RuleFilterCreatorView extends GetWidget { color: Colors.black)), const SizedBox(height: 24), _buildListRuleFilterConditionList(context, RuleFilterConditionScreenType.mobile), - Container( - padding: const EdgeInsets.only(top: 12), - child: InkWell( - onTap: controller.tapAddCondition, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SvgPicture.asset( - _imagePaths.icAddNewFolder, - fit: BoxFit.fill, - ), - const SizedBox(width: 15,), - Text( - AppLocalizations.of(context).addCondition, - maxLines: 1, - style: const TextStyle( - fontWeight: FontWeight.w500, - fontSize: 17, - color: AppColor.primaryColor - ) - ) - ], - ), - ), - ), + // Container( + // padding: const EdgeInsets.only(top: 12), + // child: InkWell( + // onTap: controller.tapAddCondition, + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.center, + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // SvgPicture.asset( + // _imagePaths.icAddNewFolder, + // fit: BoxFit.fill, + // ), + // const SizedBox(width: 15,), + // Text( + // AppLocalizations.of(context).addCondition, + // maxLines: 1, + // style: const TextStyle( + // fontWeight: FontWeight.w500, + // fontSize: 17, + // color: AppColor.primaryColor + // ) + // ) + // ], + // ), + // ), + // ), const Padding( padding: EdgeInsets.symmetric(vertical: 12), child: Divider( diff --git a/lib/features/rules_filter_creator/presentation/widgets/rule_filter_condition_row_builder.dart b/lib/features/rules_filter_creator/presentation/widgets/rule_filter_condition_row_builder.dart index a26cd3811a..96eb9a5f8c 100644 --- a/lib/features/rules_filter_creator/presentation/widgets/rule_filter_condition_row_builder.dart +++ b/lib/features/rules_filter_creator/presentation/widgets/rule_filter_condition_row_builder.dart @@ -6,7 +6,6 @@ import 'package:rule_filter/rule_filter/rule_condition.dart' as rule_condition; import 'package:tmail_ui_user/features/base/widget/drop_down_button_widget.dart'; import 'package:tmail_ui_user/features/rules_filter_creator/presentation/model/rule_filter_condition_type.dart'; import 'package:tmail_ui_user/features/rules_filter_creator/presentation/widgets/rule_filter_button_field.dart'; -import 'package:tmail_ui_user/features/rules_filter_creator/presentation/widgets/rule_filter_condition_remove_button_builder.dart'; import 'package:tmail_ui_user/features/rules_filter_creator/presentation/widgets/rules_filter_input_field_builder.dart'; import 'package:tmail_ui_user/main/localizations/app_localizations.dart'; @@ -106,14 +105,14 @@ class RuleFilterConditionRow extends StatelessWidget { editingController: conditionValueEditingController, ) ), - Container( - padding: const EdgeInsets.only(left: 12), - alignment: Alignment.center, - child: RuleFilterConditionRemoveButton( - tapRemoveRuleFilterConditionCallback: tapRemoveRuleFilterConditionCallback, - imagePath: imagePaths, - ) - ), + // Container( + // padding: const EdgeInsets.only(left: 12), + // alignment: Alignment.center, + // child: RuleFilterConditionRemoveButton( + // tapRemoveRuleFilterConditionCallback: tapRemoveRuleFilterConditionCallback, + // imagePath: imagePaths, + // ) + // ), ], ); default: diff --git a/lib/features/rules_filter_creator/presentation/widgets/rule_filter_condition_widget.dart b/lib/features/rules_filter_creator/presentation/widgets/rule_filter_condition_widget.dart index 460f929f24..6e6047c406 100644 --- a/lib/features/rules_filter_creator/presentation/widgets/rule_filter_condition_widget.dart +++ b/lib/features/rules_filter_creator/presentation/widgets/rule_filter_condition_widget.dart @@ -37,9 +37,10 @@ class RuleFilterConditionWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Slidable( - enabled: ruleFilterConditionScreenType == RuleFilterConditionScreenType.mobile ? true : false, + // enabled: ruleFilterConditionScreenType == RuleFilterConditionScreenType.mobile ? true : false, + enabled: false, endActionPane: ActionPane( - extentRatio: 0.1, + extentRatio: 0.1, motion: const BehindMotion(), children: [ CustomSlidableAction(