custom chips implemented

pull/18/head
Haroon Amjad 2 months ago
parent 1fe659bf62
commit 003a161b52

@ -104,6 +104,8 @@ extension LoginTypeExtension on LoginTypeEnum {
static LoginTypeEnum? fromValue(int value) { static LoginTypeEnum? fromValue(int value) {
switch (value) { switch (value) {
case 0:
return LoginTypeEnum.sms;
case 1: case 1:
return LoginTypeEnum.sms; return LoginTypeEnum.sms;
case 2: case 2:

@ -34,21 +34,21 @@ extension EmailValidator on String {
), ),
); );
Widget toText10({Color? color, bool isBold = false, bool isUnderLine = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow}) => Text( Widget toText10({Color? color, FontWeight? weight, bool isBold = false, bool isUnderLine = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow, double letterSpacing = -1}) => Text(
this, this,
maxLines: maxlines, maxLines: maxlines,
overflow: textOverflow, overflow: textOverflow,
style: TextStyle( style: TextStyle(
fontSize: 10.fSize, fontSize: 10.fSize,
fontStyle: fontStyle ?? FontStyle.normal, fontStyle: fontStyle ?? FontStyle.normal,
fontWeight: isBold ? FontWeight.bold : FontWeight.normal, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
letterSpacing: -1, letterSpacing: letterSpacing,
decoration: isUnderLine ? TextDecoration.underline : null, decoration: isUnderLine ? TextDecoration.underline : null,
decorationColor: color ?? AppColors.blackColor), decorationColor: color ?? AppColors.blackColor),
); );
Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isCenter = false, bool isBold = false, int maxLine = 0, double letterSpacing = 0.64}) => Text( Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isCenter = false, bool isBold = false, int maxLine = 0, double letterSpacing = -1}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
@ -57,7 +57,7 @@ extension EmailValidator on String {
fontSize: 11.fSize, fontSize: 11.fSize,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
letterSpacing: -1, letterSpacing: letterSpacing,
decoration: isUnderLine ? TextDecoration.underline : null, decoration: isUnderLine ? TextDecoration.underline : null,
), ),
); );

@ -167,7 +167,8 @@ class AuthenticationViewModel extends ChangeNotifier {
Future<void> selectDeviceImei({required Function(dynamic data) onSuccess, Function(String)? onError}) async { Future<void> selectDeviceImei({required Function(dynamic data) onSuccess, Function(String)? onError}) async {
// LoadingUtils.showFullScreenLoading(); // LoadingUtils.showFullScreenLoading();
// String firebaseToken = _appState.deviceToken; // String firebaseToken = _appState.deviceToken;
String firebaseToken = await Utils.getStringFromPrefs(CacheConst.pushToken); // String firebaseToken = await Utils.getStringFromPrefs(CacheConst.pushToken);
String firebaseToken = "fY1fq_cITMmUCztA3UKKL9:APA91bEb2ZcdCPQPq3QsA0NW6a6btFvN-JjB1Pn3ZCoCzBMmVUhhh1ZQMtRn9tYPQ5G-jHDLiEpVAlBuRCVMkLDxa-zijsqbIui-4A-ynwclDWGFT4bUHTc";
// == "" // == ""
// ? "dOGRRszQQMGe_9wA5Hx3kO:APA91bFV5IcIJXvcCXXk0tc2ddtZgWwCPq7sGSuPr-YW7iiJpQZKgFGN9GAzCVOWL8MfheaP1slE8MdxB7lczdPBGdONQ7WbMmhgHcsUCUktq-hsapGXXqc" // ? "dOGRRszQQMGe_9wA5Hx3kO:APA91bFV5IcIJXvcCXXk0tc2ddtZgWwCPq7sGSuPr-YW7iiJpQZKgFGN9GAzCVOWL8MfheaP1slE8MdxB7lczdPBGdONQ7WbMmhgHcsUCUktq-hsapGXXqc"
// : _appState.deviceToken; // : _appState.deviceToken;
@ -176,7 +177,9 @@ class AuthenticationViewModel extends ChangeNotifier {
result.fold( result.fold(
(failure) async { (failure) async {
// LoadingUtils.hideFullScreenLoader(); // LoadingUtils.hideFullScreenLoader();
await _errorHandlerService.handleError(failure: failure); // await _errorHandlerService.handleError(failure: failure);
LoadingUtils.hideFullScreenLoader();
_navigationService.pushPage(page: LoginScreen());
}, },
(apiResponse) { (apiResponse) {
// LoadingUtils.hideFullScreenLoader(); // LoadingUtils.hideFullScreenLoader();
@ -239,9 +242,9 @@ class AuthenticationViewModel extends ChangeNotifier {
Future<void> checkUserAuthentication({required OTPTypeEnum otpTypeEnum, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> checkUserAuthentication({required OTPTypeEnum otpTypeEnum, Function(dynamic)? onSuccess, Function(String)? onError}) async {
// TODO: THIS SHOULD BE REMOVED LATER ON AND PASSED FROM APP STATE DIRECTLY INTO API CLIENT. BECAUSE THIS API ONLY NEEDS FEW PARAMS FROM USER // TODO: THIS SHOULD BE REMOVED LATER ON AND PASSED FROM APP STATE DIRECTLY INTO API CLIENT. BECAUSE THIS API ONLY NEEDS FEW PARAMS FROM USER
if (phoneNumberController.text.isEmpty) { // if (phoneNumberController.text.isEmpty) {
phoneNumberController.text = "504278212"; // phoneNumberController.text = "504278212";
} // }
bool isValidated = ValidationUtils.isValidatePhoneAndId( bool isValidated = ValidationUtils.isValidatePhoneAndId(
phoneNumber: phoneNumberController.text, phoneNumber: phoneNumberController.text,
nationalId: nationalIdController.text, nationalId: nationalIdController.text,

@ -24,23 +24,7 @@ class InsuranceRepoImp implements InsuranceRepo {
@override @override
Future<Either<Failure, GenericApiModel<List<PatientInsuranceDetailsResponseModel>>>> getPatientInsuranceDetails({required String patientId}) async { Future<Either<Failure, GenericApiModel<List<PatientInsuranceDetailsResponseModel>>>> getPatientInsuranceDetails({required String patientId}) async {
final mapDevice = { Map<String, dynamic> mapDevice = {};
"isDentalAllowedBackend": false,
"VersionID": 50.0,
"Channel": 3,
"LanguageID": 2,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"Latitude": 0.0,
"Longitude": 0.0,
"DeviceTypeID": 1,
"PatientType": 1,
"PatientTypeID": 1,
"TokenID": "@dm!n",
"PatientID": "3628599",
"PatientOutSA": "0",
"SessionID": "03478TYC02N80874CTYN04883475!?"
};
try { try {
GenericApiModel<List<PatientInsuranceDetailsResponseModel>>? apiResponse; GenericApiModel<List<PatientInsuranceDetailsResponseModel>>? apiResponse;
@ -77,29 +61,11 @@ class InsuranceRepoImp implements InsuranceRepo {
} catch (e) { } catch (e) {
return Left(UnknownFailure(e.toString())); return Left(UnknownFailure(e.toString()));
} }
throw UnimplementedError();
} }
@override @override
Future<Either<Failure, GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>>> getPatientInsuranceCardHistory({required String patientId}) async { Future<Either<Failure, GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>>> getPatientInsuranceCardHistory({required String patientId}) async {
final mapDevice = { Map<String, dynamic> mapDevice = {};
"isDentalAllowedBackend": false,
"VersionID": 50.0,
"Channel": 3,
"LanguageID": 2,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"Latitude": 0.0,
"Longitude": 0.0,
"DeviceTypeID": 1,
"PatientType": 1,
"PatientTypeID": 1,
"TokenID": "@dm!n",
"PatientID": "3628599",
"PatientOutSA": "0",
"SessionID": "03478TYC02N80874CTYN04883475!?"
};
try { try {
GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>? apiResponse; GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>? apiResponse;
@ -140,28 +106,7 @@ class InsuranceRepoImp implements InsuranceRepo {
@override @override
Future<Either<Failure, GenericApiModel<PatientInsuranceUpdateResponseModel>>> getPatientInsuranceDetailsForUpdate({required String patientId, required String identificationNo}) async { Future<Either<Failure, GenericApiModel<PatientInsuranceUpdateResponseModel>>> getPatientInsuranceDetailsForUpdate({required String patientId, required String identificationNo}) async {
final mapDevice = { final mapDevice = {"SetupID": "010266", "ProjectID": 15, "PatientIdentificationID": identificationNo, "IsFamily": false, "ParentID": 0};
"SetupID": "010266",
"ProjectID": 15,
"PatientIdentificationID": "2464169354",
"isDentalAllowedBackend": false,
"PatientID": "3628599",
"IsFamily": false,
"ParentID": 0,
"VersionID": 18.8,
"Channel": 3,
"LanguageID": 2,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"Latitude": 0.0,
"Longitude": 0.0,
"DeviceTypeID": 2,
"PatientType": 1,
"PatientTypeID": 1,
"TokenID": "@dm!n",
"PatientOutSA": 0,
"SessionID": "eyy7u090a9dfadsghfpsadiuhf234"
};
try { try {
GenericApiModel<PatientInsuranceUpdateResponseModel>? apiResponse; GenericApiModel<PatientInsuranceUpdateResponseModel>? apiResponse;

@ -89,8 +89,8 @@ class InsuranceViewModel extends ChangeNotifier {
); );
} }
Future<void> getPatientInsuranceDetailsForUpdate({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientInsuranceDetailsForUpdate(String patientID, String identificationNo, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await insuranceRepo.getPatientInsuranceDetailsForUpdate(patientId: "1231755", identificationNo: ""); final result = await insuranceRepo.getPatientInsuranceDetailsForUpdate(patientId: patientID, identificationNo: identificationNo);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),

@ -394,12 +394,12 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
"Appointment check in", "Appointment check in",
transID, transID,
widget.patientAppointmentHistoryResponseModel.projectID.toString(), widget.patientAppointmentHistoryResponseModel.projectID.toString(),
"CustID_3628599@HMG.com", "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com",
selectedPaymentMethod, selectedPaymentMethod,
"1", appState.getAuthenticatedUser()!.patientType.toString(),
"Haroon Amjad", "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}",
"3628599", appState.getAuthenticatedUser()!.patientId.toString(),
AuthenticatedUser(outSa: 0, mobileNumber: "0593233758"), appState.getAuthenticatedUser()!,
browser!, browser!,
widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false, widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false,
"2", "2",
@ -429,9 +429,9 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
//TODO: Need to pass dynamic params to the payment request instead of static values //TODO: Need to pass dynamic params to the payment request instead of static values
applePayInsertRequest.currency = "SAR"; applePayInsertRequest.currency = "SAR";
applePayInsertRequest.customerEmail = "CustID_3628599@HMG.com"; applePayInsertRequest.customerEmail = "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com";
applePayInsertRequest.customerID = "3628599"; applePayInsertRequest.customerID = appState.getAuthenticatedUser()!.patientId.toString();
applePayInsertRequest.customerName = "Haroon Amjad"; applePayInsertRequest.customerName = "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}";
applePayInsertRequest.deviceToken = await Utils.getStringFromPrefs(CacheConst.pushToken); applePayInsertRequest.deviceToken = await Utils.getStringFromPrefs(CacheConst.pushToken);
applePayInsertRequest.voipToken = await Utils.getStringFromPrefs(CacheConst.voipToken); applePayInsertRequest.voipToken = await Utils.getStringFromPrefs(CacheConst.voipToken);
@ -439,7 +439,7 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
applePayInsertRequest.projectID = widget.patientAppointmentHistoryResponseModel.projectID.toString(); applePayInsertRequest.projectID = widget.patientAppointmentHistoryResponseModel.projectID.toString();
applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString(); applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3; applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = "3628599"; applePayInsertRequest.patientID = appState.getAuthenticatedUser()!.patientId.toString();
applePayInsertRequest.patientTypeID = 1; applePayInsertRequest.patientTypeID = 1;
applePayInsertRequest.patientOutSA = 0; applePayInsertRequest.patientOutSA = 0;
applePayInsertRequest.appointmentDate = widget.patientAppointmentHistoryResponseModel.appointmentDate; applePayInsertRequest.appointmentDate = widget.patientAppointmentHistoryResponseModel.appointmentDate;
@ -470,9 +470,9 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
//TODO: Need to pass dynamic params to the Apple Pay instead of static values //TODO: Need to pass dynamic params to the Apple Pay instead of static values
await payfortViewModel.applePayRequestInsert(applePayInsertRequest: applePayInsertRequest).then((value) { await payfortViewModel.applePayRequestInsert(applePayInsertRequest: applePayInsertRequest).then((value) {
payfortViewModel.paymentWithApplePay( payfortViewModel.paymentWithApplePay(
customerName: "Haroon Amjad", customerName: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}",
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_3628599@HMG.com", customerEmail: "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com",
orderDescription: "Appointment Payment", orderDescription: "Appointment Payment",
orderAmount: double.parse(myAppointmentsViewModel.patientAppointmentShareResponseModel!.patientShareWithTax!.toString()), orderAmount: double.parse(myAppointmentsViewModel.patientAppointmentShareResponseModel!.patientShareWithTax!.toString()),
merchantReference: transID, merchantReference: transID,

@ -13,7 +13,9 @@ import 'package:hmg_patient_app_new/features/my_appointments/utils/appointment_t
import 'package:hmg_patient_app_new/presentation/appointments/appointment_details_page.dart'; import 'package:hmg_patient_app_new/presentation/appointments/appointment_details_page.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/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:smooth_corner/smooth_corner.dart';
class AppointmentCard extends StatefulWidget { class AppointmentCard extends StatefulWidget {
AppointmentCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.myAppointmentsViewModel}); AppointmentCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.myAppointmentsViewModel});
@ -38,7 +40,7 @@ class _AppointmentCardState extends State<AppointmentCard> {
); );
}, },
child: Padding( child: Padding(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(14.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -123,77 +125,28 @@ class _AppointmentCardState extends State<AppointmentCard> {
fit: BoxFit.fill, fit: BoxFit.fill,
).circle(100), ).circle(100),
SizedBox(width: 16.h), SizedBox(width: 16.h),
Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
widget.patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true), children: [
SizedBox(height: 8.h), widget.patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true),
Row( Wrap(
children: [ direction: Axis.horizontal,
CustomButton( spacing: 3.h,
text: widget.patientAppointmentHistoryResponseModel.clinicName!, runSpacing: -8.h,
onPressed: () {}, children: [
backgroundColor: AppColors.greyColor, AppCustomChipWidget(labelText: widget.patientAppointmentHistoryResponseModel.clinicName!),
borderColor: AppColors.greyColor, AppCustomChipWidget(labelText: widget.patientAppointmentHistoryResponseModel.projectName!),
textColor: AppColors.blackColor, AppCustomChipWidget(
fontSize: 10, icon: AppAssets.appointment_calendar_icon,
fontWeight: FontWeight.w500, labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)),
borderRadius: 8, AppCustomChipWidget(
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), icon: AppAssets.appointment_time_icon,
height: 30.h, labelText: DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)),
), ],
SizedBox(width: 6.h), ),
CustomButton( ],
text: widget.patientAppointmentHistoryResponseModel.projectName!, ),
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
],
),
SizedBox(height: 6.h),
Row(
children: [
CustomButton(
icon: AppAssets.appointment_calendar_icon,
iconColor: AppColors.blackColor,
iconSize: 12.h,
text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false),
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
SizedBox(width: 6.h),
CustomButton(
icon: AppAssets.appointment_time_icon,
iconColor: AppColors.blackColor,
iconSize: 12.h,
text: DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false),
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
],
)
],
), ),
], ],
), ),

@ -10,6 +10,7 @@ import 'package:hmg_patient_app_new/features/my_appointments/utils/appointment_t
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/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/chip/app_custom_chip_widget.dart';
class AppointmentDoctorCard extends StatelessWidget { class AppointmentDoctorCard extends StatelessWidget {
AppointmentDoctorCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.onRescheduleTap, required this.onCancelTap, required this.onAskDoctorTap}); AppointmentDoctorCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.onRescheduleTap, required this.onCancelTap, required this.onAskDoctorTap});
@ -28,7 +29,7 @@ class AppointmentDoctorCard extends StatelessWidget {
hasShadow: true, hasShadow: true,
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(14.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -47,72 +48,23 @@ class AppointmentDoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true), patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true),
SizedBox(height: 8.h), Wrap(
Row( direction: Axis.horizontal,
spacing: 3.h,
runSpacing: -8.h,
children: [ children: [
CustomButton( AppCustomChipWidget(labelText: patientAppointmentHistoryResponseModel.clinicName!),
text: patientAppointmentHistoryResponseModel.clinicName!, AppCustomChipWidget(labelText: patientAppointmentHistoryResponseModel.projectName!),
onPressed: () {}, AppCustomChipWidget(
backgroundColor: AppColors.greyColor, icon: AppAssets.doctor_calendar_icon,
borderColor: AppColors.greyColor, labelText:
textColor: AppColors.blackColor, "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}, ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}"),
fontSize: 10, AppCustomChipWidget(
fontWeight: FontWeight.w500, icon: AppAssets.rating_icon,
borderRadius: 8, iconColor: AppColors.ratingColorYellow,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), labelText: "Rating: ${patientAppointmentHistoryResponseModel.decimalDoctorRate}"),
height: 30.h,
),
SizedBox(width: 6.h),
CustomButton(
text: patientAppointmentHistoryResponseModel.projectName!,
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
], ],
), ),
SizedBox(height: 6.h),
Row(
children: [
CustomButton(
icon: AppAssets.appointment_calendar_icon,
iconColor: AppColors.blackColor,
iconSize: 12.h,
text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false),
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
SizedBox(width: 6.h),
CustomButton(
icon: AppAssets.appointment_time_icon,
iconColor: AppColors.blackColor,
iconSize: 12.h,
text: DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false),
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h,
),
],
)
], ],
), ),
), ),

@ -78,7 +78,7 @@ class _SavedLogin extends State<SavedLogin> {
children: [ children: [
// Last login info // Last login info
("${LocaleKeys.lastloginBy.tr()} ${LoginTypeExtension.fromValue(appState.getSelectDeviceByImeiRespModelElement!.logInType!)!.displayName}") ("${LocaleKeys.lastloginBy.tr()} ${LoginTypeExtension.fromValue(appState.getSelectDeviceByImeiRespModelElement!.logInType ?? 0)!.displayName}")
.toText14(isBold: true, color: AppColors.greyTextColor), .toText14(isBold: true, color: AppColors.greyTextColor),
(appState.getSelectDeviceByImeiRespModelElement!.createdOn != null (appState.getSelectDeviceByImeiRespModelElement!.createdOn != null
? DateUtil.getFormattedDate(DateUtil.convertStringToDate(appState.getSelectDeviceByImeiRespModelElement!.createdOn!), "d MMMM, y at HH:mm") ? DateUtil.getFormattedDate(DateUtil.convertStringToDate(appState.getSelectDeviceByImeiRespModelElement!.createdOn!), "d MMMM, y at HH:mm")

@ -1,6 +1,8 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.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/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.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/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
@ -21,9 +23,11 @@ class PatientInsuranceCard extends StatelessWidget {
bool isInsuranceExpired = false; bool isInsuranceExpired = false;
late InsuranceViewModel insuranceViewModel; late InsuranceViewModel insuranceViewModel;
late AppState appState;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
appState = getIt.get<AppState>();
insuranceViewModel = Provider.of<InsuranceViewModel>(context); insuranceViewModel = Provider.of<InsuranceViewModel>(context);
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -42,7 +46,7 @@ class PatientInsuranceCard extends StatelessWidget {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Haroon Amjad".toText18(isBold: true), "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true),
"Policy: ${insuranceCardDetailsModel.insurancePolicyNo}".toText12(isBold: true, color: AppColors.lightGrayColor), "Policy: ${insuranceCardDetailsModel.insurancePolicyNo}".toText12(isBold: true, color: AppColors.lightGrayColor),
], ],
), ),
@ -118,9 +122,15 @@ class PatientInsuranceCard extends StatelessWidget {
text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}", text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}",
onPressed: () { onPressed: () {
insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true); insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true);
insuranceViewModel.getPatientInsuranceDetailsForUpdate(); insuranceViewModel.getPatientInsuranceDetailsForUpdate(
appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString());
showCommonBottomSheet(context, showCommonBottomSheet(context,
child: PatientInsuranceCardUpdateCard(), callBackFunc: (str) {}, title: "", height: ResponsiveExtension.screenHeight * 0.42, isCloseButtonVisible: false, isFullScreen: false); child: PatientInsuranceCardUpdateCard(),
callBackFunc: (str) {},
title: "",
height: ResponsiveExtension.screenHeight * 0.42,
isCloseButtonVisible: false,
isFullScreen: false);
}, },
backgroundColor: AppColors.bgGreenColor.withOpacity(0.20), backgroundColor: AppColors.bgGreenColor.withOpacity(0.20),
borderColor: AppColors.bgGreenColor.withOpacity(0.0), borderColor: AppColors.bgGreenColor.withOpacity(0.0),

@ -3,6 +3,8 @@ import 'dart:async';
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/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.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/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
@ -30,6 +32,7 @@ class MedicalFilePage extends StatefulWidget {
class _MedicalFilePageState extends State<MedicalFilePage> { class _MedicalFilePageState extends State<MedicalFilePage> {
late InsuranceViewModel insuranceViewModel; late InsuranceViewModel insuranceViewModel;
late AppState appState;
int currentIndex = 0; int currentIndex = 0;
@ -44,6 +47,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
insuranceViewModel = Provider.of<InsuranceViewModel>(context); insuranceViewModel = Provider.of<InsuranceViewModel>(context);
appState = getIt.get<AppState>();
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor, backgroundColor: AppColors.bgScaffoldColor,
appBar: AppBar( appBar: AppBar(
@ -84,7 +88,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.asset( Image.asset(
AppAssets.male_img, appState.getAuthenticatedUser()?.gender == 1 ? AppAssets.male_img : AppAssets.femaleImg,
width: 56.h, width: 56.h,
height: 56.h, height: 56.h,
), ),
@ -92,7 +96,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Haroon Amjad".toText18(isBold: true), "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true),
SizedBox(height: 4.h), SizedBox(height: 4.h),
Row( Row(
children: [ children: [
@ -100,7 +104,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
icon: AppAssets.file_icon, icon: AppAssets.file_icon,
iconColor: AppColors.blackColor, iconColor: AppColors.blackColor,
iconSize: 12.h, iconSize: 12.h,
text: "File no: 3628599", text: "File no: ${appState.getAuthenticatedUser()!.patientId}",
onPressed: () {}, onPressed: () {},
backgroundColor: AppColors.greyColor, backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor, borderColor: AppColors.greyColor,
@ -136,7 +140,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Row( Row(
children: [ children: [
CustomButton( CustomButton(
text: "30 Years Old", text: "${appState.getAuthenticatedUser()!.age} Years Old",
onPressed: () {}, onPressed: () {},
backgroundColor: AppColors.greyColor, backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor, borderColor: AppColors.greyColor,
@ -152,7 +156,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
icon: AppAssets.blood_icon, icon: AppAssets.blood_icon,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
iconSize: 13.h, iconSize: 13.h,
text: "Blood: A+", text: "Blood: ${appState.getUserBloodGroup}",
onPressed: () {}, onPressed: () {},
backgroundColor: AppColors.greyColor, backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor, borderColor: AppColors.greyColor,

@ -0,0 +1,57 @@
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/theme/colors.dart';
import 'package:smooth_corner/smooth_corner.dart';
class AppCustomChipWidget extends StatelessWidget {
AppCustomChipWidget({
super.key,
required this.labelText,
this.textColor = AppColors.textColor,
this.backgroundColor = AppColors.greyColor,
this.iconSize = 12,
this.icon = "",
this.iconColor = AppColors.textColor,
});
String? labelText;
Color? textColor;
Color? backgroundColor;
num iconSize;
String icon;
Color iconColor;
@override
Widget build(BuildContext context) {
return ChipTheme(
data: ChipThemeData(
padding: EdgeInsets.all(0.0),
shape: SmoothRectangleBorder(
side: BorderSide(
width: 0.0,
color: Colors.transparent, // Crucially, set color to transparent
style: BorderStyle.none,
),
borderRadius: BorderRadius.circular(8.0), // Apply a border radius of 16.0
),
),
child: icon.isNotEmpty
? Chip(
avatar: icon.isNotEmpty ? Utils.buildSvgWithAssets(icon: icon, width: iconSize.h, height: iconSize.h, iconColor: iconColor) : SizedBox.shrink(),
label: labelText!.toText10(weight: FontWeight.w500, letterSpacing: -0.64, color: textColor),
padding: EdgeInsets.all(0.0),
labelPadding: EdgeInsets.only(left: -4.h, right: 8.h),
backgroundColor: backgroundColor,
)
: Chip(
label: labelText!.toText10(weight: FontWeight.w500, letterSpacing: -0.64, color: textColor),
padding: EdgeInsets.all(0.0),
backgroundColor: backgroundColor,
),
);
}
}
Loading…
Cancel
Save