|
|
|
@ -1,22 +1,37 @@
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/size_utils.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/core/utils/utils.dart';
|
|
|
|
import 'package:hmg_patient_app_new/extensions/string_extensions.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/extensions/widget_extensions.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_clinic_list_response_model.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/features/immediate_livecare/models/resp_models/get_livecare_immediate_clinics_response_model.dart';
|
|
|
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
|
|
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/services/navigation_service.dart';
|
|
|
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
|
|
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
|
|
|
import 'package:hmg_patient_app_new/theme/colors.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/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:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class SelectLivecareClinicPage extends StatelessWidget {
|
|
|
|
class SelectLivecareClinicPage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
final VoidCallback? onNegativeClicked;
|
|
|
|
final VoidCallback? onNegativeClicked;
|
|
|
|
const SelectLivecareClinicPage({super.key, this.onNegativeClicked});
|
|
|
|
late GetClinicsListResponseModel selectedClinic;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SelectLivecareClinicPage({super.key, this.onNegativeClicked, required this.selectedClinic});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
late ImmediateLiveCareViewModel immediateLiveCareViewModel;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
immediateLiveCareViewModel = Provider.of<ImmediateLiveCareViewModel>(context, listen: false);
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: AppColors.bgScaffoldColor,
|
|
|
|
backgroundColor: AppColors.bgScaffoldColor,
|
|
|
|
body: Column(
|
|
|
|
body: Column(
|
|
|
|
@ -103,7 +118,36 @@ class SelectLivecareClinicPage extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
CustomButton(
|
|
|
|
CustomButton(
|
|
|
|
text: "Yes please, I am in a hurry".needTranslation,
|
|
|
|
text: "Yes please, I am in a hurry".needTranslation,
|
|
|
|
onPressed: () {},
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
GetLiveCareClinicListResponseModel liveCareClinic = GetLiveCareClinicListResponseModel(
|
|
|
|
|
|
|
|
iD: selectedClinic.liveCareClinicID,
|
|
|
|
|
|
|
|
serviceID: selectedClinic.liveCareServiceID,
|
|
|
|
|
|
|
|
serviceName: selectedClinic.clinicDescription,
|
|
|
|
|
|
|
|
serviceNameN: selectedClinic.clinicDescriptionN,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
immediateLiveCareViewModel.setLiveCareSelectedCallType(1);
|
|
|
|
|
|
|
|
immediateLiveCareViewModel.setImmediateLiveCareSelectedClinic(liveCareClinic);
|
|
|
|
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: "Fetching fees, Please wait...".needTranslation);
|
|
|
|
|
|
|
|
await immediateLiveCareViewModel.getLiveCareImmediateAppointmentFees(onSuccess: (val) {
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
|
|
|
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).push(
|
|
|
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
|
|
|
page: ImmediateLiveCarePaymentDetails(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}, onError: (err) {
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
borderColor: AppColors.primaryRedColor,
|
|
|
|
borderColor: AppColors.primaryRedColor,
|
|
|
|
textColor: AppColors.whiteColor,
|
|
|
|
textColor: AppColors.whiteColor,
|
|
|
|
|