ER Online CheckIn implementation contd.
parent
f280d4a28a
commit
60bd9ee55a
@ -0,0 +1,114 @@
|
|||||||
|
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/utils/size_utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/emergency_services/emergency_services_view_model.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/appbar/collapsing_list_view.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import '../call_ambulance/widgets/HospitalBottomSheetBody.dart';
|
||||||
|
|
||||||
|
class ErOnlineCheckinHome extends StatelessWidget {
|
||||||
|
const ErOnlineCheckinHome({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.bgScaffoldColor,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: CollapsingListView(
|
||||||
|
title: "Emergency Check-In".needTranslation,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(24.h),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Utils.buildSvgWithAssets(icon: AppAssets.immediate_service_icon, width: 58.h, height: 58.h),
|
||||||
|
SizedBox(width: 18.h),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
"Online Check-In".needTranslation.toText18(color: AppColors.textColor, isBold: true),
|
||||||
|
"This service lets patients to register their ER appointment prior to arrival.".needTranslation.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
CustomButton(
|
||||||
|
text: "Book Appointment".needTranslation,
|
||||||
|
onPressed: () async {
|
||||||
|
LoaderBottomSheet.showLoader(loadingText: "Fetching hospitals list...".needTranslation);
|
||||||
|
await context.read<EmergencyServicesViewModel>().getProjects();
|
||||||
|
LoaderBottomSheet.hideLoader();
|
||||||
|
//Project Selection Dropdown
|
||||||
|
showHospitalBottomSheet(context);
|
||||||
|
},
|
||||||
|
backgroundColor: AppColors.primaryRedColor,
|
||||||
|
borderColor: AppColors.primaryRedColor,
|
||||||
|
textColor: AppColors.whiteColor,
|
||||||
|
fontSize: 16.f,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
borderRadius: 10.r,
|
||||||
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
|
height: 50.h,
|
||||||
|
icon: AppAssets.bookAppoBottom,
|
||||||
|
iconColor: AppColors.whiteColor,
|
||||||
|
iconSize: 18.h,
|
||||||
|
).paddingSymmetrical(24.h, 24.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
showHospitalBottomSheet(BuildContext context) {
|
||||||
|
showCommonBottomSheetWithoutHeight(
|
||||||
|
title: LocaleKeys.selectHospital.tr(),
|
||||||
|
context,
|
||||||
|
child: Consumer<EmergencyServicesViewModel>(
|
||||||
|
builder: (_, vm, __) => HospitalBottomSheetBody(
|
||||||
|
displayList: vm.displayList,
|
||||||
|
onFacilityClicked: (value) {
|
||||||
|
vm.setSelectedFacility(value);
|
||||||
|
vm.getDisplayList();
|
||||||
|
},
|
||||||
|
onHospitalClicked: (hospital) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
vm.setSelectedHospital(hospital);
|
||||||
|
},
|
||||||
|
onHospitalSearch: (value) {
|
||||||
|
vm.searchHospitals(value ?? "");
|
||||||
|
},
|
||||||
|
selectedFacility: vm.selectedFacility,
|
||||||
|
hmcCount: vm.hmcCount,
|
||||||
|
hmgCount: vm.hmgCount,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
isFullScreen: false,
|
||||||
|
isCloseButtonVisible: true,
|
||||||
|
hasBottomPadding: false,
|
||||||
|
backgroundColor: AppColors.bottomSheetBgColor,
|
||||||
|
callBackFunc: () {},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue