Skip to content

Commit

Permalink
TF-1993 Fix has attachment checkbox is overflow once it be translated…
Browse files Browse the repository at this point in the history
… in russia
  • Loading branch information
dab246 committed Jul 12, 2023
1 parent e6c3176 commit 2987d29
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 78 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import 'package:core/core.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/labeled_checkbox.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
Expand All @@ -21,44 +24,26 @@ class AdvancedSearchFilterFormBottomView extends GetWidget<AdvancedFilterControl
final responsiveUtils = Get.find<ResponsiveUtils>();

return Padding(
padding: EdgeInsets.only(
top: _isMobileAndLandscapeTablet(context, responsiveUtils) ? 8 : 20),
padding: EdgeInsets.only(top: !responsiveUtils.isWebDesktop(context) ? 8 : 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (_isMobileAndLandscapeTablet(context, responsiveUtils))
...[
_buildCheckboxHasAttachment(
context,
currentFocusNode: focusManager?.attachmentCheckboxFocusNode,
nextFocusNode: focusManager?.searchButtonFocusNode),
const SizedBox(height: 24)
],
Row(
mainAxisAlignment: _isMobileAndLandscapeTablet(context, responsiveUtils)
? MainAxisAlignment.spaceEvenly
: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (!_isMobileAndLandscapeTablet(context, responsiveUtils))
Expanded(child: _buildCheckboxHasAttachment(
context,
currentFocusNode: focusManager?.attachmentCheckboxFocusNode,
nextFocusNode: focusManager?.searchButtonFocusNode)),
..._buildListButton(context, responsiveUtils),
],
Transform(
transform: Matrix4.translationValues(-8.0, 0.0, 0.0),
child: _buildCheckboxHasAttachment(
context,
currentFocusNode: focusManager?.attachmentCheckboxFocusNode,
nextFocusNode: focusManager?.searchButtonFocusNode),
),
_buildListButton(context, responsiveUtils),
],
),
);
}

List<Widget> _buildListButton(
BuildContext context,
ResponsiveUtils responsiveUtils
) {
if (_isMobileAndLandscapeTablet(context, responsiveUtils)) {
return [
Widget _buildListButton(BuildContext context, ResponsiveUtils responsiveUtils) {
if (!responsiveUtils.isWebDesktop(context)) {
return Row(children: [
Expanded(
child: _buildButton(
onAction: () {
Expand Down Expand Up @@ -88,15 +73,16 @@ class AdvancedSearchFilterFormBottomView extends GetWidget<AdvancedFilterControl
nextFocusNode: focusManager?.fromFieldFocusNode
),
),
];
]);
} else {
return [
return Row(children: [
const Spacer(),
_buildButton(
onAction: () {
controller.cleanSearchFilter(context);
popBack();
},
colorButton: Colors.white,
colorButton: Colors.transparent,
colorText: AppColor.colorContentEmail,
text: AppLocalizations.of(context).clearFilter,
context: context,
Expand All @@ -118,7 +104,7 @@ class AdvancedSearchFilterFormBottomView extends GetWidget<AdvancedFilterControl
currentFocusNode: focusManager?.searchButtonFocusNode,
nextFocusNode: focusManager?.fromFieldFocusNode
),
];
]);
}
}

Expand Down Expand Up @@ -170,25 +156,17 @@ class AdvancedSearchFilterFormBottomView extends GetWidget<AdvancedFilterControl
}
},
child: buildButtonWrapText(
text,
focusNode: currentFocusNode,
radius: 10,
height: 44,
minWidth: minWidth,
textStyle: TextStyle(
fontSize: 17,
color: colorText,
fontWeight: FontWeight.w500),
bgColor: colorButton,
onTap: onAction),
text,
focusNode: currentFocusNode,
radius: 10,
height: 44,
minWidth: minWidth,
textStyle: TextStyle(
fontSize: 17,
color: colorText,
fontWeight: FontWeight.w500),
bgColor: colorButton,
onTap: onAction),
);
}

bool _isMobileAndLandscapeTablet(
BuildContext context,
ResponsiveUtils responsive
) {
return responsive.isMobile(context) ||
responsive.landscapeTabletSupported(context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,30 @@ class AdvancedSearchFilterOverlay extends StatelessWidget {
return PointerInterceptor(
child: GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Padding(
padding: const EdgeInsets.only(top: 4, bottom: 16, right: 22),
child: Container(
constraints: BoxConstraints(
maxHeight: _getHeightOverlay(context, responsiveUtils),
),
width: maxWidth ?? 660,
padding: const EdgeInsets.all(32),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: const [
BoxShadow(
color: AppColor.colorShadowComposer,
blurRadius: 32,
offset: Offset.zero),
BoxShadow(
color: AppColor.colorDropShadow,
blurRadius: 4,
offset: Offset.zero),
]),
child: SingleChildScrollView(
padding: const EdgeInsets.only(right: 16),
child: AdvancedSearchInputForm(),
),
child: Container(
constraints: BoxConstraints(
maxHeight: _getHeightOverlay(context, responsiveUtils),
),
width: maxWidth ?? 660,
margin: const EdgeInsetsDirectional.only(top: 4, bottom: 16, end: 22),
padding: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: const [
BoxShadow(
color: AppColor.colorShadowComposer,
blurRadius: 32,
offset: Offset.zero),
BoxShadow(
color: AppColor.colorDropShadow,
blurRadius: 4,
offset: Offset.zero),
]
),
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 24),
child: AdvancedSearchInputForm(),
),
),
),
Expand Down

0 comments on commit 2987d29

Please sign in to comment.