TF-750 Hide autocomplete when click outside advanced search

This commit is contained in:
dab246
2022-07-25 14:04:43 +07:00
committed by Dat H. Pham
parent c8b94f9e8e
commit d1aca3e27e
2 changed files with 34 additions and 31 deletions
@@ -40,7 +40,7 @@ class FullScreenActionSheetBuilder {
left: false, left: false,
right: false, right: false,
child: GestureDetector( child: GestureDetector(
onTap: () => {}, onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Padding( child: Padding(
padding: EdgeInsets.only(top: _statusBarHeight), padding: EdgeInsets.only(top: _statusBarHeight),
child: ClipRRect( child: ClipRRect(
@@ -13,36 +13,39 @@ class AdvancedSearchFilterOverlay extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final responsiveUtils = Get.find<ResponsiveUtils>(); final responsiveUtils = Get.find<ResponsiveUtils>();
return Padding( return GestureDetector(
padding: const EdgeInsets.only(top: 8, bottom: 16), onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Container( child: Padding(
constraints: BoxConstraints( padding: const EdgeInsets.only(top: 8, bottom: 16),
minWidth: 660, child: Container(
maxHeight: _getHeightOverlay(context, responsiveUtils), constraints: BoxConstraints(
), minWidth: 660,
width: 660, maxHeight: _getHeightOverlay(context, responsiveUtils),
height: _getHeightOverlay(context, responsiveUtils), ),
padding: responsiveUtils.landscapeTabletSupported(context) width: 660,
? EdgeInsets.zero height: _getHeightOverlay(context, responsiveUtils),
: const EdgeInsets.all(24), padding: responsiveUtils.landscapeTabletSupported(context)
decoration: BoxDecoration( ? EdgeInsets.zero
color: Colors.white, : const EdgeInsets.all(24),
borderRadius: BorderRadius.circular(16), decoration: BoxDecoration(
boxShadow: const [ color: Colors.white,
BoxShadow( borderRadius: BorderRadius.circular(16),
color: AppColor.colorShadowBgContentEmail, boxShadow: const [
spreadRadius: 1, BoxShadow(
blurRadius: 1, color: AppColor.colorShadowBgContentEmail,
offset: Offset(0, 0.5)), spreadRadius: 1,
]), blurRadius: 1,
child: SingleChildScrollView( offset: Offset(0, 0.5)),
child: Padding( ]),
padding: EdgeInsets.symmetric( child: SingleChildScrollView(
horizontal: responsiveUtils.landscapeTabletSupported(context) child: Padding(
? 16 : 28, padding: EdgeInsets.symmetric(
vertical: responsiveUtils.landscapeTabletSupported(context) horizontal: responsiveUtils.landscapeTabletSupported(context)
? 16 : 12), ? 16 : 28,
child: AdvancedSearchInputForm(), vertical: responsiveUtils.landscapeTabletSupported(context)
? 16 : 12),
child: AdvancedSearchInputForm(),
),
), ),
), ),
), ),