create advanced search mobile UI

This commit is contained in:
ManhNT
2022-06-25 23:14:29 +07:00
committed by Dat H. Pham
parent 298e0e2e8b
commit e5977aa0da
15 changed files with 496 additions and 17 deletions
+1
View File
@@ -70,6 +70,7 @@ export 'presentation/views/tab_bar/custom_tab_indicator.dart';
export 'presentation/views/quick_search/quick_search_input_form.dart';
export 'presentation/views/toast/toast_position.dart';
export 'presentation/views/toast/tmail_toast.dart';
export 'presentation/views/bottom_popup/full_screen_action_sheet_builder.dart';
// Resources
export 'presentation/resources/assets_paths.dart';
@@ -75,7 +75,7 @@ class ImagePaths {
String get icSendMobile => _getImagePath('ic_send_mobile.svg');
String get icSendDisable => _getImagePath('ic_send_disable.svg');
String get icArrowDown => _getImagePath('ic_arrow_down.svg');
String get icFilterWeb => _getImagePath('ic_filter_web.svg');
String get icFilterAdvanced => _getImagePath('ic_filter_advanced.svg');
String get icMarkAllAsRead => _getImagePath('ic_mark_all_as_read.svg');
String get icRefresh => _getImagePath('ic_refresh.svg');
String get icSelectAll => _getImagePath('ic_select_all.svg');
@@ -125,6 +125,7 @@ class ImagePaths {
String get icFilePdf => _getImagePath('ic_file_pdf.svg');
String get icFilePptx => _getImagePath('ic_file_pptx.svg');
String get icFileEPup => _getImagePath('ic_file_epup.svg');
String get icCloseAdvancedSearch => _getImagePath('ic_close_advanced_search.svg');
String _getImagePath(String imageName) {
return AssetsPaths.images + imageName;
@@ -0,0 +1,72 @@
import 'package:core/core.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:pointer_interceptor/pointer_interceptor.dart';
typedef OnCloseActionClick = Function();
class FullScreenActionSheetBuilder {
final BuildContext context;
final Widget child;
final Widget? titleWidget;
final Widget? cancelWidget;
OnCloseActionClick? onCloseActionClick;
late double _statusBarHeight = MediaQuery.of(context).padding.top;
FullScreenActionSheetBuilder({
required this.context,
required this.child,
this.titleWidget,
this.cancelWidget,
this.onCloseActionClick,
});
Future show() {
return showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: AppColor.colorDefaultCupertinoActionSheet,
backgroundColor: Colors.transparent,
enableDrag: false,
builder: (context) => PointerInterceptor(child: _buildBody(context)),
);
}
Widget _buildBody(BuildContext context) {
return SafeArea(
top: true,
bottom: false,
left: false,
right: false,
child: GestureDetector(
onTap: () => {},
child: Padding(
padding: EdgeInsets.only(top: _statusBarHeight),
child: ClipRRect(
borderRadius: BorderRadius.only(
topRight: Radius.circular(14),
topLeft: Radius.circular(14),
),
child: Scaffold(
appBar: AppBar(
leading: SizedBox.shrink(),
title: titleWidget,
centerTitle: true,
actions: [
GestureDetector(
child: cancelWidget,
onTapDown: (_) {
onCloseActionClick?.call();
Get.back();
},
)
],
),
body: child,
),
)),
),
);
}
}