|
|
|
@ -9,14 +9,13 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
|
|
|
|
void showCommonBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc, String? title, required double height, bool isCloseButtonVisible = true}) {
|
|
|
|
void showCommonBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc, String? title, required double height, bool isCloseButtonVisible = true}) {
|
|
|
|
showModalBottomSheet<String>(
|
|
|
|
showModalBottomSheet<String>(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
isScrollControlled: true,
|
|
|
|
isScrollControlled: false,
|
|
|
|
|
|
|
|
showDragHandle: false,
|
|
|
|
backgroundColor: AppColors.scaffoldBgColor,
|
|
|
|
backgroundColor: AppColors.scaffoldBgColor,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
height: height,
|
|
|
|
height: height,
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.scaffoldBgColor, borderRadius: 24.h),
|
|
|
|
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: ButtonSheetContent(
|
|
|
|
child: ButtonSheetContent(
|
|
|
|
title: title!,
|
|
|
|
title: title!,
|
|
|
|
isCloseButtonVisible: isCloseButtonVisible,
|
|
|
|
isCloseButtonVisible: isCloseButtonVisible,
|
|
|
|
@ -37,46 +36,48 @@ class ButtonSheetContent extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SizedBox(height: 20.h,),
|
|
|
|
// SizedBox(
|
|
|
|
Center(
|
|
|
|
// height: 20.h,
|
|
|
|
child: Container(
|
|
|
|
// ),
|
|
|
|
margin: const EdgeInsets.only(top: 18, bottom: 12),
|
|
|
|
Center(
|
|
|
|
height: 4,
|
|
|
|
child: Container(
|
|
|
|
width: 40.h,
|
|
|
|
margin: const EdgeInsets.only(top: 18, bottom: 12),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
height: 4,
|
|
|
|
color: Colors.grey[400],
|
|
|
|
width: 40.h,
|
|
|
|
borderRadius: BorderRadius.circular(2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
),
|
|
|
|
color: Colors.grey[400],
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(2),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
// Close button
|
|
|
|
// Close button
|
|
|
|
isCloseButtonVisible
|
|
|
|
isCloseButtonVisible
|
|
|
|
? Padding(
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16), child: Utils.buildSvgWithAssets( icon: AppAssets.closeBottomNav,
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
width: 32,
|
|
|
|
child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32, height: 32).onPress(() {
|
|
|
|
height: 32).onPress((){
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
: SizedBox(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SizedBox(height: 20,),
|
|
|
|
SizedBox(
|
|
|
|
Padding(
|
|
|
|
height: 20,
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
Padding(
|
|
|
|
title,
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
style: TextStyle(fontSize: 27.h, fontWeight: FontWeight.bold),
|
|
|
|
child: Text(
|
|
|
|
),
|
|
|
|
title,
|
|
|
|
|
|
|
|
style: TextStyle(fontSize: 27.h, fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
Expanded(child: child)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Expanded(child: child)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|