search lab result screen added
parent
e8f8f6074c
commit
2f2a8f3f8f
@ -0,0 +1,116 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_export.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||||
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
|
||||||
|
import 'package:sizer/sizer.dart';
|
||||||
|
|
||||||
|
class SearchLabResultsContent extends StatelessWidget {
|
||||||
|
const SearchLabResultsContent({super.key});
|
||||||
|
|
||||||
|
final List<String> _chipLabels = const [
|
||||||
|
"Blood Test",
|
||||||
|
"X-Ray",
|
||||||
|
"MRI Scan",
|
||||||
|
"CT Scan",
|
||||||
|
"Ultrasound",
|
||||||
|
"Urine Test",
|
||||||
|
"Allergy Test",
|
||||||
|
"Cholesterol Test",
|
||||||
|
"Diabetes Test",
|
||||||
|
"Thyroid Test",
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
TextInputWidget(
|
||||||
|
labelText:"Search lab results",
|
||||||
|
hintText: "Type test name",
|
||||||
|
controller: TextEditingController(),
|
||||||
|
isEnable: true,
|
||||||
|
prefix: null,
|
||||||
|
autoFocus: true,
|
||||||
|
isBorderAllowed: false,
|
||||||
|
padding: EdgeInsets.symmetric(vertical:ResponsiveExtension(10).h, horizontal: ResponsiveExtension(15).h),
|
||||||
|
|
||||||
|
),
|
||||||
|
SizedBox(height: ResponsiveExtension(20).h),
|
||||||
|
"Suggestions".toText16(isBold: true),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
child: Wrap(
|
||||||
|
alignment: WrapAlignment.start,
|
||||||
|
spacing: 10,
|
||||||
|
runSpacing: 10,
|
||||||
|
children: _chipLabels
|
||||||
|
.map((label) => SuggestionChip(
|
||||||
|
label: label,
|
||||||
|
onTap: () {},
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
padding: EdgeInsets.all(ResponsiveExtension(20).h),
|
||||||
|
child: CustomButton(
|
||||||
|
text: LocaleKeys.search.tr(),
|
||||||
|
icon: AppAssets.search_icon,
|
||||||
|
iconColor: Colors.white,
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SuggestionChip extends StatelessWidget {
|
||||||
|
final String label;
|
||||||
|
final bool isSelected;
|
||||||
|
final VoidCallback? onTap;
|
||||||
|
|
||||||
|
const SuggestionChip({
|
||||||
|
super.key,
|
||||||
|
required this.label,
|
||||||
|
this.isSelected = false,
|
||||||
|
this.onTap,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: onTap, // optional tap callback
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isSelected ? AppColors.primaryRedColor : AppColors.whiteColor,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: label.toText12(
|
||||||
|
color: isSelected ? Colors.white : Colors.black87,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_export.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/presentation/lab/search_lab_report.dart';
|
||||||
|
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}) {
|
||||||
|
showModalBottomSheet<String>(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: AppColors.scaffoldBgColor,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
height: height,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
||||||
|
),
|
||||||
|
child: ButtonSheetContent(
|
||||||
|
title: title!,
|
||||||
|
isCloseButtonVisible: isCloseButtonVisible,
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).then((value) {
|
||||||
|
callBackFunc();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
class ButtonSheetContent extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
final String title;
|
||||||
|
final bool isCloseButtonVisible;
|
||||||
|
|
||||||
|
const ButtonSheetContent({super.key, required this.child, required this.isCloseButtonVisible, required this.title});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 20.h,),
|
||||||
|
Center(
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.only(top: 18, bottom: 12),
|
||||||
|
height: 4,
|
||||||
|
width: 40.h,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey[400],
|
||||||
|
borderRadius: BorderRadius.circular(2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Close button
|
||||||
|
isCloseButtonVisible
|
||||||
|
? Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16), child: Utils.buildSvgWithAssets( icon: AppAssets.closeBottomNav,
|
||||||
|
width: 32,
|
||||||
|
height: 32).onPress((){
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
: SizedBox(),
|
||||||
|
|
||||||
|
SizedBox(height: 20,),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(fontSize: 27.h, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
|
Expanded(child: child)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue