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) {
switch (value) {
case 0:
return LoginTypeEnum.sms;
case 1:
return LoginTypeEnum.sms;
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,
maxLines: maxlines,
overflow: textOverflow,
style: TextStyle(
fontSize: 10.fSize,
fontStyle: fontStyle ?? FontStyle.normal,
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
color: color ?? AppColors.blackColor,
letterSpacing: -1,
letterSpacing: letterSpacing,
decoration: isUnderLine ? TextDecoration.underline : null,
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,
textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null,
@ -57,7 +57,7 @@ extension EmailValidator on String {
fontSize: 11.fSize,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
color: color ?? AppColors.blackColor,
letterSpacing: -1,
letterSpacing: letterSpacing,
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 {
// LoadingUtils.showFullScreenLoading();
// 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"
// : _appState.deviceToken;
@ -176,7 +177,9 @@ class AuthenticationViewModel extends ChangeNotifier {
result.fold(
(failure) async {
// LoadingUtils.hideFullScreenLoader();
await _errorHandlerService.handleError(failure: failure);
// await _errorHandlerService.handleError(failure: failure);
LoadingUtils.hideFullScreenLoader();
_navigationService.pushPage(page: LoginScreen());
},
(apiResponse) {
// LoadingUtils.hideFullScreenLoader();
@ -239,9 +242,9 @@ class AuthenticationViewModel extends ChangeNotifier {
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
if (phoneNumberController.text.isEmpty) {
phoneNumberController.text = "504278212";
}
// if (phoneNumberController.text.isEmpty) {
// phoneNumberController.text = "504278212";
// }
bool isValidated = ValidationUtils.isValidatePhoneAndId(
phoneNumber: phoneNumberController.text,
nationalId: nationalIdController.text,

@ -24,23 +24,7 @@ class InsuranceRepoImp implements InsuranceRepo {
@override
Future<Either<Failure, GenericApiModel<List<PatientInsuranceDetailsResponseModel>>>> getPatientInsuranceDetails({required String patientId}) async {
final 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!?"
};
Map<String, dynamic> mapDevice = {};
try {
GenericApiModel<List<PatientInsuranceDetailsResponseModel>>? apiResponse;
@ -77,29 +61,11 @@ class InsuranceRepoImp implements InsuranceRepo {
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
throw UnimplementedError();
}
@override
Future<Either<Failure, GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>>> getPatientInsuranceCardHistory({required String patientId}) async {
final 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!?"
};
Map<String, dynamic> mapDevice = {};
try {
GenericApiModel<List<PatientInsuranceCardHistoryResponseModel>>? apiResponse;
@ -140,28 +106,7 @@ class InsuranceRepoImp implements InsuranceRepo {
@override
Future<Either<Failure, GenericApiModel<PatientInsuranceUpdateResponseModel>>> getPatientInsuranceDetailsForUpdate({required String patientId, required String identificationNo}) async {
final mapDevice = {
"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"
};
final mapDevice = {"SetupID": "010266", "ProjectID": 15, "PatientIdentificationID": identificationNo, "IsFamily": false, "ParentID": 0};
try {
GenericApiModel<PatientInsuranceUpdateResponseModel>? apiResponse;

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

@ -394,12 +394,12 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
"Appointment check in",
transID,
widget.patientAppointmentHistoryResponseModel.projectID.toString(),
"CustID_3628599@HMG.com",
"CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com",
selectedPaymentMethod,
"1",
"Haroon Amjad",
"3628599",
AuthenticatedUser(outSa: 0, mobileNumber: "0593233758"),
appState.getAuthenticatedUser()!.patientType.toString(),
"${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}",
appState.getAuthenticatedUser()!.patientId.toString(),
appState.getAuthenticatedUser()!,
browser!,
widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false,
"2",
@ -429,9 +429,9 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
//TODO: Need to pass dynamic params to the payment request instead of static values
applePayInsertRequest.currency = "SAR";
applePayInsertRequest.customerEmail = "CustID_3628599@HMG.com";
applePayInsertRequest.customerID = "3628599";
applePayInsertRequest.customerName = "Haroon Amjad";
applePayInsertRequest.customerEmail = "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com";
applePayInsertRequest.customerID = appState.getAuthenticatedUser()!.patientId.toString();
applePayInsertRequest.customerName = "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}";
applePayInsertRequest.deviceToken = await Utils.getStringFromPrefs(CacheConst.pushToken);
applePayInsertRequest.voipToken = await Utils.getStringFromPrefs(CacheConst.voipToken);
@ -439,7 +439,7 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
applePayInsertRequest.projectID = widget.patientAppointmentHistoryResponseModel.projectID.toString();
applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = "3628599";
applePayInsertRequest.patientID = appState.getAuthenticatedUser()!.patientId.toString();
applePayInsertRequest.patientTypeID = 1;
applePayInsertRequest.patientOutSA = 0;
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
await payfortViewModel.applePayRequestInsert(applePayInsertRequest: applePayInsertRequest).then((value) {
payfortViewModel.paymentWithApplePay(
customerName: "Haroon Amjad",
customerName: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}",
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_3628599@HMG.com",
customerEmail: "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com",
orderDescription: "Appointment Payment",
orderAmount: double.parse(myAppointmentsViewModel.patientAppointmentShareResponseModel!.patientShareWithTax!.toString()),
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/theme/colors.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:smooth_corner/smooth_corner.dart';
class AppointmentCard extends StatefulWidget {
AppointmentCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.myAppointmentsViewModel});
@ -38,7 +40,7 @@ class _AppointmentCardState extends State<AppointmentCard> {
);
},
child: Padding(
padding: EdgeInsets.all(16.h),
padding: EdgeInsets.all(14.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -123,77 +125,28 @@ class _AppointmentCardState extends State<AppointmentCard> {
fit: BoxFit.fill,
).circle(100),
SizedBox(width: 16.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true),
SizedBox(height: 8.h),
Row(
children: [
CustomButton(
text: widget.patientAppointmentHistoryResponseModel.clinicName!,
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(
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,
),
],
)
],
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true),
Wrap(
direction: Axis.horizontal,
spacing: 3.h,
runSpacing: -8.h,
children: [
AppCustomChipWidget(labelText: widget.patientAppointmentHistoryResponseModel.clinicName!),
AppCustomChipWidget(labelText: widget.patientAppointmentHistoryResponseModel.projectName!),
AppCustomChipWidget(
icon: AppAssets.appointment_calendar_icon,
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)),
AppCustomChipWidget(
icon: AppAssets.appointment_time_icon,
labelText: DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)),
],
),
],
),
),
],
),

@ -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/theme/colors.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 {
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,
),
child: Padding(
padding: EdgeInsets.all(16.h),
padding: EdgeInsets.all(14.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -47,72 +48,23 @@ class AppointmentDoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true),
SizedBox(height: 8.h),
Row(
Wrap(
direction: Axis.horizontal,
spacing: 3.h,
runSpacing: -8.h,
children: [
CustomButton(
text: patientAppointmentHistoryResponseModel.clinicName!,
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(
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,
),
AppCustomChipWidget(labelText: patientAppointmentHistoryResponseModel.clinicName!),
AppCustomChipWidget(labelText: patientAppointmentHistoryResponseModel.projectName!),
AppCustomChipWidget(
icon: AppAssets.doctor_calendar_icon,
labelText:
"${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}, ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}"),
AppCustomChipWidget(
icon: AppAssets.rating_icon,
iconColor: AppColors.ratingColorYellow,
labelText: "Rating: ${patientAppointmentHistoryResponseModel.decimalDoctorRate}"),
],
),
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: [
// 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),
(appState.getSelectDeviceByImeiRespModelElement!.createdOn != null
? 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:flutter/cupertino.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/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
@ -21,9 +23,11 @@ class PatientInsuranceCard extends StatelessWidget {
bool isInsuranceExpired = false;
late InsuranceViewModel insuranceViewModel;
late AppState appState;
@override
Widget build(BuildContext context) {
appState = getIt.get<AppState>();
insuranceViewModel = Provider.of<InsuranceViewModel>(context);
return Container(
width: double.infinity,
@ -42,7 +46,7 @@ class PatientInsuranceCard extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Haroon Amjad".toText18(isBold: true),
"${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true),
"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)}",
onPressed: () {
insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true);
insuranceViewModel.getPatientInsuranceDetailsForUpdate();
insuranceViewModel.getPatientInsuranceDetailsForUpdate(
appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString());
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),
borderColor: AppColors.bgGreenColor.withOpacity(0.0),

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