Medical report implementation done, Book Appointment implementation contd.
							parent
							
								
									14725616c6
								
							
						
					
					
						commit
						7b94199d58
					
				| @ -0,0 +1,5 @@ | |||||||
|  | <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||||
|  |     <rect width="40" height="40" rx="10" fill="#EFEFF0"/> | ||||||
|  |     <path d="M20.75 12.5C20.75 12.0858 20.4142 11.75 20 11.75C19.5858 11.75 19.25 12.0858 19.25 12.5V13.25H18.5C18.0858 13.25 17.75 13.5858 17.75 14C17.75 14.4142 18.0858 14.75 18.5 14.75H19.25V15.5C19.25 15.9142 19.5858 16.25 20 16.25C20.4142 16.25 20.75 15.9142 20.75 15.5V14.75H21.5C21.9142 14.75 22.25 14.4142 22.25 14C22.25 13.5858 21.9142 13.25 21.5 13.25H20.75V12.5Z" fill="#8F9AA3"/> | ||||||
|  |     <path fill-rule="evenodd" clip-rule="evenodd" d="M19.948 9.25H20.052C20.9505 9.24997 21.6997 9.24995 22.2945 9.32991C22.9223 9.41432 23.4891 9.59999 23.9445 10.0555C24.4 10.5109 24.5857 11.0777 24.6701 11.7055C24.695 11.8911 24.7122 12.0917 24.724 12.3072C25.8622 12.4348 26.7867 12.726 27.506 13.4474C28.1807 14.1241 28.476 14.9793 28.6152 16.018C28.75 17.0237 28.75 18.3062 28.75 19.9137V28.75H29C29.5523 28.75 30 29.1977 30 29.75C30 30.3023 29.5523 30.75 29 30.75H11C10.4477 30.75 10 30.3023 10 29.75C10 29.1977 10.4477 28.75 11 28.75H11.25V19.9137C11.25 18.3062 11.25 17.0237 11.3848 16.018C11.524 14.9793 11.8193 14.1241 12.494 13.4474C13.2133 12.726 14.1378 12.4348 15.276 12.3072C15.2878 12.0917 15.305 11.8911 15.3299 11.7055C15.4143 11.0777 15.6 10.5109 16.0555 10.0555C16.5109 9.59999 17.0777 9.41432 17.7055 9.32991C18.3003 9.24995 19.0495 9.24997 19.948 9.25ZM17.9054 10.8165C17.4439 10.8786 17.2464 10.9858 17.1161 11.1161C16.9858 11.2464 16.8786 11.4439 16.8165 11.9054C16.7516 12.3884 16.75 13.036 16.75 14C16.75 14.964 16.7516 15.6116 16.8165 16.0946C16.8786 16.5561 16.9858 16.7536 17.1161 16.8839C17.2464 17.0142 17.4439 17.1214 17.9054 17.1835C18.3884 17.2484 19.036 17.25 20 17.25C20.964 17.25 21.6116 17.2484 22.0946 17.1835C22.5561 17.1214 22.7536 17.0142 22.8839 16.8839C23.0142 16.7536 23.1214 16.5561 23.1835 16.0946C23.2484 15.6116 23.25 14.964 23.25 14C23.25 13.036 23.2484 12.3884 23.1835 11.9054C23.1214 11.4439 23.0142 11.2464 22.8839 11.1161C22.7536 10.9858 22.5561 10.8786 22.0946 10.8165C21.6116 10.7516 20.964 10.75 20 10.75C19.036 10.75 18.3884 10.7516 17.9054 10.8165ZM23.25 28.75V27.4678C23.25 27.028 23.25 26.6486 23.2218 26.3374C23.192 26.0082 23.1259 25.6822 22.9486 25.375C22.7511 25.033 22.467 24.7489 22.125 24.5514C21.8178 24.3741 21.4918 24.308 21.1627 24.2782C20.8514 24.25 20.472 24.25 20.0323 24.25C19.5925 24.25 19.1486 24.25 18.8374 24.2782C18.5082 24.308 18.1822 24.3741 17.875 24.5514C17.533 24.7489 17.2489 25.033 17.0514 25.375C16.8741 25.6822 16.808 26.0082 16.7782 26.3374C16.75 26.6486 16.75 27.028 16.75 27.4677V28.75H18.25V27.5C18.25 27.0189 18.2507 26.7082 18.2721 26.4727C18.3015 26.2392 18.4223 25.7721 18.9727 25.7721C19.2082 25.7507 19.5189 25.75 20 25.75C20.4811 25.75 20.7918 25.7507 21.0273 25.7721C21.2608 25.7843 21.7279 25.9415 21.7279 26.4727C21.7493 26.7082 21.75 27.0189 21.75 27.5V28.75H23.25ZM15 21C15 20.4477 15.4477 20 16 20H16.009C16.5612 20 17.009 20.4477 17.009 21C17.009 21.5523 16.5612 22 16.009 22H16C15.4477 22 15 21.5523 15 21ZM18.991 21C18.991 20.4477 19.4388 20 19.991 20H20C20.5523 20 21 20.4477 21 21C21 21.5523 20.5523 22 20 22H19.991C19.4388 22 18.991 21.5523 18.991 21ZM22.9922 21C22.9922 20.4477 23.4399 20 23.9922 20H24.0011C24.5534 20 25.0011 20.4477 25.0011 21C25.0011 21.5523 24.5534 22 24.0011 22H23.9922C23.4399 22 22.9922 21.5523 22.9922 21Z" fill="#8F9AA3"/> | ||||||
|  | </svg> | ||||||
| After Width: | Height: | Size: 3.3 KiB | 
| @ -0,0 +1,5 @@ | |||||||
|  | <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||||
|  |     <rect width="40" height="40" rx="10" fill="#EFEFF0"/> | ||||||
|  |     <path d="M18.5303 20.4696C18.3897 20.329 18.1989 20.25 18 20.25C17.7425 20.25 17.4921 20.25 17.25 20.2507V24.3535C18.4043 24.6799 19.25 25.7412 19.25 27V28C19.25 28.4142 18.9142 28.75 18.5 28.75C18.0858 28.75 17.75 28.4142 17.75 28V27C17.75 26.3096 17.1904 25.75 16.5 25.75C15.8096 25.75 15.25 26.3096 15.25 27V28C15.25 28.4142 14.9142 28.75 14.5 28.75C14.0858 28.75 13.75 28.4142 13.75 28V27C13.75 25.7412 14.5957 24.6799 15.75 24.3535V20.2764C15.3284 20.2933 14.9463 20.321 14.6083 20.3665C13.7081 20.4875 12.9503 20.7464 12.3484 21.3483C11.7464 21.9502 11.4875 22.7081 11.3665 23.6082C11.25 24.4752 11.25 25.5775 11.25 26.9451V30C11.25 30.4142 11.5858 30.75 12 30.75H28C28.4142 30.75 28.75 30.4142 28.75 30V26.9451C28.75 25.5775 28.75 24.4752 28.6335 23.6082C28.5125 22.7081 28.2536 21.9502 27.6517 21.3483C27.0497 20.7464 26.2919 20.4875 25.3918 20.3665C25.1928 20.3397 24.9786 20.3191 24.75 20.3033V25.9506C25.1984 26.21 25.5 26.6948 25.5 27.25C25.5 28.0784 24.8284 28.75 24 28.75C23.1716 28.75 22.5 28.0784 22.5 27.25C22.5 26.6948 22.8017 26.21 23.25 25.9506V20.2538C22.8569 20.25 22.4396 20.25 22.0005 20.25C21.8016 20.25 21.6103 20.329 21.4697 20.4696L20 21.9393L18.5303 20.4696Z" fill="#8F9AA3"/> | ||||||
|  |     <path d="M20 9.25C17.6528 9.25 15.75 11.1528 15.75 13.5V14.5C15.75 16.8472 17.6528 18.75 20 18.75C22.3472 18.75 24.25 16.8472 24.25 14.5V13.5C24.25 11.1528 22.3472 9.25 20 9.25Z" fill="#8F9AA3"/> | ||||||
|  | </svg> | ||||||
| After Width: | Height: | Size: 1.5 KiB | 
| @ -0,0 +1,5 @@ | |||||||
|  | <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||||
|  |     <rect width="40" height="40" rx="10" fill="#EFEFF0"/> | ||||||
|  |     <path fill-rule="evenodd" clip-rule="evenodd" d="M11.75 17.5869C11.75 13.0186 15.5222 9.25 20 9.25C24.4778 9.25 28.25 13.0186 28.25 17.5869C28.25 22.2513 24.4018 25.4121 21.1696 27.4294L21.1583 27.4365L21.1467 27.4431C20.7978 27.644 20.4026 27.75 20 27.75C19.5974 27.75 19.2022 27.644 18.8533 27.4431L18.84 27.4355L18.8271 27.4273C15.6075 25.3945 11.75 22.2671 11.75 17.5869ZM16.5 17.5C16.5 15.567 18.067 14 20 14C21.933 14 23.5 15.567 23.5 17.5C23.5 19.433 21.933 21 20 21C18.067 21 16.5 19.433 16.5 17.5Z" fill="#8F9AA3"/> | ||||||
|  |     <path d="M14.9958 27.6578C14.9493 27.1487 14.5212 26.75 14 26.75C13.4477 26.75 13 27.1977 13 27.75C13 28.4639 13.4349 28.9848 13.8525 29.3139C14.2814 29.6519 14.84 29.9125 15.4411 30.1129C16.6538 30.5171 18.2656 30.75 20 30.75C21.7344 30.75 23.3462 30.5171 24.5589 30.1129C25.16 29.9125 25.7186 29.6519 26.1475 29.3139C26.5651 28.9848 27 28.4639 27 27.75C27 27.1977 26.5523 26.75 26 26.75C25.4788 26.75 25.0507 27.1487 25.0042 27.6578C24.9869 27.6768 24.9574 27.7053 24.9095 27.7431C24.7311 27.8836 24.4111 28.054 23.9264 28.2155C22.9675 28.5352 21.5793 28.75 20 28.75C18.4207 28.75 17.0325 28.5352 16.0736 28.2155C15.5889 28.054 15.2689 27.8836 15.0905 27.7431C15.0426 27.7053 15.0131 27.6768 14.9958 27.6578Z" fill="#8F9AA3"/> | ||||||
|  | </svg> | ||||||
| After Width: | Height: | Size: 1.4 KiB | 
| @ -0,0 +1,17 @@ | |||||||
|  | import 'package:flutter/material.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/services/error_handler_service.dart'; | ||||||
|  | 
 | ||||||
|  | class BookAppointmentsViewModel extends ChangeNotifier { | ||||||
|  |   int selectedTabIndex = 0; | ||||||
|  | 
 | ||||||
|  |   BookAppointmentsRepo bookAppointmentsRepo; | ||||||
|  |   ErrorHandlerService errorHandlerService; | ||||||
|  | 
 | ||||||
|  |   BookAppointmentsViewModel({required this.bookAppointmentsRepo, required this.errorHandlerService}); | ||||||
|  | 
 | ||||||
|  |   void onTabChanged(int index) { | ||||||
|  |     selectedTabIndex = index; | ||||||
|  |     notifyListeners(); | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -0,0 +1,159 @@ | |||||||
|  | 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_state.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/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/book_appointments/book_appointments_view_model.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/presentation/book_appointment/select_clinic_page.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/presentation/lab/collapsing_list_view.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/theme/colors.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; | ||||||
|  | import 'package:provider/provider.dart'; | ||||||
|  | 
 | ||||||
|  | class BookAppointmentPage extends StatefulWidget { | ||||||
|  |   const BookAppointmentPage({super.key}); | ||||||
|  | 
 | ||||||
|  |   @override | ||||||
|  |   State<BookAppointmentPage> createState() => _BookAppointmentPageState(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | class _BookAppointmentPageState extends State<BookAppointmentPage> { | ||||||
|  |   late AppState appState; | ||||||
|  | 
 | ||||||
|  |   @override | ||||||
|  |   Widget build(BuildContext context) { | ||||||
|  |     appState = getIt.get<AppState>(); | ||||||
|  |     return Scaffold( | ||||||
|  |       backgroundColor: AppColors.bgScaffoldColor, | ||||||
|  |       body: CollapsingListView( | ||||||
|  |         title: LocaleKeys.bookAppo.tr(context: context), | ||||||
|  |         child: SingleChildScrollView( | ||||||
|  |           child: Consumer<BookAppointmentsViewModel>(builder: (context, bookAppointmentsVM, child) { | ||||||
|  |             return Column( | ||||||
|  |               crossAxisAlignment: CrossAxisAlignment.start, | ||||||
|  |               children: [ | ||||||
|  |                 SizedBox(height: 16.h), | ||||||
|  |                 CustomTabBar( | ||||||
|  |                   activeTextColor: Color(0xffED1C2B), | ||||||
|  |                   activeBackgroundColor: Color(0xffED1C2B).withValues(alpha: .1), | ||||||
|  |                   tabs: [ | ||||||
|  |                     CustomTabBarModel(null, "General".needTranslation), | ||||||
|  |                     CustomTabBarModel(null, "LiveCare".needTranslation), | ||||||
|  |                   ], | ||||||
|  |                   onTabChange: (index) { | ||||||
|  |                     bookAppointmentsVM.onTabChanged(index); | ||||||
|  |                   }, | ||||||
|  |                 ).paddingSymmetrical(24.h, 0.h), | ||||||
|  |                 SizedBox(height: 24.h), | ||||||
|  |                 getSelectedTabData(bookAppointmentsVM.selectedTabIndex), | ||||||
|  |               ], | ||||||
|  |             ); | ||||||
|  |           }), | ||||||
|  |         ), | ||||||
|  |       ), | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   Widget getSelectedTabData(int index) { | ||||||
|  |     switch (index) { | ||||||
|  |       case 0: | ||||||
|  |         return Column( | ||||||
|  |           children: [ | ||||||
|  |             Container( | ||||||
|  |               decoration: RoundedRectangleBorder().toSmoothCornerDecoration( | ||||||
|  |                 color: AppColors.whiteColor, | ||||||
|  |                 borderRadius: 24.h, | ||||||
|  |                 hasShadow: false, | ||||||
|  |               ), | ||||||
|  |               child: Padding( | ||||||
|  |                 padding: EdgeInsets.all(16.h), | ||||||
|  |                 child: Column( | ||||||
|  |                   crossAxisAlignment: CrossAxisAlignment.start, | ||||||
|  |                   children: [ | ||||||
|  |                     Row( | ||||||
|  |                       mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||||
|  |                       children: [ | ||||||
|  |                         Row( | ||||||
|  |                           children: [ | ||||||
|  |                             Utils.buildSvgWithAssets(icon: AppAssets.search_by_clinic_icon, width: 40.h, height: 40.h), | ||||||
|  |                             SizedBox(width: 12.h), | ||||||
|  |                             Column( | ||||||
|  |                               crossAxisAlignment: CrossAxisAlignment.start, | ||||||
|  |                               children: [ | ||||||
|  |                                 "Search By Clinic".needTranslation.toText14(color: AppColors.textColor, weight: FontWeight.w500), | ||||||
|  |                                 "Tap to select clinic".needTranslation.toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500), | ||||||
|  |                               ], | ||||||
|  |                             ), | ||||||
|  |                           ], | ||||||
|  |                         ), | ||||||
|  |                         Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h), | ||||||
|  |                       ], | ||||||
|  |                     ).onPress(() { | ||||||
|  |                       Navigator.of(context).push( | ||||||
|  |                         FadePage( | ||||||
|  |                           page: SelectClinicPage(), | ||||||
|  |                         ), | ||||||
|  |                       ); | ||||||
|  |                     }), | ||||||
|  |                     SizedBox(height: 16.h), | ||||||
|  |                     Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.1), height: 1.h), | ||||||
|  |                     SizedBox(height: 16.h), | ||||||
|  |                     Row( | ||||||
|  |                       mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||||
|  |                       children: [ | ||||||
|  |                         Row( | ||||||
|  |                           children: [ | ||||||
|  |                             Utils.buildSvgWithAssets(icon: AppAssets.search_by_doctor_icon, width: 40.h, height: 40.h), | ||||||
|  |                             SizedBox(width: 12.h), | ||||||
|  |                             Column( | ||||||
|  |                               crossAxisAlignment: CrossAxisAlignment.start, | ||||||
|  |                               children: [ | ||||||
|  |                                 "Search By Doctor".needTranslation.toText14(color: AppColors.textColor, weight: FontWeight.w500), | ||||||
|  |                                 "Tap to select".needTranslation.toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500), | ||||||
|  |                               ], | ||||||
|  |                             ), | ||||||
|  |                           ], | ||||||
|  |                         ), | ||||||
|  |                         Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h), | ||||||
|  |                       ], | ||||||
|  |                     ).onPress(() {}), | ||||||
|  |                     SizedBox(height: 16.h), | ||||||
|  |                     Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.1), height: 1.h), | ||||||
|  |                     SizedBox(height: 16.h), | ||||||
|  |                     Row( | ||||||
|  |                       mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||||
|  |                       children: [ | ||||||
|  |                         Row( | ||||||
|  |                           children: [ | ||||||
|  |                             Utils.buildSvgWithAssets(icon: AppAssets.search_by_region_icon, width: 40.h, height: 40.h), | ||||||
|  |                             SizedBox(width: 12.h), | ||||||
|  |                             Column( | ||||||
|  |                               crossAxisAlignment: CrossAxisAlignment.start, | ||||||
|  |                               children: [ | ||||||
|  |                                 "Search By Region".needTranslation.toText14(color: AppColors.textColor, weight: FontWeight.w500), | ||||||
|  |                                 "Central Region".needTranslation.toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500), | ||||||
|  |                               ], | ||||||
|  |                             ), | ||||||
|  |                           ], | ||||||
|  |                         ), | ||||||
|  |                         Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 15.h, height: 15.h), | ||||||
|  |                       ], | ||||||
|  |                     ).onPress(() {}), | ||||||
|  |                   ], | ||||||
|  |                 ), | ||||||
|  |               ), | ||||||
|  |             ), | ||||||
|  |           ], | ||||||
|  |         ).paddingSymmetrical(24.h, 0.h); | ||||||
|  |       default: | ||||||
|  |         SizedBox.shrink(); | ||||||
|  |     } | ||||||
|  |     return Container(); | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -0,0 +1,29 @@ | |||||||
|  | import 'package:easy_localization/easy_localization.dart'; | ||||||
|  | import 'package:flutter/material.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/presentation/lab/collapsing_list_view.dart'; | ||||||
|  | import 'package:hmg_patient_app_new/theme/colors.dart'; | ||||||
|  | 
 | ||||||
|  | class SelectClinicPage extends StatefulWidget { | ||||||
|  |   const SelectClinicPage({super.key}); | ||||||
|  | 
 | ||||||
|  |   @override | ||||||
|  |   State<SelectClinicPage> createState() => _SelectClinicPageState(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | class _SelectClinicPageState extends State<SelectClinicPage> { | ||||||
|  |   @override | ||||||
|  |   Widget build(BuildContext context) { | ||||||
|  |     return Scaffold( | ||||||
|  |       backgroundColor: AppColors.bgScaffoldColor, | ||||||
|  |       body: CollapsingListView( | ||||||
|  |         title: LocaleKeys.selectClinic.tr(context: context), | ||||||
|  |         child: SingleChildScrollView( | ||||||
|  |           child: Column( | ||||||
|  |             children: [], | ||||||
|  |           ), | ||||||
|  |         ), | ||||||
|  |       ), | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in New Issue
	
	 Haroon Amjad
						Haroon Amjad