Merge branch 'refs/heads/master' into dev_sikander

pull/19/head
Sikander Saleem 2 months ago
commit 60fe32131e

@ -0,0 +1,8 @@
<svg id="user_21_" data-name="user (21)" xmlns="http://www.w3.org/2000/svg" width="110.999" height="110.999" viewBox="0 0 110.999 110.999">
<path id="Path_4696" data-name="Path 4696" d="M272.482,267.883a25.756,25.756,0,0,0,5.549-15.868,26.015,26.015,0,1,0-26.015,26.015,25.756,25.756,0,0,0,15.868-5.549l14.569,14.569a3.252,3.252,0,1,0,4.6-4.6ZM260.818,256.22a3.252,3.252,0,1,1-4.6,4.6l-4.2-4.2-4.2,4.2a3.252,3.252,0,0,1-4.6-4.6l4.2-4.2-4.2-4.2a3.252,3.252,0,0,1,4.6-4.6l4.2,4.2,4.2-4.2a3.252,3.252,0,1,1,4.6,4.6l-4.2,4.2Z" transform="translate(-177.004 -177.004)" fill="#ddd"/>
<circle id="Ellipse_165" data-name="Ellipse 165" cx="3.5" cy="3.5" r="3.5" transform="translate(35.5 19.499)" fill="#ddd"/>
<path id="Path_4697" data-name="Path 4697" d="M197.516,362h0Z" transform="translate(-154.695 -283.52)" fill="#ddd"/>
<path id="Path_4698" data-name="Path 4698" d="M197.516,332h0Z" transform="translate(-154.695 -260.021)" fill="#ddd"/>
<path id="Path_4699" data-name="Path 4699" d="M3.252,111H75.011a3.25,3.25,0,0,0,3.252-3.252v-.329a31.763,31.763,0,0,1-3.252.329,32.393,32.393,0,0,1-23.165-9.756H16.476a3.252,3.252,0,0,1,0-6.5H47.016v0a32.2,32.2,0,0,1-2.865-6.507H16.476a3.252,3.252,0,0,1,0-6.5H42.821c-.454-4.484-.454-2.022,0-6.5H16.476a3.252,3.252,0,1,1,0-6.5H44.152a32.468,32.468,0,0,1,7.694-13.009H26.232a3.25,3.25,0,0,1-3.252-3.252V45.96A13.021,13.021,0,0,1,35.988,32.953H39.24A9.756,9.756,0,1,1,49,23.2a9.767,9.767,0,0,1-9.756,9.756h3.252A13.021,13.021,0,0,1,55.5,45.96v3.252c0,.071-.036.13-.04.2a32.2,32.2,0,0,1,19.552-6.7,31.762,31.762,0,0,1,3.252.329V3.252A3.25,3.25,0,0,0,75.011,0H3.252A3.25,3.25,0,0,0,0,3.252v104.5A3.25,3.25,0,0,0,3.252,111Z" fill="#ddd"/>
<path id="Path_4700" data-name="Path 4700" d="M142.5,182a6.512,6.512,0,0,0-6.5,6.5h19.512a6.512,6.512,0,0,0-6.5-6.5Z" transform="translate(-106.516 -142.543)" fill="#ddd"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -7,13 +7,16 @@ import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/app_state.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/dependencies.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/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart'; import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart'; import 'package:hmg_patient_app_new/services/logger_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import '../exceptions/api_failure.dart'; import '../exceptions/api_failure.dart';
abstract class ApiClient { abstract class ApiClient {
static final NavigationService _navigationService = getIt.get<NavigationService>();
Future<void> post( Future<void> post(
String endPoint, { String endPoint, {
required Map<String, dynamic> body, required Map<String, dynamic> body,
@ -105,7 +108,7 @@ class ApiClientImp implements ApiClient {
url = ApiConsts.baseUrl + endPoint; url = ApiConsts.baseUrl + endPoint;
} }
} }
try { // try {
var user = _appState.getAuthenticatedUser(); var user = _appState.getAuthenticatedUser();
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
if (!isExternal) { if (!isExternal) {
@ -261,6 +264,8 @@ class ApiClientImp implements ApiClient {
logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode);
} }
} }
} else if (!parsed['IsAuthenticated']) {
} else { } else {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']); onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
@ -285,16 +290,20 @@ class ApiClientImp implements ApiClient {
} }
} }
} }
} catch (e, stackTrace) { // } catch (e, stackTrace) {
_loggerService.errorLogs(stackTrace.toString()); // _loggerService.errorLogs(stackTrace.toString());
if (e.toString().contains("ClientException")) { // if (e.toString().contains("ClientException")) {
onFailure('ClientException: Something went wrong, Please try again', -1, failureType: InvalidCredentials('ClientException: Something went wrong, plase try again')); // onFailure('ClientException: Something went wrong, Please try again', -1, failureType: InvalidCredentials('ClientException: Something went wrong, plase try again'));
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); // _analytics.errorTracking.log("internet_connectivity", error: "no internet available");
} else { // } else {
onFailure(e.toString(), -1); // onFailure(e.toString(), -1);
} // }
_analytics.errorTracking.log(endPoint, error: "api exception: $e - API Path: $url"); // _analytics.errorTracking.log(endPoint, error: "api exception: $e - API Path: $url");
// }
} }
logout() async {
ApiClient._navigationService.pushAndReplace(AppRoutes.landingScreen);
} }
@override @override

@ -726,7 +726,7 @@ const DEACTIVATE_ACCOUNT = 'Services/Patients.svc/REST/PatientAppleActivation_In
class ApiConsts { class ApiConsts {
static const maxSmallScreen = 660; static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT

@ -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:

@ -291,7 +291,7 @@ class Utils {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SvgPicture.asset('assets/images/NoDataAvailableIcon.svg', width: 150.0, height: 150.0), SvgPicture.asset('assets/images/svg/not_found.svg', width: 150.0, height: 150.0),
(errorText ?? LocaleKeys.noDataAvailable.tr()).toText16(isCenter: true).paddingOnly(top: 15), (errorText ?? LocaleKeys.noDataAvailable.tr()).toText16(isCenter: true).paddingOnly(top: 15),
], ],
).center; ).center;
@ -310,6 +310,19 @@ class Utils {
).center; ).center;
} }
static Widget getSuccessWidget({String? loadingText}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Lottie.asset(AppAnimations.checkmark, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
SizedBox(height: 8.h),
(loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor),
SizedBox(height: 8.h),
],
).center;
}
static bool isVidaPlusProject(AppState appState, int projectID) { static bool isVidaPlusProject(AppState appState, int projectID) {
bool isVidaPlus = false; bool isVidaPlus = false;
for (var element in appState.vidaPlusProjectList) { for (var element in appState.vidaPlusProjectList) {

@ -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,
), ),
); );
@ -125,6 +125,8 @@ extension EmailValidator on String {
bool isBold = false, bool isBold = false,
bool isCenter = false, bool isCenter = false,
int maxLine = 0, int maxLine = 0,
FontWeight? weight,
double? letterSpacing = -1
}) => }) =>
Text( Text(
this, this,
@ -132,9 +134,9 @@ extension EmailValidator on String {
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
style: TextStyle( style: TextStyle(
fontSize: 13.fSize, fontSize: 13.fSize,
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),
); );

@ -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),

@ -18,23 +18,7 @@ class LabRepoImp implements LabRepo {
@override @override
Future<Either<Failure, GenericApiModel<List<PatientLabOrdersResponseModel>>>> getPatientLabOrders({required String patientId}) async { Future<Either<Failure, GenericApiModel<List<PatientLabOrdersResponseModel>>>> getPatientLabOrders({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": "1018977",
"PatientOutSA": "0",
"SessionID": "03478TYC02N80874CTYN04883475!?"
};
try { try {
GenericApiModel<List<PatientLabOrdersResponseModel>>? apiResponse; GenericApiModel<List<PatientLabOrdersResponseModel>>? apiResponse;
@ -52,10 +36,7 @@ class LabRepoImp implements LabRepo {
throw Exception("lab list is empty"); throw Exception("lab list is empty");
} }
final labOrders = list final labOrders = list.map((item) => PatientLabOrdersResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientLabOrdersResponseModel>();
.map((item) => PatientLabOrdersResponseModel.fromJson(item as Map<String, dynamic>))
.toList()
.cast<PatientLabOrdersResponseModel>();
apiResponse = GenericApiModel<List<PatientLabOrdersResponseModel>>( apiResponse = GenericApiModel<List<PatientLabOrdersResponseModel>>(
messageStatus: messageStatus, messageStatus: messageStatus,

@ -9,10 +9,9 @@ import 'package:hmg_patient_app_new/services/logger_service.dart';
abstract class MyAppointmentsRepo { abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments( Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments(
{required String patientId, required bool isActiveAppointment, required bool isArrivedAppointments}); {required bool isActiveAppointment, required bool isArrivedAppointments});
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment( Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment({required int projectID, required int clinicID, required String appointmentNo});
{required String patientId, required int projectID, required int clinicID, required String appointmentNo});
Future<Either<Failure, GenericApiModel<dynamic>>> createAdvancePayment( Future<Either<Failure, GenericApiModel<dynamic>>> createAdvancePayment(
{required String paymentMethodName, {required String paymentMethodName,
@ -26,7 +25,9 @@ abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<dynamic>>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference, required String appointmentNo}); Future<Either<Failure, GenericApiModel<dynamic>>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference, required String appointmentNo});
Future<Either<Failure, GenericApiModel<dynamic>>> generateAppointmentQR({required String clinicID, required String projectID, required String appointmentNo, required int isFollowUp}); Future<Either<Failure, GenericApiModel<dynamic>>> generateAppointmentQR({required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp});
Future<Either<Failure, GenericApiModel<dynamic>>> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel});
} }
class MyAppointmentsRepoImp implements MyAppointmentsRepo { class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@ -37,8 +38,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@override @override
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments( Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments(
{required String patientId, required bool isActiveAppointment, required bool isArrivedAppointments}) async { {required bool isActiveAppointment, required bool isArrivedAppointments}) async {
final mapDevice = { Map<String, dynamic> mapDevice = {
"IsActiveAppointment": isActiveAppointment, "IsActiveAppointment": isActiveAppointment,
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
"PatientTypeID": 1, "PatientTypeID": 1,
@ -61,9 +62,9 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
onSuccess: (response, statusCode, {messageStatus, errorMessage}) { onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try { try {
final list = response['AppoimentAllHistoryResultList']; final list = response['AppoimentAllHistoryResultList'];
if (list == null || list.isEmpty) { // if (list == null || list.isEmpty) {
throw Exception("Appointments list is empty"); // throw Exception("Appointments list is empty");
} // }
final appointmentsList = list.map((item) => PatientAppointmentHistoryResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientAppointmentHistoryResponseModel>(); final appointmentsList = list.map((item) => PatientAppointmentHistoryResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientAppointmentHistoryResponseModel>();
@ -87,19 +88,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
} }
@override @override
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment( Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment({required int projectID, required int clinicID, required String appointmentNo}) async {
{required String patientId, required int projectID, required int clinicID, required String appointmentNo}) async { Map<String, dynamic> mapRequest = {"ProjectID": projectID, "ClinicID": clinicID, "AppointmentNo": appointmentNo, "IsActiveAppointment": true};
final mapRequest = {
"ProjectID": projectID,
"ClinicID": clinicID,
"AppointmentNo": appointmentNo,
"IsActiveAppointment": true,
"PatientOutSA": 0,
"isDentalAllowedBackend": false,
"PatientID": patientId,
"PatientTypeID": 1,
"PatientType": 1,
};
try { try {
GenericApiModel<PatientAppointmentShareResponseModel>? apiResponse; GenericApiModel<PatientAppointmentShareResponseModel>? apiResponse;
@ -139,8 +129,6 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
} catch (e) { } catch (e) {
return Left(UnknownFailure(e.toString())); return Left(UnknownFailure(e.toString()));
} }
throw UnimplementedError();
} }
@override @override
@ -154,7 +142,7 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
required String patientID, required String patientID,
required int patientType, required int patientType,
}) async { }) async {
final requestBody = { Map<String, dynamic> requestBody = {
"ProjectID": projectID, "ProjectID": projectID,
"OnlineCheckInAppointment": { "OnlineCheckInAppointment": {
"AppointmentNo": appointmentNo, "AppointmentNo": appointmentNo,
@ -202,7 +190,7 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@override @override
Future<Either<Failure, GenericApiModel>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference, required String appointmentNo}) async { Future<Either<Failure, GenericApiModel>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference, required String appointmentNo}) async {
final requestBody = { Map<String, dynamic> requestBody = {
"AdvanceNumber": advanceNumber, "AdvanceNumber": advanceNumber,
"AdvanceNumber_VP": advanceNumber, "AdvanceNumber_VP": advanceNumber,
"PaymentReferenceNumber": paymentReference, "PaymentReferenceNumber": paymentReference,
@ -240,8 +228,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
} }
@override @override
Future<Either<Failure, GenericApiModel>> generateAppointmentQR({required String clinicID, required String projectID, required String appointmentNo, required int isFollowUp}) async { Future<Either<Failure, GenericApiModel>> generateAppointmentQR({required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp}) async {
final requestBody = { Map<String, dynamic> requestBody = {
"AppointmentNo": appointmentNo, "AppointmentNo": appointmentNo,
"ClinicID": clinicID, "ClinicID": clinicID,
"ProjectID": projectID, "ProjectID": projectID,
@ -277,4 +265,49 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
return Left(UnknownFailure(e.toString())); return Left(UnknownFailure(e.toString()));
} }
} }
@override
Future<Either<Failure, GenericApiModel>> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel}) async {
Map<String, dynamic> requestBody = {
"AppointmentID": patientAppointmentHistoryResponseModel.appointmentNo,
"ClinicID": patientAppointmentHistoryResponseModel.clinicID,
"ProjectID": patientAppointmentHistoryResponseModel.projectID,
"CancelToReschadual": false,
"EndTime": patientAppointmentHistoryResponseModel.endTime,
"StartTime": patientAppointmentHistoryResponseModel.startTime,
"DoctorID": patientAppointmentHistoryResponseModel.doctorID,
"IsForLiveCare": patientAppointmentHistoryResponseModel.isLiveCareAppointment,
"OriginalClinicID": patientAppointmentHistoryResponseModel.originalClinicID,
"OriginalProjectID": patientAppointmentHistoryResponseModel.originalProjectID
};
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
CANCEL_APPOINTMENT,
body: requestBody,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
} }

@ -49,7 +49,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getPatientAppointments(patientId: "3628599", isActiveAppointment: isActiveAppointment, isArrivedAppointments: isArrivedAppointments); final result = await myAppointmentsRepo.getPatientAppointments(isActiveAppointment: isActiveAppointment, isArrivedAppointments: isArrivedAppointments);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -69,7 +69,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, {Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getPatientShareAppointment(patientId: "3628599", projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo); final result = await myAppointmentsRepo.getPatientShareAppointment(projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -108,7 +108,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> generateAppointmentQR( Future<void> generateAppointmentQR(
{required String clinicID, required String projectID, required String appointmentNo, required int isFollowUp, Function(dynamic)? onSuccess, Function(String)? onError}) async { {required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp); final result = await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp);
result.fold( result.fold(
@ -126,6 +126,25 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!);
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> createAdvancePayment( Future<void> createAdvancePayment(
{required String paymentMethodName, {required String paymentMethodName,
required int projectID, required int projectID,

@ -18,23 +18,7 @@ class RadiologyRepoImp implements RadiologyRepo {
@override @override
Future<Either<Failure, GenericApiModel<List<PatientRadiologyResponseModel>>>> getPatientRadiologyOrders({required String patientId}) async { Future<Either<Failure, GenericApiModel<List<PatientRadiologyResponseModel>>>> getPatientRadiologyOrders({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": "1018977",
"PatientOutSA": "0",
"SessionID": "03478TYC02N80874CTYN04883475!?"
};
try { try {
GenericApiModel<List<PatientRadiologyResponseModel>>? apiResponse; GenericApiModel<List<PatientRadiologyResponseModel>>? apiResponse;

@ -16,6 +16,7 @@ import 'package:hmg_patient_app_new/presentation/appointments/appointment_paymen
import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_doctor_card.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_doctor_card.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/transitions/fade_page.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -58,7 +59,33 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
AppointmentDoctorCard( AppointmentDoctorCard(
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onAskDoctorTap: () {}, onAskDoctorTap: () {},
onCancelTap: () {}, onCancelTap: () async {
showCommonBottomSheet(context,
child: Utils.getLoadingWidget(),
callBackFunc: (str) {},
title: "",
height: ResponsiveExtension.screenHeight * 0.3,
isCloseButtonVisible: false,
isDismissible: false,
isFullScreen: false);
await myAppointmentsViewModel.cancelAppointment(
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onSuccess: (apiResponse) {
Navigator.of(context).pop();
showCommonBottomSheet(context,
child: Utils.getSuccessWidget(loadingText: "Appointment Cancelled Successfully".needTranslation),
callBackFunc: (str) {
},
title: "",
height: ResponsiveExtension.screenHeight * 0.3,
isCloseButtonVisible: false,
isDismissible: false,
isFullScreen: false,
isSuccessDialog: true);
});
Navigator.of(context).pop();
Navigator.of(context).pop();
},
onRescheduleTap: () {}, onRescheduleTap: () {},
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),

@ -354,8 +354,8 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
print(value); print(value);
await myAppointmentsViewModel.addAdvanceNumberRequest( await myAppointmentsViewModel.addAdvanceNumberRequest(
advanceNumber: Utils.isVidaPlusProject(appState, widget.patientAppointmentHistoryResponseModel.projectID) advanceNumber: Utils.isVidaPlusProject(appState, widget.patientAppointmentHistoryResponseModel.projectID)
? value['data']['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() ? value.data['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: value['data']['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), : value.data['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!, paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(), appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
onSuccess: (value) async { onSuccess: (value) async {
@ -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,

@ -6,6 +6,7 @@ import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/app_state.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/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/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/my_appointments/my_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
@ -59,7 +60,7 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
tabs: [ tabs: [
CustomTabBarModel(null, "All Appt.".needTranslation), CustomTabBarModel(null, "All Appt.".needTranslation),
CustomTabBarModel(null, "Upcoming".needTranslation), CustomTabBarModel(null, "Upcoming".needTranslation),
CustomTabBarModel(null, LocaleKeys.request.tr(context: context)), CustomTabBarModel(null, "Completed".needTranslation),
], ],
onTabChange: (index) { onTabChange: (index) {
print(index); print(index);
@ -74,11 +75,11 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
ListView.separated( ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: myAppointmentsVM.isMyAppointmentsLoading ? 5 : myAppointmentsVM.patientAppointmentsHistoryList.length, itemCount: myAppointmentsVM.isMyAppointmentsLoading ? 5 : myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty ? myAppointmentsVM.patientAppointmentsHistoryList.length : 1,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return myAppointmentsVM.isMyAppointmentsLoading return myAppointmentsVM.isMyAppointmentsLoading
? const MoviesShimmerWidget().paddingSymmetrical(24.h, 0.h) ? const MoviesShimmerWidget().paddingSymmetrical(24.h, 0.h)
: AnimationConfiguration.staggeredList( : myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty ? AnimationConfiguration.staggeredList(
position: index, position: index,
duration: const Duration(milliseconds: 500), duration: const Duration(milliseconds: 500),
child: SlideAnimation( child: SlideAnimation(
@ -96,7 +97,7 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
), ),
), ),
); ) : Utils.getNoDataWidget(context);
}, },
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
), ),

@ -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,78 +125,29 @@ 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(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
widget.patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true), widget.patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true),
SizedBox(height: 8.h), Wrap(
Row( direction: Axis.horizontal,
children: [ spacing: 3.h,
CustomButton( runSpacing: -8.h,
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: [ children: [
CustomButton( AppCustomChipWidget(labelText: widget.patientAppointmentHistoryResponseModel.clinicName!),
AppCustomChipWidget(labelText: widget.patientAppointmentHistoryResponseModel.projectName!),
AppCustomChipWidget(
icon: AppAssets.appointment_calendar_icon, icon: AppAssets.appointment_calendar_icon,
iconColor: AppColors.blackColor, labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)),
iconSize: 12.h, AppCustomChipWidget(
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, icon: AppAssets.appointment_time_icon,
iconColor: AppColors.blackColor, labelText: DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate), false)),
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,
),
], ],
) ),
], ],
), ),
),
], ],
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
@ -205,11 +158,14 @@ class _AppointmentCardState extends State<AppointmentCard> {
child: CustomButton( child: CustomButton(
text: AppointmentType.getNextActionText(widget.patientAppointmentHistoryResponseModel.nextAction), text: AppointmentType.getNextActionText(widget.patientAppointmentHistoryResponseModel.nextAction),
onPressed: () { onPressed: () {
Navigator.of(context).push( Navigator.of(context)
FadePage( .push(FadePage(
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel), page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel),
), ))
); .then((val) {
widget.myAppointmentsViewModel.initAppointmentsViewModel();
widget.myAppointmentsViewModel.getPatientAppointments(true, false);
});
}, },
backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.1), backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.1),
borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01), borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01),

@ -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: [
@ -42,78 +43,31 @@ class AppointmentDoctorCard extends StatelessWidget {
fit: BoxFit.fill, fit: BoxFit.fill,
).circle(100), ).circle(100),
SizedBox(width: 16.h), SizedBox(width: 16.h),
Column( Expanded(
child: Column(
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,
),
],
)
], ],
), ),
),
], ],
), ),
SizedBox(height: 16.h), SizedBox(height: 16.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")
@ -189,6 +189,7 @@ class _SavedLogin extends State<SavedLogin> {
borderColor: AppColors.textColor, borderColor: AppColors.textColor,
textColor: AppColors.textColor, textColor: AppColors.textColor,
icon: AppAssets.whatsapp, icon: AppAssets.whatsapp,
iconColor: null,
), ),
), ),
], ],

@ -287,7 +287,7 @@ class _LandingPageState extends State<LandingPage> {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: LandingPageData.getServiceCardsList.length, itemCount: LandingPageData.getServiceCardsList.length,
shrinkWrap: true, shrinkWrap: true,
padding: const EdgeInsets.only(left: 0, right: 8), padding: EdgeInsets.only(left: 24.h, right: 24.h),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList( return AnimationConfiguration.staggeredList(
position: index, position: index,
@ -305,7 +305,7 @@ class _LandingPageState extends State<LandingPage> {
), ),
); );
}, },
separatorBuilder: (BuildContext cxt, int index) => 0.width, separatorBuilder: (BuildContext cxt, int index) => 8.width,
), ),
), ),
], ],

@ -34,7 +34,7 @@ class LargeServiceCard extends StatelessWidget {
borderRadius: 16, borderRadius: 16,
), ),
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8.h), padding: EdgeInsets.symmetric(horizontal: 0.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -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),

@ -71,8 +71,9 @@ class _SearchLabResultsContentState extends State<SearchLabResultsContent> {
controller: searchEditingController, controller: searchEditingController,
isEnable: true, isEnable: true,
prefix: null, prefix: null,
autoFocus: true, autoFocus: false,
isBorderAllowed: false, isBorderAllowed: false,
keyboardType: TextInputType.text,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: ResponsiveExtension(10).h, vertical: ResponsiveExtension(10).h,
horizontal: ResponsiveExtension(15).h, horizontal: ResponsiveExtension(15).h,

@ -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,

@ -18,7 +18,7 @@ class CustomButton extends StatelessWidget {
final String? fontFamily; final String? fontFamily;
final FontWeight fontWeight; final FontWeight fontWeight;
final bool isDisabled; final bool isDisabled;
final Color iconColor; final Color? iconColor;
final double height; final double height;
final double iconSize; final double iconSize;

@ -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,
),
);
}
}

@ -7,7 +7,14 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
void showCommonBottomSheet(BuildContext context, void showCommonBottomSheet(BuildContext context,
{required Widget child, Function(String?)? callBackFunc, String? title, required double height, bool isCloseButtonVisible = true, bool isFullScreen = true, bool isDismissible = true}) { {required Widget child,
Function(String?)? callBackFunc,
String? title,
required double height,
bool isCloseButtonVisible = true,
bool isFullScreen = true,
bool isDismissible = true,
bool isSuccessDialog = false}) {
showModalBottomSheet<String>( showModalBottomSheet<String>(
sheetAnimationStyle: AnimationStyle( sheetAnimationStyle: AnimationStyle(
duration: Duration(milliseconds: 500), // Custom animation duration duration: Duration(milliseconds: 500), // Custom animation duration
@ -17,7 +24,7 @@ void showCommonBottomSheet(BuildContext context,
isScrollControlled: true, isScrollControlled: true,
showDragHandle: false, showDragHandle: false,
isDismissible: isDismissible, isDismissible: isDismissible,
backgroundColor: AppColors.scaffoldBgColor, backgroundColor: isSuccessDialog ? AppColors.whiteColor : AppColors.scaffoldBgColor,
builder: (BuildContext context) { builder: (BuildContext context) {
return Container( return Container(
height: height, height: height,
@ -30,7 +37,7 @@ void showCommonBottomSheet(BuildContext context,
), ),
); );
}).then((value) { }).then((value) {
if(value != null) { if (value != null) {
callBackFunc!(value); callBackFunc!(value);
} }
}); });
@ -67,13 +74,18 @@ class ButtonSheetContent extends StatelessWidget {
// Close button // Close button
isCloseButtonVisible && isFullScreen isCloseButtonVisible && isFullScreen
? Column(children: [ ? Column(children: [
SizedBox(height: 40.h,), SizedBox(
height: 40.h,
),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 16,), padding: EdgeInsets.symmetric(
horizontal: 16,
),
child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32, height: 32).onPress(() { child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32, height: 32).onPress(() {
Navigator.of(context).pop(); Navigator.of(context).pop();
}), }),
)]) )
])
: SizedBox(), : SizedBox(),
isFullScreen isFullScreen

@ -102,7 +102,7 @@ class _CustomTabBarState extends State<CustomTabBar> {
children: [ children: [
if (tabBar.image != null) Utils.buildSvgWithAssets(icon: tabBar.image!, height: 18, width: 18, iconColor: isSelected ? widget.activeTextColor : widget.inActiveTextColor), if (tabBar.image != null) Utils.buildSvgWithAssets(icon: tabBar.image!, height: 18, width: 18, iconColor: isSelected ? widget.activeTextColor : widget.inActiveTextColor),
tabBar.title tabBar.title
.toText14(weight: isSelected ? FontWeight.w600 : FontWeight.w500, color: isSelected ? widget.activeTextColor : widget.inActiveTextColor, letterSpacing: isSelected ? -0.3 : -0.1), .toText13(weight: isSelected ? FontWeight.w600 : FontWeight.w500, color: isSelected ? widget.activeTextColor : widget.inActiveTextColor, letterSpacing: isSelected ? -0.3 : -0.1),
], ],
)).onPress(() { )).onPress(() {
setState(() { setState(() {

Loading…
Cancel
Save