From 74d08263423ecd794d24204cc58606b8451cec5e Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Mon, 16 Aug 2021 12:10:34 +0300 Subject: [PATCH 1/7] fixed issues --- lib/config/config.dart | 8 +- .../service/ancillary_orders_service.dart | 332 +++++++++--------- .../ancillary_orders_view_model.dart | 6 +- .../ancillary_order_proc_model.dart | 189 +++++----- .../ancillary-orders/ancillaryOrders.dart | 6 +- .../ancillaryOrdersDetails.dart | 12 +- .../blood_pressure/AddBloodPressurePage.dart | 65 ++-- lib/widgets/mobile-no/mobile_no.dart | 3 +- 8 files changed, 320 insertions(+), 301 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3aa66dd1..5c35f5f7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -17,12 +17,12 @@ const BASE_URL = 'https://uat.hmgwebservices.com/'; //const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs -//const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; -//const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // Pharmacy Production URLs -const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart index b9d14a06..da7fc753 100644 --- a/lib/core/service/ancillary_orders_service.dart +++ b/lib/core/service/ancillary_orders_service.dart @@ -20,6 +20,8 @@ class AncillaryOrdersService extends BaseService { _ancillaryLists = []; response['AncillaryOrderList'].forEach((item) { ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); + print("response of ancillary Lists__________"); + print(response); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -27,175 +29,183 @@ class AncillaryOrdersService extends BaseService { }, body: body); } - Future getOrdersDetails(appointmentNo, orderNo) async { + Future getOrdersDetails(appointmentNo, orderNo, projectID) async { Map body = Map(); - + body['AppointmentNo_Vida'] = appointmentNo; + body['OrderNo'] = orderNo; + body['ProjectID'] = projectID; +// "OrderNo=$orderNo&AppointmentNo_Vida=$appointmentNo&ProjectID=$projectID" hasError = false; - await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, onSuccess: (dynamic response, int statusCode) { - _ancillaryProcLists = []; - response['AncillaryOrderProcList'] = [ - { - "AncillaryOrderProcList": [ - { - "ApprovalLineItemNo": 0, - "ApprovalNo": 0, - "ApprovalStatus": "", - "ApprovalStatusID": 0, - "CompanyShare": 501.3, - "CompanyShareWithTax": 576.5, - "CompanyTaxAmount": 75.19, - "DiscountAmount": 55.7, - "DiscountCategory": 1, - "DiscountType": "P", - "DiscountTypeValue": 10, - "IsApprovalCreated": false, - "IsApprovalRequired": false, - "IsCovered": false, - "OrderDate": "/Date(1601758800000+0300)/", - "OrderLineItemNo": 1, - "OrderNo": 2020000001, - "PartnerID": 0, - "PartnerShare": 0, - "PartnerShareType": "P", - "PatientShare": 0, - "PatientShareWithTax": 0, - "PatientTaxAmount": 0, - "ProcPrice": 557, - "ProcedureCategoryID": 2, - "ProcedureCategoryName": "LABORATORY", - "ProcedureID": "02013001", - "ProcedureName": "11-DESOXYCORTISOL (COMPOUND S) - S.O", - "TaxAmount": 75.19, - "TaxPct": 15 - }, - { - "ApprovalLineItemNo": 0, - "ApprovalNo": 0, - "ApprovalStatus": "", - "ApprovalStatusID": 0, - "CompanyShare": 90, - "CompanyShareWithTax": 103.5, - "CompanyTaxAmount": 13.5, - "DiscountAmount": 10, - "DiscountCategory": 1, - "DiscountType": "P", - "DiscountTypeValue": 10, - "IsApprovalCreated": false, - "IsApprovalRequired": true, - "IsCovered": false, - "OrderDate": "/Date(1601758800000+0300)/", - "OrderLineItemNo": 4, - "OrderNo": 2020000001, - "PartnerID": 0, - "PartnerShare": 0, - "PartnerShareType": "P", - "PatientShare": 0, - "PatientShareWithTax": 0, - "PatientTaxAmount": 0, - "ProcPrice": 100, - "ProcedureCategoryID": 2, - "ProcedureCategoryName": "LABORATORY", - "ProcedureID": "02014011", - "ProcedureName": "CBC (COMPLETE BLOOD COUNT PROFILE)", - "TaxAmount": 13.5, - "TaxPct": 15 - }, - { - "ApprovalLineItemNo": 0, - "ApprovalNo": 0, - "ApprovalStatus": "", - "ApprovalStatusID": 0, - "CompanyShare": 347.76, - "CompanyShareWithTax": 399.92, - "CompanyTaxAmount": 52.16, - "DiscountAmount": 38.64, - "DiscountCategory": 1, - "DiscountType": "P", - "DiscountTypeValue": 10, - "IsApprovalCreated": false, - "IsApprovalRequired": false, - "IsCovered": false, - "OrderDate": "/Date(1601758800000+0300)/", - "OrderLineItemNo": 3, - "OrderNo": 2020000001, - "PartnerID": 0, - "PartnerShare": 0, - "PartnerShareType": "P", - "PatientShare": 0, - "PatientShareWithTax": 0, - "PatientTaxAmount": 0, - "ProcPrice": 386.4, - "ProcedureCategoryID": 2, - "ProcedureCategoryName": "LABORATORY", - "ProcedureID": "02019302", - "ProcedureName": "21-HYDROXYLASE ABS - S.O", - "TaxAmount": 52.16, - "TaxPct": 15 - }, - { - "ApprovalLineItemNo": 0, - "ApprovalNo": 0, - "ApprovalStatus": "", - "ApprovalStatusID": 0, - "CompanyShare": 1323, - "CompanyShareWithTax": 1521.45, - "CompanyTaxAmount": 198.45, - "DiscountAmount": 147, - "DiscountCategory": 1, - "DiscountType": "P", - "DiscountTypeValue": 10, - "IsApprovalCreated": false, - "IsApprovalRequired": true, - "IsCovered": false, - "OrderDate": "/Date(1601758800000+0300)/", - "OrderLineItemNo": 5, - "OrderNo": 2020000001, - "PartnerID": 0, - "PartnerShare": 0, - "PartnerShareType": "P", - "PatientShare": 0, - "PatientShareWithTax": 0, - "PatientTaxAmount": 0, - "ProcPrice": 1470, - "ProcedureCategoryID": 3, - "ProcedureCategoryName": "RADIOLOGY", - "ProcedureID": "03033065", - "ProcedureName": "CT SCAN - ABDOMEN (WITH CONTRAST)", - "TaxAmount": 198.45, - "TaxPct": 15 - } - ], - "AppointmentDate": "/Date(1601499600000+0300)/", - "AppointmentNo": 2016053756, - "ClinicID": 1, - "ClinicName": "INTERNAL MEDICINE CLINIC", - "CompanyID": 0, - "CompanyName": "Blood Donation Investigation", - "DoctorID": 1485, - "DoctorName": "ANAS ABDULLAH", - "ErrCode": null, - "GroupID": 2, - "InsurancePolicyNo": "45976500", - "Message": "Success", - "PatientCardID": "232332323", - "PatientID": 3072055, - "PatientName": "MAYA KHALED SADDIQ", - "PatientType": 1, - "PolicyID": 2, - "PolicyName": "Test", - "ProjectID": 15, - "SetupID": "010266", - "StatusCode": 1, - "SubCategoryID": 2, - "SubPolicyNo": "234234" - } - ]; +// _ancillaryProcLists.clear(); + _ancillaryProcLists = []; +// response['AncillaryOrderProcList'] = [ +// { +// "AncillaryOrderProcList": [ +// { +// "ApprovalLineItemNo": 0, +// "ApprovalNo": 0, +// "ApprovalStatus": "", +// "ApprovalStatusID": 0, +// "CompanyShare": 501.3, +// "CompanyShareWithTax": 576.5, +// "CompanyTaxAmount": 75.19, +// "DiscountAmount": 55.7, +// "DiscountCategory": 1, +// "DiscountType": "P", +// "DiscountTypeValue": 10, +// "IsApprovalCreated": false, +// "IsApprovalRequired": false, +// "IsCovered": false, +// "OrderDate": "/Date(1601758800000+0300)/", +// "OrderLineItemNo": 1, +// "OrderNo": 2020000001, +// "PartnerID": 0, +// "PartnerShare": 0, +// "PartnerShareType": "P", +// "PatientShare": 0, +// "PatientShareWithTax": 0, +// "PatientTaxAmount": 0, +// "ProcPrice": 557, +// "ProcedureCategoryID": 2, +// "ProcedureCategoryName": "LABORATORY", +// "ProcedureID": "02013001", +// "ProcedureName": "11-DESOXYCORTISOL (COMPOUND S) - S.O", +// "TaxAmount": 75.19, +// "TaxPct": 15 +// }, +// { +// "ApprovalLineItemNo": 0, +// "ApprovalNo": 0, +// "ApprovalStatus": "", +// "ApprovalStatusID": 0, +// "CompanyShare": 90, +// "CompanyShareWithTax": 103.5, +// "CompanyTaxAmount": 13.5, +// "DiscountAmount": 10, +// "DiscountCategory": 1, +// "DiscountType": "P", +// "DiscountTypeValue": 10, +// "IsApprovalCreated": false, +// "IsApprovalRequired": true, +// "IsCovered": false, +// "OrderDate": "/Date(1601758800000+0300)/", +// "OrderLineItemNo": 4, +// "OrderNo": 2020000001, +// "PartnerID": 0, +// "PartnerShare": 0, +// "PartnerShareType": "P", +// "PatientShare": 0, +// "PatientShareWithTax": 0, +// "PatientTaxAmount": 0, +// "ProcPrice": 100, +// "ProcedureCategoryID": 2, +// "ProcedureCategoryName": "LABORATORY", +// "ProcedureID": "02014011", +// "ProcedureName": "CBC (COMPLETE BLOOD COUNT PROFILE)", +// "TaxAmount": 13.5, +// "TaxPct": 15 +// }, +// { +// "ApprovalLineItemNo": 0, +// "ApprovalNo": 0, +// "ApprovalStatus": "", +// "ApprovalStatusID": 0, +// "CompanyShare": 347.76, +// "CompanyShareWithTax": 399.92, +// "CompanyTaxAmount": 52.16, +// "DiscountAmount": 38.64, +// "DiscountCategory": 1, +// "DiscountType": "P", +// "DiscountTypeValue": 10, +// "IsApprovalCreated": false, +// "IsApprovalRequired": false, +// "IsCovered": false, +// "OrderDate": "/Date(1601758800000+0300)/", +// "OrderLineItemNo": 3, +// "OrderNo": 2020000001, +// "PartnerID": 0, +// "PartnerShare": 0, +// "PartnerShareType": "P", +// "PatientShare": 0, +// "PatientShareWithTax": 0, +// "PatientTaxAmount": 0, +// "ProcPrice": 386.4, +// "ProcedureCategoryID": 2, +// "ProcedureCategoryName": "LABORATORY", +// "ProcedureID": "02019302", +// "ProcedureName": "21-HYDROXYLASE ABS - S.O", +// "TaxAmount": 52.16, +// "TaxPct": 15 +// }, +// { +// "ApprovalLineItemNo": 0, +// "ApprovalNo": 0, +// "ApprovalStatus": "", +// "ApprovalStatusID": 0, +// "CompanyShare": 1323, +// "CompanyShareWithTax": 1521.45, +// "CompanyTaxAmount": 198.45, +// "DiscountAmount": 147, +// "DiscountCategory": 1, +// "DiscountType": "P", +// "DiscountTypeValue": 10, +// "IsApprovalCreated": false, +// "IsApprovalRequired": true, +// "IsCovered": false, +// "OrderDate": "/Date(1601758800000+0300)/", +// "OrderLineItemNo": 5, +// "OrderNo": 2020000001, +// "PartnerID": 0, +// "PartnerShare": 0, +// "PartnerShareType": "P", +// "PatientShare": 0, +// "PatientShareWithTax": 0, +// "PatientTaxAmount": 0, +// "ProcPrice": 1470, +// "ProcedureCategoryID": 3, +// "ProcedureCategoryName": "RADIOLOGY", +// "ProcedureID": "03033065", +// "ProcedureName": "CT SCAN - ABDOMEN (WITH CONTRAST)", +// "TaxAmount": 198.45, +// "TaxPct": 15 +// } +// ], +// "AppointmentDate": "/Date(1601499600000+0300)/", +// "AppointmentNo": 2016053756, +// "ClinicID": 1, +// "ClinicName": "INTERNAL MEDICINE CLINIC", +// "CompanyID": 0, +// "CompanyName": "Blood Donation Investigation", +// "DoctorID": 1485, +// "DoctorName": "ANAS ABDULLAH", +// "ErrCode": null, +// "GroupID": 2, +// "InsurancePolicyNo": "45976500", +// "Message": "Success", +// "PatientCardID": "232332323", +// "PatientID": 3072055, +// "PatientName": "MAYA KHALED SADDIQ", +// "PatientType": 1, +// "PolicyID": 2, +// "PolicyName": "Test", +// "ProjectID": 15, +// "SetupID": "010266", +// "StatusCode": 1, +// "SubCategoryID": 2, +// "SubPolicyNo": "234234" +// } +// ]; response['AncillaryOrderProcList'].forEach((item) { ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item)); +// ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(response['AncillaryOrderProcList'])); + print("----------------------------------"); + print("Test data"); + print(response); }); + //Future.value(_ancillaryProcLists); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/ancillary_orders_view_model.dart b/lib/core/viewModels/ancillary_orders_view_model.dart index 77eb4237..4a140004 100644 --- a/lib/core/viewModels/ancillary_orders_view_model.dart +++ b/lib/core/viewModels/ancillary_orders_view_model.dart @@ -12,8 +12,10 @@ class AnciallryOrdersViewModel extends BaseViewModel { AncillaryOrdersService _ancillaryService = locator(); List get ancillaryLists => _ancillaryService.ancillaryLists; + List get ancillaryListsDetails => _ancillaryService.ancillaryProcLists; + Future getOrders() async { hasError = false; setState(ViewState.Busy); @@ -25,10 +27,10 @@ class AnciallryOrdersViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getOrdersDetails(appointmentNo, orderNo) async { + Future getOrdersDetails(appointmentNo, orderNo, projectID) async { hasError = false; setState(ViewState.Busy); - await _ancillaryService.getOrdersDetails(appointmentNo, orderNo); + await _ancillaryService.getOrdersDetails(appointmentNo, orderNo, projectID ); if (_ancillaryService.hasError) { error = _ancillaryService.error; setState(ViewState.ErrorLocal); diff --git a/lib/models/anicllary-orders/ancillary_order_proc_model.dart b/lib/models/anicllary-orders/ancillary_order_proc_model.dart index 7322d11a..1b557f21 100644 --- a/lib/models/anicllary-orders/ancillary_order_proc_model.dart +++ b/lib/models/anicllary-orders/ancillary_order_proc_model.dart @@ -1,60 +1,61 @@ class AncillaryOrdersListProcListModel { - List ancillaryOrderProcList; + List ancillaryOrderProcDetailsList; String appointmentDate; - dynamic appointmentNo; - dynamic clinicID; + int appointmentNo; + int clinicID; String clinicName; - dynamic companyID; + int companyID; String companyName; - dynamic doctorID; + int doctorID; String doctorName; Null errCode; - dynamic groupID; + int groupID; String insurancePolicyNo; String message; String patientCardID; - dynamic patientID; + int patientID; String patientName; - dynamic patientType; - dynamic policyID; + int patientType; + int policyID; String policyName; - dynamic projectID; + int projectID; String setupID; - dynamic statusCode; - dynamic subCategoryID; + int statusCode; + int subCategoryID; String subPolicyNo; AncillaryOrdersListProcListModel( - {this.ancillaryOrderProcList, - this.appointmentDate, - this.appointmentNo, - this.clinicID, - this.clinicName, - this.companyID, - this.companyName, - this.doctorID, - this.doctorName, - this.errCode, - this.groupID, - this.insurancePolicyNo, - this.message, - this.patientCardID, - this.patientID, - this.patientName, - this.patientType, - this.policyID, - this.policyName, - this.projectID, - this.setupID, - this.statusCode, - this.subCategoryID, - this.subPolicyNo}); + {this.ancillaryOrderProcDetailsList, + this.appointmentDate, + this.appointmentNo, + this.clinicID, + this.clinicName, + this.companyID, + this.companyName, + this.doctorID, + this.doctorName, + this.errCode, + this.groupID, + this.insurancePolicyNo, + this.message, + this.patientCardID, + this.patientID, + this.patientName, + this.patientType, + this.policyID, + this.policyName, + this.projectID, + this.setupID, + this.statusCode, + this.subCategoryID, + this.subPolicyNo}); AncillaryOrdersListProcListModel.fromJson(Map json) { - if (json['AncillaryOrderProcList'] != null) { - ancillaryOrderProcList = new List(); - json['AncillaryOrderProcList'].forEach((v) { - ancillaryOrderProcList.add(new AncillaryOrderProcList.fromJson(v)); + if (json['AncillaryOrderProcDetailsList'] != null) { + ancillaryOrderProcDetailsList = new List(); + json['AncillaryOrderProcDetailsList'].forEach((v) { + ancillaryOrderProcDetailsList + .add(new AncillaryOrderProcDetailsList.fromJson(v)); }); } appointmentDate = json['AppointmentDate']; @@ -84,9 +85,9 @@ class AncillaryOrdersListProcListModel { Map toJson() { final Map data = new Map(); - if (this.ancillaryOrderProcList != null) { - data['AncillaryOrderProcList'] = - this.ancillaryOrderProcList.map((v) => v.toJson()).toList(); + if (this.ancillaryOrderProcDetailsList != null) { + data['AncillaryOrderProcDetailsList'] = + this.ancillaryOrderProcDetailsList.map((v) => v.toJson()).toList(); } data['AppointmentDate'] = this.appointmentDate; data['AppointmentNo'] = this.appointmentNo; @@ -115,71 +116,71 @@ class AncillaryOrdersListProcListModel { } } -class AncillaryOrderProcList { - dynamic approvalLineItemNo; - dynamic approvalNo; +class AncillaryOrderProcDetailsList { + int approvalLineItemNo; + int approvalNo; String approvalStatus; - dynamic approvalStatusID; - dynamic companyShare; - dynamic companyShareWithTax; - dynamic companyTaxAmount; - dynamic discountAmount; - dynamic discountCategory; + int approvalStatusID; + int companyShare; + int companyShareWithTax; + int companyTaxAmount; + int discountAmount; + int discountCategory; String discountType; - dynamic discountTypeValue; + int discountTypeValue; bool isApprovalCreated; bool isApprovalRequired; bool isCovered; String orderDate; - dynamic orderLineItemNo; - dynamic orderNo; - dynamic partnerID; - dynamic partnerShare; + int orderLineItemNo; + int orderNo; + int partnerID; + int partnerShare; String partnerShareType; - dynamic patientShare; - dynamic patientShareWithTax; - dynamic patientTaxAmount; - dynamic procPrice; - dynamic procedureCategoryID; + int patientShare; + double patientShareWithTax; + double patientTaxAmount; + int procPrice; + int procedureCategoryID; String procedureCategoryName; String procedureID; String procedureName; dynamic taxAmount; - dynamic taxPct; + int taxPct; - AncillaryOrderProcList( + AncillaryOrderProcDetailsList( {this.approvalLineItemNo, - this.approvalNo, - this.approvalStatus, - this.approvalStatusID, - this.companyShare, - this.companyShareWithTax, - this.companyTaxAmount, - this.discountAmount, - this.discountCategory, - this.discountType, - this.discountTypeValue, - this.isApprovalCreated, - this.isApprovalRequired, - this.isCovered, - this.orderDate, - this.orderLineItemNo, - this.orderNo, - this.partnerID, - this.partnerShare, - this.partnerShareType, - this.patientShare, - this.patientShareWithTax, - this.patientTaxAmount, - this.procPrice, - this.procedureCategoryID, - this.procedureCategoryName, - this.procedureID, - this.procedureName, - this.taxAmount, - this.taxPct}); + this.approvalNo, + this.approvalStatus, + this.approvalStatusID, + this.companyShare, + this.companyShareWithTax, + this.companyTaxAmount, + this.discountAmount, + this.discountCategory, + this.discountType, + this.discountTypeValue, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.orderDate, + this.orderLineItemNo, + this.orderNo, + this.partnerID, + this.partnerShare, + this.partnerShareType, + this.patientShare, + this.patientShareWithTax, + this.patientTaxAmount, + this.procPrice, + this.procedureCategoryID, + this.procedureCategoryName, + this.procedureID, + this.procedureName, + this.taxAmount, + this.taxPct}); - AncillaryOrderProcList.fromJson(Map json) { + AncillaryOrderProcDetailsList.fromJson(Map json) { approvalLineItemNo = json['ApprovalLineItemNo']; approvalNo = json['ApprovalNo']; approvalStatus = json['ApprovalStatus']; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart index eccc1309..4cb2b658 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart @@ -95,7 +95,7 @@ class _AnicllaryOrdersState extends State .map( (item) => InkWell( onTap: () { - ancillaryOrdersDetails(item); + ancillaryOrdersDetails(item, model.ancillaryLists[0].projectID); }, child: Container( decoration: BoxDecoration( @@ -166,11 +166,11 @@ class _AnicllaryOrdersState extends State .toList()); } - ancillaryOrdersDetails(item) { + ancillaryOrdersDetails(item, projectId) { Navigator.push( context, FadePage( - page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo), + page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo,projectId ), ), ); } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 20d2966b..535ecb38 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -12,7 +12,9 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; class AnicllaryOrdersDetails extends StatefulWidget { final dynamic appoNo; final dynamic orderNo; - AnicllaryOrdersDetails(this.appoNo, this.orderNo); + final dynamic projectID; + + AnicllaryOrdersDetails(this.appoNo, this.orderNo, this.projectID); @override _AnicllaryOrdersState createState() => _AnicllaryOrdersState(); } @@ -31,7 +33,7 @@ class _AnicllaryOrdersState extends State Widget build(BuildContext context) { return BaseView( onModelReady: (model) => - model.getOrdersDetails(widget.appoNo, widget.orderNo), + model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, baseViewModel: model, @@ -89,7 +91,7 @@ class _AnicllaryOrdersState extends State fontSize: 20, ), Texts( - model.ancillaryListsDetails[0].patientID.toString(), + model.ancillaryLists[0].patientID.toString(), ) ], ), @@ -212,7 +214,7 @@ class _AnicllaryOrdersState extends State } Widget getAncillaryDetails(model) { - Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcList, + Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName); print(newMap); @@ -247,7 +249,7 @@ class _AnicllaryOrdersState extends State String getTotalValue(value) { double total = 0.0; - value.ancillaryListsDetails[0].ancillaryOrderProcList + value.ancillaryListsDetails[0].ancillaryOrderProcDetailsList .forEach((result) => {total += result.companyShareWithTax}); return total.toStringAsFixed(2); } diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index 1b8f70e3..786ed458 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -144,7 +144,7 @@ class _AddBloodPressurePageState extends State { ), InkWell( onTap: () { - confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList); + confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); }, child: Container( padding: EdgeInsets.all(12), @@ -229,38 +229,41 @@ class _AddBloodPressurePageState extends State { widthFactor: 0.9, child: Column( children: [ - SecondaryButton( - loading: widget.model.state == ViewState.BusyLocal, - label: TranslationBase.of(context).save.toUpperCase(), - textColor: Colors.white, - color: isButtonDisabled ? Colors.grey[900] : Colors.grey, - onTap: () async { - if (_bloodSystolicValueController.text.isNotEmpty && - _bloodDiastolicValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); + Container( + height: 50, + child: SecondaryButton( + loading: widget.model.state == ViewState.BusyLocal, + label: TranslationBase.of(context).save.toUpperCase(), + textColor: Colors.white, + color: isButtonDisabled ? Colors.grey[900] : Colors.grey, + onTap: () async { + if (_bloodSystolicValueController.text.isNotEmpty && + _bloodDiastolicValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); - widget.model - .addORUpdateDiabtecResult( - isUpdate: widget.isUpdate, - bloodPressureDate: - '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - diastolicPressure: _bloodDiastolicValueController.text.toString(), - systolicePressure: _bloodSystolicValueController.text.toString(), - measuredArm: measuredArm, - ) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.BusyLocal) + widget.model + .addORUpdateDiabtecResult( + isUpdate: widget.isUpdate, + bloodPressureDate: + '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), + measuredArm: measuredArm, + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.BusyLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + ; + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - ; - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: widget.model.error); - }); - } - }), + }); + } + }), + ), ], ), ), diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index 44162743..f449cdb8 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -128,7 +128,8 @@ class _MobileNo extends State { controller: widget.controller, keyboardType: TextInputType.number, maxLength: 10, - inputFormatters: [ + inputFormatters: + [ FilteringTextInputFormatter.allow(RegExp("[0-9]")), ], // maxLengthEnforced: true, From 34ccb132dc04a0dd6d402fbccefedf8ab3034d0a Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Tue, 17 Aug 2021 11:41:01 +0300 Subject: [PATCH 2/7] fixed issues --- lib/config/localized_values.dart | 1 + .../service/ancillary_orders_service.dart | 158 ------------------ .../ancillary_order_proc_model.dart | 38 ++--- .../ancillaryOrdersDetails.dart | 62 ++++++- .../ancillary-orders/ordersPayment.dart | 20 +++ lib/uitl/translations_delegate_base.dart | 1 + 6 files changed, 96 insertions(+), 184 deletions(-) create mode 100644 lib/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e45af168..e23a27bf 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1178,6 +1178,7 @@ const Map localizedValues = { }, "offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"}, "InvoiceNo": {"en": "Invoice No", "ar": "رقم الفاتورة"}, + "InvoiceDate": {"en": "Invoice Date", "ar": "تاريخ الفاتورة"}, "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart index da7fc753..8d9d3b31 100644 --- a/lib/core/service/ancillary_orders_service.dart +++ b/lib/core/service/ancillary_orders_service.dart @@ -38,165 +38,7 @@ class AncillaryOrdersService extends BaseService { hasError = false; await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, onSuccess: (dynamic response, int statusCode) { -// _ancillaryProcLists.clear(); _ancillaryProcLists = []; -// response['AncillaryOrderProcList'] = [ -// { -// "AncillaryOrderProcList": [ -// { -// "ApprovalLineItemNo": 0, -// "ApprovalNo": 0, -// "ApprovalStatus": "", -// "ApprovalStatusID": 0, -// "CompanyShare": 501.3, -// "CompanyShareWithTax": 576.5, -// "CompanyTaxAmount": 75.19, -// "DiscountAmount": 55.7, -// "DiscountCategory": 1, -// "DiscountType": "P", -// "DiscountTypeValue": 10, -// "IsApprovalCreated": false, -// "IsApprovalRequired": false, -// "IsCovered": false, -// "OrderDate": "/Date(1601758800000+0300)/", -// "OrderLineItemNo": 1, -// "OrderNo": 2020000001, -// "PartnerID": 0, -// "PartnerShare": 0, -// "PartnerShareType": "P", -// "PatientShare": 0, -// "PatientShareWithTax": 0, -// "PatientTaxAmount": 0, -// "ProcPrice": 557, -// "ProcedureCategoryID": 2, -// "ProcedureCategoryName": "LABORATORY", -// "ProcedureID": "02013001", -// "ProcedureName": "11-DESOXYCORTISOL (COMPOUND S) - S.O", -// "TaxAmount": 75.19, -// "TaxPct": 15 -// }, -// { -// "ApprovalLineItemNo": 0, -// "ApprovalNo": 0, -// "ApprovalStatus": "", -// "ApprovalStatusID": 0, -// "CompanyShare": 90, -// "CompanyShareWithTax": 103.5, -// "CompanyTaxAmount": 13.5, -// "DiscountAmount": 10, -// "DiscountCategory": 1, -// "DiscountType": "P", -// "DiscountTypeValue": 10, -// "IsApprovalCreated": false, -// "IsApprovalRequired": true, -// "IsCovered": false, -// "OrderDate": "/Date(1601758800000+0300)/", -// "OrderLineItemNo": 4, -// "OrderNo": 2020000001, -// "PartnerID": 0, -// "PartnerShare": 0, -// "PartnerShareType": "P", -// "PatientShare": 0, -// "PatientShareWithTax": 0, -// "PatientTaxAmount": 0, -// "ProcPrice": 100, -// "ProcedureCategoryID": 2, -// "ProcedureCategoryName": "LABORATORY", -// "ProcedureID": "02014011", -// "ProcedureName": "CBC (COMPLETE BLOOD COUNT PROFILE)", -// "TaxAmount": 13.5, -// "TaxPct": 15 -// }, -// { -// "ApprovalLineItemNo": 0, -// "ApprovalNo": 0, -// "ApprovalStatus": "", -// "ApprovalStatusID": 0, -// "CompanyShare": 347.76, -// "CompanyShareWithTax": 399.92, -// "CompanyTaxAmount": 52.16, -// "DiscountAmount": 38.64, -// "DiscountCategory": 1, -// "DiscountType": "P", -// "DiscountTypeValue": 10, -// "IsApprovalCreated": false, -// "IsApprovalRequired": false, -// "IsCovered": false, -// "OrderDate": "/Date(1601758800000+0300)/", -// "OrderLineItemNo": 3, -// "OrderNo": 2020000001, -// "PartnerID": 0, -// "PartnerShare": 0, -// "PartnerShareType": "P", -// "PatientShare": 0, -// "PatientShareWithTax": 0, -// "PatientTaxAmount": 0, -// "ProcPrice": 386.4, -// "ProcedureCategoryID": 2, -// "ProcedureCategoryName": "LABORATORY", -// "ProcedureID": "02019302", -// "ProcedureName": "21-HYDROXYLASE ABS - S.O", -// "TaxAmount": 52.16, -// "TaxPct": 15 -// }, -// { -// "ApprovalLineItemNo": 0, -// "ApprovalNo": 0, -// "ApprovalStatus": "", -// "ApprovalStatusID": 0, -// "CompanyShare": 1323, -// "CompanyShareWithTax": 1521.45, -// "CompanyTaxAmount": 198.45, -// "DiscountAmount": 147, -// "DiscountCategory": 1, -// "DiscountType": "P", -// "DiscountTypeValue": 10, -// "IsApprovalCreated": false, -// "IsApprovalRequired": true, -// "IsCovered": false, -// "OrderDate": "/Date(1601758800000+0300)/", -// "OrderLineItemNo": 5, -// "OrderNo": 2020000001, -// "PartnerID": 0, -// "PartnerShare": 0, -// "PartnerShareType": "P", -// "PatientShare": 0, -// "PatientShareWithTax": 0, -// "PatientTaxAmount": 0, -// "ProcPrice": 1470, -// "ProcedureCategoryID": 3, -// "ProcedureCategoryName": "RADIOLOGY", -// "ProcedureID": "03033065", -// "ProcedureName": "CT SCAN - ABDOMEN (WITH CONTRAST)", -// "TaxAmount": 198.45, -// "TaxPct": 15 -// } -// ], -// "AppointmentDate": "/Date(1601499600000+0300)/", -// "AppointmentNo": 2016053756, -// "ClinicID": 1, -// "ClinicName": "INTERNAL MEDICINE CLINIC", -// "CompanyID": 0, -// "CompanyName": "Blood Donation Investigation", -// "DoctorID": 1485, -// "DoctorName": "ANAS ABDULLAH", -// "ErrCode": null, -// "GroupID": 2, -// "InsurancePolicyNo": "45976500", -// "Message": "Success", -// "PatientCardID": "232332323", -// "PatientID": 3072055, -// "PatientName": "MAYA KHALED SADDIQ", -// "PatientType": 1, -// "PolicyID": 2, -// "PolicyName": "Test", -// "ProjectID": 15, -// "SetupID": "010266", -// "StatusCode": 1, -// "SubCategoryID": 2, -// "SubPolicyNo": "234234" -// } -// ]; response['AncillaryOrderProcList'].forEach((item) { ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item)); diff --git a/lib/models/anicllary-orders/ancillary_order_proc_model.dart b/lib/models/anicllary-orders/ancillary_order_proc_model.dart index 1b557f21..5524f58a 100644 --- a/lib/models/anicllary-orders/ancillary_order_proc_model.dart +++ b/lib/models/anicllary-orders/ancillary_order_proc_model.dart @@ -117,36 +117,36 @@ class AncillaryOrdersListProcListModel { } class AncillaryOrderProcDetailsList { - int approvalLineItemNo; - int approvalNo; + dynamic approvalLineItemNo; + dynamic approvalNo; String approvalStatus; - int approvalStatusID; - int companyShare; - int companyShareWithTax; - int companyTaxAmount; - int discountAmount; - int discountCategory; + dynamic approvalStatusID; + dynamic companyShare; + dynamic companyShareWithTax; + dynamic companyTaxAmount; + dynamic discountAmount; + dynamic discountCategory; String discountType; - int discountTypeValue; + dynamic discountTypeValue; bool isApprovalCreated; bool isApprovalRequired; bool isCovered; String orderDate; - int orderLineItemNo; - int orderNo; - int partnerID; - int partnerShare; + dynamic orderLineItemNo; + dynamic orderNo; + dynamic partnerID; + dynamic partnerShare; String partnerShareType; - int patientShare; - double patientShareWithTax; - double patientTaxAmount; - int procPrice; - int procedureCategoryID; + dynamic patientShare; + dynamic patientShareWithTax; + dynamic patientTaxAmount; + dynamic procPrice; + dynamic procedureCategoryID; String procedureCategoryName; String procedureID; String procedureName; dynamic taxAmount; - int taxPct; + dynamic taxPct; AncillaryOrderProcDetailsList( {this.approvalLineItemNo, diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 535ecb38..6f3ef552 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -8,6 +8,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.dart'; class AnicllaryOrdersDetails extends StatefulWidget { final dynamic appoNo; @@ -66,7 +68,12 @@ class _AnicllaryOrdersState extends State children: [ Button( label: TranslationBase.of(context).payNow, - onTap: () {}, + backgroundColor: Colors.red[800], + onTap: () { + Navigator.push(context, + FadePage(page: OrdersPayment(), + ),); + }, ) ], ) @@ -128,7 +135,8 @@ class _AnicllaryOrdersState extends State children: [ Texts( TranslationBase.of(context).invoiceNo, - fontWeight: FontWeight.bold, +// fontWeight: FontWeight.bold, + color: Colors.red[500], ), Texts(" : "), Texts( @@ -139,8 +147,9 @@ class _AnicllaryOrdersState extends State Row( children: [ Texts( - TranslationBase.of(context).date, - fontWeight: FontWeight.bold, + TranslationBase.of(context).invoiceDate, +// fontWeight: FontWeight.bold, + color: Colors.red[500], ), Texts(" : "), Texts( @@ -154,8 +163,9 @@ class _AnicllaryOrdersState extends State Row( children: [ Texts( - TranslationBase.of(context).date, - fontWeight: FontWeight.bold, + TranslationBase.of(context).doctorName, +// fontWeight: FontWeight.bold, + color: Colors.red[500], ), Texts(" : "), Texts( @@ -208,7 +218,43 @@ class _AnicllaryOrdersState extends State Divider( color: Colors.red[800], thickness: 3, - ) + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + children: [ + + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + + children: [ + Texts( + TranslationBase.of(context).price, + color: Colors.grey[500], + fontSize: 14, + ), + SizedBox(width: 15), + Texts( + TranslationBase.of(context).vat, + color: Colors.grey[500], + fontSize: 14, + ), + SizedBox(width: 15), + Texts( + TranslationBase.of(context).total, + color: Colors.grey[500], + fontSize: 14, + ), + ] ), + ], + ), + Divider( + color: Colors.black26, + ), + ], )); } @@ -279,4 +325,6 @@ class _AnicllaryOrdersState extends State }).toList(), ); } + + } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.dart new file mode 100644 index 00000000..fee4ff40 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.dart @@ -0,0 +1,20 @@ +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; + +class OrdersPayment extends StatefulWidget { + @override + _OrdersPaymentState createState() => _OrdersPaymentState(); +} + +class _OrdersPaymentState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 795e9228..0655ce25 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1061,6 +1061,7 @@ class TranslationBase { localizedValues['offerAndPackages'][locale.languageCode]; String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; + String get invoiceDate => localizedValues['InvoiceNo'][locale.languageCode]; String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; String get generalResult => From 864f849425246413b39b3d90ba704e4ed6b30310 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 17 Aug 2021 12:10:10 +0300 Subject: [PATCH 3/7] Baby age in ovulation period --- .../ovulation_period/ovulation_period.dart | 62 ++++++++++--------- .../ovulation_result_page.dart | 2 +- .../AlHabibMedicalService/parking_page.dart | 44 ++++++------- 3 files changed, 57 insertions(+), 51 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart index b05637bc..a6708855 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart @@ -19,6 +19,7 @@ class OvulationPeriod extends StatefulWidget { class _OvulationPeriodState extends State { DateTime bloodSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now(); + DateTime selectedDateTime = DateTime.now(); int cycleLength = 0; int lutealPhaseLength = 0; String selectedDate; @@ -37,13 +38,30 @@ class _OvulationPeriodState extends State { } String getDate() { - return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + return "${DateUtil.getMonth(selectedDateTime.month)} ${selectedDateTime.day}, ${selectedDateTime.year}"; } // void calculate() {} // // void calculateFertility(DateTime selectedDate) {const diff = Date.} + calculateBabyInformation() { + setState(() { + bloodSugarDate = selectedDateTime; + dateFrom = selectedDateTime.add(Duration(days: 10)); + updatedDt = DateFormat.yMMMEd().format(dateFrom); + dateTo = selectedDateTime.add(Duration(days: 20)); + conceivedDate = selectedDateTime.add(Duration(days: 14)); + deliveryDue = selectedDateTime.add(Duration(days: 280)); + + // babyAge = Jiffy([DateTime.now()]).diff(Jiffy([date]), Units.WEEK); + babyAgeWeeks = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day]) + .diff(Jiffy([selectedDateTime.year, selectedDateTime.month, dateTo.day]), Units.WEEK); + babyAgeDays = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day]) + .diff(Jiffy([selectedDateTime.year, selectedDateTime.month, dateTo.day]), Units.DAY); + }); + } + @override Widget build(BuildContext context) { return AppScaffold( @@ -78,18 +96,7 @@ class _OvulationPeriodState extends State { onConfirm: (date) { print('confirm $date'); setState(() { - bloodSugarDate = date; - dateFrom = date.add(Duration(days: 10)); - updatedDt = DateFormat.yMMMEd().format(dateFrom); - dateTo = date.add(Duration(days: 20)); - conceivedDate = date.add(Duration(days: 14)); - deliveryDue = date.add(Duration(days: 280)); - - // babyAge = Jiffy([DateTime.now()]).diff(Jiffy([date]), Units.WEEK); - babyAgeWeeks = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day]) - .diff(Jiffy([date.year, date.month, dateTo.day]), Units.WEEK); - babyAgeDays = Jiffy([DateTime.now().year, DateTime.now().month, DateTime.now().day]) - .diff(Jiffy([date.year, date.month, dateTo.day]), Units.DAY); + selectedDateTime = date; }); }, currentTime: DateTime.now(), @@ -321,22 +328,19 @@ class _OvulationPeriodState extends State { child: SecondaryButton( label: 'CALCULATE', onTap: () { - setState(() { - { - Navigator.push( - context, - FadePage( - page: OvulationResult( - conceivedDate: conceivedDate, - dateFrom: dateFrom, - dateTo: dateTo, - deliveryDue: deliveryDue, - babyAge: babyAgeWeeks, - babyAgeDays: babyAgeDays, - )), - ); - } - }); + calculateBabyInformation(); + Navigator.push( + context, + FadePage( + page: OvulationResult( + conceivedDate: conceivedDate, + dateFrom: dateFrom, + dateTo: dateTo, + deliveryDue: deliveryDue, + babyAge: babyAgeWeeks, + babyAgeDays: babyAgeDays, + )), + ); }, ), ), diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart index 855e5af7..53ccb664 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart @@ -78,7 +78,7 @@ class OvulationResult extends StatelessWidget { fontWeight: FontWeight.w400, ), Texts( - babyAge.toString() + " Weeks," + "2", + babyAge <= 0 ? "baby age is not available" : babyAge.toString() + " Weeks," + "3", fontWeight: FontWeight.w800, fontSize: 21.0, ), diff --git a/lib/pages/AlHabibMedicalService/parking_page.dart b/lib/pages/AlHabibMedicalService/parking_page.dart index 19f06a56..f3620917 100644 --- a/lib/pages/AlHabibMedicalService/parking_page.dart +++ b/lib/pages/AlHabibMedicalService/parking_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/qr_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -9,11 +10,13 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:provider/provider.dart'; import '../../d_q_icons_icons.dart'; class ParkingPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getIsSaveParking(), builder: (_, model, widget) => AppScaffold( @@ -21,10 +24,7 @@ class ParkingPage extends StatelessWidget { appBarTitle: TranslationBase.of(context).parking, description: TranslationBase.of(context).parkingDescription, imagesInfo: [ - ImagesInfo( - imageAr: 'assets/images/bc_parking.png', - imageEn: 'assets/images/bc_parking.png', - isAsset: true) + ImagesInfo(imageAr: 'assets/images/bc_parking.png', imageEn: 'assets/images/bc_parking.png', isAsset: true) ], body: SingleChildScrollView( padding: EdgeInsets.all(12), @@ -50,7 +50,9 @@ class ParkingPage extends StatelessWidget { Row( children: [ Expanded( - child: Container(child: Icon(/*Icons.landscape*/DQIcons.parking_icon,size: 130),), + child: Container( + child: Icon(/*Icons.landscape*/ DQIcons.parking_icon, size: 130), + ), ), SizedBox( width: 15, @@ -85,15 +87,15 @@ class ParkingPage extends StatelessWidget { padding: EdgeInsets.all(8), width: double.infinity, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - shape: BoxShape.rectangle), + borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), height: 70, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).showMyPark), - Texts(model.qrParkingModel.floorDescriptionN), + Texts(projectViewModel.isArabic + ? model.qrParkingModel.floorDescriptionN + : model.qrParkingModel.floorDescription), ], ), ), @@ -102,9 +104,7 @@ class ParkingPage extends StatelessWidget { ), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - shape: BoxShape.rectangle), + borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), padding: EdgeInsets.all(8), width: double.infinity, height: 70, @@ -112,7 +112,9 @@ class ParkingPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).gate), - Texts(model.qrParkingModel.gateDescriptionN), + Texts(projectViewModel.isArabic + ? model.qrParkingModel.gateDescriptionN + : model.qrParkingModel.gateDescription), ], ), ), @@ -121,9 +123,7 @@ class ParkingPage extends StatelessWidget { ), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - shape: BoxShape.rectangle), + borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), padding: EdgeInsets.all(8), width: double.infinity, height: 70, @@ -131,7 +131,9 @@ class ParkingPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).building), - Texts(model.qrParkingModel.buildingDescriptionN), + Texts(projectViewModel.isArabic + ? model.qrParkingModel.buildingDescriptionN + : model.qrParkingModel.buildingDescription), ], ), ), @@ -141,16 +143,16 @@ class ParkingPage extends StatelessWidget { Container( padding: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - shape: BoxShape.rectangle), + borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle), width: double.infinity, height: 70, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).branch), - Texts(model.qrParkingModel.branchDescriptionN), + Texts(projectViewModel.isArabic + ? model.qrParkingModel.branchDescriptionN + : model.qrParkingModel.branchDescription), ], ), ), From fe83b91602dae19d5d98d192ef4e1aaab18a6077 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 17 Aug 2021 14:58:10 +0300 Subject: [PATCH 4/7] body fat texfield fix --- .../health_calculator/body_fat/body_fat.dart | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart index 7f0d0c5c..44a3dc9e 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -50,6 +50,15 @@ class _BodyFatState extends State { TextEditingController waistController = TextEditingController(); TextEditingController hipController = TextEditingController(); + @override + void initState() { + neckController.text = neck.toString(); + hipController.text = hip.toString(); + waistController.text = waist.toString(); + heightController.text = heightCm.toString(); + super.initState(); + } + void updateColorHeight(int type) { //MG/DLT card if (type == 1) { @@ -319,11 +328,6 @@ class _BodyFatState extends State { child: TextFormField( keyboardType: TextInputType.number, controller: heightController, - decoration: InputDecoration( - labelText: heightCm.toString(), - labelStyle: TextStyle( - color: Colors.black, - )), ), ), ), @@ -350,6 +354,7 @@ class _BodyFatState extends State { onTap: () { setState(() { if (heightCm < 250) heightCm++; + heightController.text = heightCm.toString(); }); }, ), @@ -362,6 +367,7 @@ class _BodyFatState extends State { onTap: () { setState(() { if (heightCm > 0) heightCm--; + heightController.text = heightCm.toString(); }); }, ), @@ -381,6 +387,7 @@ class _BodyFatState extends State { onChanged: (double newValue) { setState(() { heightCm = newValue.round(); + heightController.text = heightCm.toString(); }); }, activeColor: Color(0xffC5272D), @@ -492,15 +499,10 @@ class _BodyFatState extends State { Expanded( child: Center( child: Padding( - padding: const EdgeInsets.only(left: 10.0), + padding: const EdgeInsets.only(left: 15.0, bottom: 0), child: TextFormField( keyboardType: TextInputType.number, controller: neckController, - decoration: InputDecoration( - labelText: neck.toString(), - labelStyle: TextStyle( - color: Colors.black, - )), ), ), ), @@ -527,6 +529,7 @@ class _BodyFatState extends State { onTap: () { setState(() { if (neck < 60) neck++; + neckController.text = neck.toString(); }); }, ), @@ -539,6 +542,7 @@ class _BodyFatState extends State { onTap: () { setState(() { if (neck > 5) neck--; + neckController.text = neck.toString(); }); }, ), @@ -558,6 +562,7 @@ class _BodyFatState extends State { onChanged: (double newValue) { setState(() { neck = newValue.round(); + neckController.text = neck.toString(); }); }, activeColor: Color(0xffC5272D), @@ -673,11 +678,6 @@ class _BodyFatState extends State { child: TextFormField( keyboardType: TextInputType.number, controller: waistController, - decoration: InputDecoration( - labelText: waist.toString(), - labelStyle: TextStyle( - color: Colors.black, - )), ), ), ), @@ -704,6 +704,7 @@ class _BodyFatState extends State { onTap: () { setState(() { if (waist < 200) waist++; + waistController.text = waist.toString(); }); }, ), @@ -716,6 +717,7 @@ class _BodyFatState extends State { onTap: () { setState(() { if (waist > 5) waist--; + waistController.text = waist.toString(); }); }, ), @@ -735,6 +737,7 @@ class _BodyFatState extends State { onChanged: (double newValue) { setState(() { waist = newValue.round(); + waistController.text = waist.toString(); }); }, activeColor: Color(0xffC5272D), @@ -850,11 +853,6 @@ class _BodyFatState extends State { child: TextFormField( keyboardType: TextInputType.number, controller: hipController, - decoration: InputDecoration( - labelText: hip.toString(), - labelStyle: TextStyle( - color: Colors.black, - )), ), ), ), @@ -881,6 +879,7 @@ class _BodyFatState extends State { onTap: () { setState(() { if (hip < 140) hip++; + hipController.text = hip.toString(); }); }, ), @@ -893,6 +892,7 @@ class _BodyFatState extends State { onTap: () { setState(() { if (hip > 5) hip--; + hipController.text = hip.toString(); }); }, ), @@ -912,6 +912,7 @@ class _BodyFatState extends State { onChanged: (double newValue) { setState(() { hip = newValue.round(); + hipController.text = hip.toString(); }); }, activeColor: Color(0xffC5272D), From 350ff20a1ac27f51455389d7fdd2fb58a4e4950d Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 18 Aug 2021 12:09:55 +0300 Subject: [PATCH 5/7] my doctor screen. --- .../BookAppointment/widgets/DoctorView.dart | 185 ++++++++---------- .../medical/doctor/doctor_home_page.dart | 145 +++++++------- 2 files changed, 144 insertions(+), 186 deletions(-) diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 7cdf7ed0..3c8d16fa 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -4,6 +4,9 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -21,109 +24,82 @@ class DoctorView extends StatelessWidget { Widget build(BuildContext context) { return InkWell( onTap: () { - if(isShowFlag) - getDoctorsProfile(context, doctor); + if (isShowFlag) getDoctorsProfile(context, doctor); }, - child: Card( - margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - decoration: BoxDecoration(), - padding: EdgeInsets.all(7.0), - width: MediaQuery.of(context).size.width, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network(this.doctor.doctorImageURL, - fit: BoxFit.fill, height: 60.0, width: 60.0), - ), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), ), - Expanded( - flex: 4, - child: Container( - width: MediaQuery.of(context).size.width * 0.55, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (doctor.doctorTitle != null) - Text(this.doctor.doctorTitle + " " + this.doctor.name, - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700], - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text( - this.doctor.clinicName != null - ? this.doctor.clinicName - : "", - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.projectName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - if (doctor.speciality != null) - Container( - margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text( - getDoctorSpeciality(this.doctor.speciality) - .trim(), - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - this.doctor.nearestFreeSlot != null - ? Container( - margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text(getDate(this.doctor.nearestFreeSlot), - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.bold, - color: Colors.green[600], - letterSpacing: 1.0)), - ) - : Container(), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: - this.doctor.actualDoctorRate.toDouble(), - size: 20.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, + ], + color: Colors.white), + child: Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (doctor.doctorTitle != null) + Text( + doctor.doctorTitle + " " + doctor.name, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + if (doctor.doctorTitle != null) SizedBox(height: 6), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + LargeAvatar( + name: doctor.name, + url: doctor.doctorImageURL, + width: 48, + height: 48, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName), + if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName), + if (doctor.speciality != null) + Text( + getDoctorSpeciality(this.doctor.speciality).trim(), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), + ), + if (doctor.nearestFreeSlot != null) + Text( + getDate(doctor.nearestFreeSlot), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff359846), letterSpacing: -0.48, height: 18 / 12), ), - isShowFlag ? Container( - child: Image.network(this.doctor.nationalityFlagURL, - width: 25.0, height: 25.0), - ) : Container(), - ], - ), - ], + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: this.doctor.actualDoctorRate.toDouble(), + size: 15.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + if (isShowFlag) Image.network(this.doctor.nationalityFlagURL, width: 22.0, height: 22.0) + ], + ), + ], + ), ), - ), + ], ), ], ), @@ -144,10 +120,7 @@ class DoctorView extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(context); List docProfileList = []; DoctorsListService service = new DoctorsListService(); - service - .getDoctorsProfile(docObject.doctorID, docObject.clinicID, - docObject.projectID, context) - .then((res) { + service.getDoctorsProfile(docObject.doctorID, docObject.clinicID, docObject.projectID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['DoctorProfileList'].length != 0) { @@ -155,8 +128,7 @@ class DoctorView extends StatelessWidget { docProfileList.add(new DoctorProfileList.fromJson(v)); }); } else {} - navigateToDoctorProfile(context, docObject, docProfileList[0], - isAppo: isAppo); + navigateToDoctorProfile(context, docObject, docProfileList[0], isAppo: isAppo); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -188,8 +160,7 @@ class DoctorView extends StatelessWidget { } } - Future navigateToDoctorProfile(context, docObject, docProfile, - {isAppo}) async { + Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { Navigator.push( context, FadePage( diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index c8fad3ce..ffa3c820 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -19,8 +20,10 @@ class DoctorHomePage extends StatelessWidget { List imagesInfo = List(); @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/1.png')); + imagesInfo + .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/0.png')); + imagesInfo + .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/1.png')); return BaseView( onModelReady: (model) => model.getMyDoctor(), builder: (context, MyDoctorViewModel model, widget) => AppScaffold( @@ -29,86 +32,70 @@ class DoctorHomePage extends StatelessWidget { appBarTitle: TranslationBase.of(context).myDoctor, description: TranslationBase.of(context).infoMyDoctor, infoList: TranslationBase.of(context).infoMyDoctorPoints, + showNewAppBar: true, + showNewAppBarTitle: true, imagesInfo: imagesInfo, - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: FractionallySizedBox( - widthFactor: 1.0, - child: Center( - child: Column( - children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) => - model.setFilterType(value), - ), - ), - ), - ) - ], - ), - ...List.generate( - model.patientDoctorAppointmentList.length, - (index) => AppExpandableNotifier( - title: model - .patientDoctorAppointmentList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model.patientDoctorAppointmentList[index] - .patientDoctorAppointmentList - .map((doctor) { - DoctorList doctorList = DoctorList( - projectID: doctor.projectID, - setupID: doctor.setupID, - clinicID: doctor.clinicID, - projectName: doctor.projectName, - clinicName: doctor.clinicName, - actualDoctorRate: doctor.actualDoctorRate, - doctorID: doctor.doctorID, - doctorRate: doctor.doctorRate, - gender: doctor.gender, - doctorTitle: doctor.doctorTitle, - name: doctor.name, - doctorImageURL: doctor.doctorImageURL, - nationalityFlagURL: doctor.nationalityFlagURL); - return DoctorView( - doctor: doctorList, - isLiveCareAppointment: false, - ); - - }).toList(), - )), - ) - ], + backgroundColor: Color(0xffF8F8F8), + body: Column( + children: [ + Row( + children: [ + MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, model.filterType, () { + model.setFilterType(FilterType.Clinic); + }), + MyTabView(TranslationBase.of(context).byHospital, FilterType.Hospital, model.filterType, () { + model.setFilterType(FilterType.Hospital); + }), + ], + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 1.0, + child: ListView.separated( + physics: BouncingScrollPhysics(), + separatorBuilder: (context, index) { + return Container( + height: 1, + margin: EdgeInsets.only(left: 21, right: 21), + color: Color(0xffD9D9D9), + ); + }, + itemBuilder: (context, index) { + return AppExpandableNotifier( + title: model.patientDoctorAppointmentList[index].filterName, + bodyWidget: ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), + itemBuilder: (context, _index) { + DoctorList _doctorList = model.patientDoctorAppointmentList[index].patientDoctorAppointmentList[_index]; + DoctorList doctorList = DoctorList( + projectID: _doctorList.projectID, + setupID: _doctorList.setupID, + clinicID: _doctorList.clinicID, + projectName: _doctorList.projectName, + clinicName: _doctorList.clinicName, + actualDoctorRate: _doctorList.actualDoctorRate, + doctorID: _doctorList.doctorID, + doctorRate: _doctorList.doctorRate, + gender: _doctorList.gender, + doctorTitle: _doctorList.doctorTitle, + name: _doctorList.name, + doctorImageURL: _doctorList.doctorImageURL, + nationalityFlagURL: _doctorList.nationalityFlagURL); + return DoctorView( + doctor: doctorList, + isLiveCareAppointment: false, + ); + }, + separatorBuilder: (context, index) => SizedBox(height: 14), + itemCount: model.patientDoctorAppointmentList[index].patientDoctorAppointmentList.length), + ); + }, + itemCount: model.patientDoctorAppointmentList.length), ), ), - ), + ], ), ), ); From 5647ab75e5b027f78fd635a32c55c6fbb65d098a Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 19 Aug 2021 16:12:53 +0300 Subject: [PATCH 6/7] improvements. --- .../GetAllSharedRecordByStatusResponse.dart | 18 +- lib/pages/landing/landing_page.dart | 2 +- lib/pages/login/confirm-login.dart | 231 ++++-------------- lib/pages/login/forgot-password.dart | 4 +- lib/pages/login/login-type.dart | 8 +- lib/pages/login/login.dart | 108 +------- lib/pages/login/welcome.dart | 6 +- lib/splashPage.dart | 14 +- lib/theme/theme_value.dart | 1 - lib/widgets/buttons/defaultButton.dart | 12 +- .../medical/LabResult/LineChartCurved.dart | 6 +- .../lab_result_chart_and_detials.dart | 4 +- .../LabResult/laboratory_result_widget.dart | 4 +- .../data_display/medical/doctor_card.dart | 4 +- lib/widgets/drawer/app_drawer_widget.dart | 38 +-- lib/widgets/habib_logo_widget.dart | 6 +- lib/widgets/mobile-no/mobile_no.dart | 8 +- lib/widgets/new_design/my_tab_view.dart | 2 +- .../others/app_expandable_notifier.dart | 4 +- lib/widgets/others/not_auh_page.dart | 12 +- lib/widgets/otp/sms-popup.dart | 49 ++-- lib/widgets/otp_widget.dart | 2 +- 22 files changed, 162 insertions(+), 381 deletions(-) diff --git a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart index 750cf0be..c1755cc1 100644 --- a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart +++ b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart @@ -25,7 +25,7 @@ class GetAllSharedRecordsByStatusResponse { dynamic successMsgN; dynamic doctorInformationList; List getAllPendingRecordsList; - List getAllSharedRecordsByStatusList = List(); + List getAllSharedRecordsByStatusList = []; List getResponseFileList; bool isHMGPatient; bool isLoginSuccessfully; @@ -92,7 +92,7 @@ class GetAllSharedRecordsByStatusResponse { this.successMsgN, this.doctorInformationList, this.getAllPendingRecordsList, - this.getAllSharedRecordsByStatusList , + this.getAllSharedRecordsByStatusList, this.getResponseFileList, this.isHMGPatient, this.isLoginSuccessfully, @@ -164,16 +164,14 @@ class GetAllSharedRecordsByStatusResponse { if (json['GetAllPendingRecordsList'] != null) { getAllSharedRecordsByStatusList = new List(); json['GetAllPendingRecordsList'].forEach((v) { - getAllSharedRecordsByStatusList - .add(new GetAllSharedRecordsByStatusList.fromJson(v)); + getAllSharedRecordsByStatusList.add(new GetAllSharedRecordsByStatusList.fromJson(v)); }); } if (json['GetAllSharedRecordsByStatusList'] != null) { getAllSharedRecordsByStatusList = new List(); json['GetAllSharedRecordsByStatusList'].forEach((v) { - getAllSharedRecordsByStatusList - .add(new GetAllSharedRecordsByStatusList.fromJson(v)); + getAllSharedRecordsByStatusList.add(new GetAllSharedRecordsByStatusList.fromJson(v)); }); } getResponseFileList = json['GetResponseFileList']; @@ -214,10 +212,9 @@ class GetAllSharedRecordsByStatusResponse { memberList = json['memberList']; message = json['message']; statusCode = json['statusCode']; - }catch (e){ - var asd =""; + } catch (e) { + var asd = ""; print(e); - } } @@ -250,8 +247,7 @@ class GetAllSharedRecordsByStatusResponse { data['DoctorInformation_List'] = this.doctorInformationList; data['GetAllPendingRecordsList'] = this.getAllPendingRecordsList; if (this.getAllSharedRecordsByStatusList != null) { - data['GetAllSharedRecordsByStatusList'] = - this.getAllSharedRecordsByStatusList.map((v) => v.toJson()).toList(); + data['GetAllSharedRecordsByStatusList'] = this.getAllSharedRecordsByStatusList.map((v) => v.toJson()).toList(); } data['GetResponseFileList'] = this.getResponseFileList; data['IsHMGPatient'] = this.isHMGPatient; diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0b43309a..0515ccd4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -522,7 +522,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { style: TextStyle( fontWeight: FontWeight.bold, color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // bold: true, ), leading: Builder( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 112fb0b0..9f78797e 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -124,16 +124,16 @@ class _ConfirmLogin extends State { children: [ Text( TranslationBase.of(context).welcomeBack, - style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), ), Text( user.name.toLowerCase().capitalizeFirstofEach, - style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44), + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44), ), SizedBox(height: 10), Text( TranslationBase.of(context).accountInfo, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), ), Container( height: 72, @@ -157,7 +157,7 @@ class _ConfirmLogin extends State { children: [ Text( TranslationBase.of(context).lastLoginAt.toCamelCase, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), ), Text( user.editedOn != null @@ -165,7 +165,7 @@ class _ConfirmLogin extends State { : user.createdOn != null ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.createdOn)) : '--', - style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), ), ], ), @@ -177,7 +177,7 @@ class _ConfirmLogin extends State { TranslationBase.of(context).lastLoginWith.toCamelCase, style: TextStyle( fontSize: 10, - fontFamily: "Poppins", + fontWeight: FontWeight.w600, color: Color(0xff575757), ), @@ -186,7 +186,7 @@ class _ConfirmLogin extends State { " " + getType(user.logInType, context), style: TextStyle( fontSize: 12, - fontFamily: "Poppins", + fontWeight: FontWeight.w600, color: Color(0xff2B353E), ), @@ -198,7 +198,7 @@ class _ConfirmLogin extends State { : user.createdOn != null ? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.createdOn)) : '--', - style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), ), ], ) @@ -207,7 +207,7 @@ class _ConfirmLogin extends State { ), Text( TranslationBase.of(context).pleaseVerify, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), ), GridView( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), @@ -230,26 +230,32 @@ class _ConfirmLogin extends State { height: 90, width: 90, ), + SizedBox(height: 23), this.onlySMSBox == false - ? Texts( + ? Text( TranslationBase.of(context).verifyLoginWith, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.left, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), ) - : Texts( + : Text( TranslationBase.of(context).verifyFingerprint2, - fontSize: SizeConfig.textMultiplier * 2.5, - textAlign: TextAlign.start, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), ), - onlySMSBox == false - ? Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [Expanded(child: getButton(3)), Expanded(child: getButton(2))], - ) - : SizedBox(), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [Expanded(child: getButton(1)), Expanded(child: getButton(4))], + SizedBox(height: 23), + Text( + TranslationBase.of(context).pleaseVerify, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), + ), + GridView( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(top: 9), + shrinkWrap: true, + children: [ + if (onlySMSBox == false) getButton(3), + if (onlySMSBox == false) getButton(2), + getButton(1), + getButton(4), + ], ), ]), ], @@ -258,157 +264,14 @@ class _ConfirmLogin extends State { SizedBox( height: 12, ), - SizedBox( - height: 43, - width: double.infinity, - child: FlatButton( - onPressed: () { - Navigator.of(context).pushNamed(LOGIN_TYPE); - }, - child: Text( - TranslationBase.of(context).useAnotherAccount, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), - ), - color: Color(0xffD02127), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), - ), + DefaultButton( + TranslationBase.of(context).useAnotherAccount, + () => {Navigator.of(context).pushNamed(LOGIN_TYPE)}, ), ], ), ), ); - - return AppScaffold( - appBarTitle: TranslationBase.of(context).confirm, - isShowAppBar: true, - isShowDecPage: false, - body: SingleChildScrollView( - child: Container( - padding: EdgeInsets.all(20), - height: SizeConfig.realScreenHeight * .9, - width: SizeConfig.realScreenWidth, - child: Column( - children: [ - user != null && isMoreOption == false - ? Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/habib-logo.png', - height: 90, - width: 90, - ), - Texts( - TranslationBase.of(context).welcomeBack + ' ' + user.name, - fontSize: SizeConfig.textMultiplier * 3.5, - ), - SizedBox( - height: 20, - ), - Texts( - TranslationBase.of(context).accountInfo, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 20, - ), - Card( - color: Colors.grey[300], - child: Row( - children: [ - Flexible( - child: ListTile( - title: Text( - TranslationBase.of(context).lastLoginAt, - textAlign: TextAlign.center, - overflow: TextOverflow.ellipsis, - ), - subtitle: Text( - user.editedOn != null - ? formatDate(DateUtil.convertStringToDate(user.editedOn)) - : user.createdOn != null - ? formatDate(DateUtil.convertStringToDate(user.createdOn)) - : '--', - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.center), - )), - Flexible( - child: ListTile( - title: Text(TranslationBase.of(context).lastLoginWith, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center), - subtitle: Text(getType(user.logInType, context), overflow: TextOverflow.ellipsis, textAlign: TextAlign.center), - )) - ], - )), - ], - ) - : Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - 'assets/images/habib-logo.png', - height: 90, - width: 90, - ), - this.onlySMSBox == false - ? Texts( - TranslationBase.of(context).verifyLoginWith, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.left, - ) - : Texts( - TranslationBase.of(context).verifyFingerprint2, - fontSize: SizeConfig.textMultiplier * 2.5, - textAlign: TextAlign.start, - ), - ]), - user != null && isMoreOption == false - ? Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row(mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded(child: InkWell(onTap: () => {authenticateUser(3, isActive: BiometricType.face.index)}, child: getButton(user.logInType))), - Expanded(child: getButton(5)) - ]) - ]) - : Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - onlySMSBox == false - ? Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [Expanded(child: getButton(3)), Expanded(child: getButton(2))], - ) - : SizedBox(), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [Expanded(child: getButton(1)), Expanded(child: getButton(4))], - ), - ]), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - user != null - ? Row( - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).useAnotherAccount, - () => { - Navigator.of(context).pushNamed( - LOGIN_TYPE, - ) - }, - )), - ], - ) - : SizedBox(), - ], - ), - ) - ], - ), - ), - ), - ); } Future _getAvailableBiometrics() async { @@ -771,21 +634,25 @@ class _ConfirmLogin extends State { } Widget _loginOptionButton(String _title, String _icon, int _flag, int _loginIndex) { + bool isDisable = (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face)); + return InkWell( - onTap: () { - if (_flag == 0) { - setState(() { - isMoreOption = true; - }); - } else { - authenticateUser(4, isActive: _loginIndex); - } - }, + onTap: isDisable + ? null + : () { + if (_flag == 0) { + setState(() { + isMoreOption = true; + }); + } else { + authenticateUser(_flag, isActive: _loginIndex); + } + }, child: Container( padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28), decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), - color: Colors.white, + color: isDisable ? Colors.grey.withOpacity(0.3) : Colors.white, border: Border.all( color: Color(0xffefefef), width: 1, @@ -799,10 +666,12 @@ class _ConfirmLogin extends State { _icon, height: 38, width: 38, + color: isDisable ? Color(0xff2B353E).withOpacity(0.7) : null, ), Text( TranslationBase.of(context).verifyThrough + " " + _title, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), + style: TextStyle( + fontSize: 16, fontWeight: FontWeight.w600, color: isDisable ? Color(0xff2B353E).withOpacity(0.7) : Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), ), ], ), diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index e03a1225..d943ba98 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -52,7 +52,7 @@ class _ForgotPassword extends State { SizedBox(height: 50), Text( TranslationBase.of(context).forgotDesc, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), SizedBox(height: 20), PhoneNumberSelectorWidget(onNumberChange: (value) { @@ -76,7 +76,7 @@ class _ForgotPassword extends State { }, child: Text( TranslationBase.of(context).submit, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), ), // color: Color(0xffD02127), color: (mobileNo.length >= 9) == true ? Color(0xffD02127) : Color(0xff575757), diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index 6c4425e0..5254e3c1 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -44,7 +44,7 @@ class LoginType extends StatelessWidget { SizedBox(height: 50), Text( TranslationBase.of(context).logintypeRadio, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), GridView( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), @@ -61,7 +61,7 @@ class LoginType extends StatelessWidget { text: TextSpan( text: TranslationBase.of(context).forgotPassword, style: TextStyle( - decoration: TextDecoration.underline, fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12), + decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12), recognizer: TapGestureRecognizer()..onTap = () => Navigator.of(context).push(FadePage(page: ForgotPassword())), ), ), @@ -77,7 +77,7 @@ class LoginType extends StatelessWidget { }, child: Text( TranslationBase.of(context).registerNow, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), ), color: Color(0xffD02127), shape: RoundedRectangleBorder( @@ -253,7 +253,7 @@ class LoginType extends StatelessWidget { ), Text( _title, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), ), ], ), diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 074b9b6c..50b2502d 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -66,7 +66,7 @@ class _Login extends State { // getDeviceToken(); super.initState(); - if(BASE_URL.contains("uat.")){ + if (BASE_URL.contains("uat.")) { nationalIDorFile.text = "1231755"; mobileNumberController.text = mobileNo = "537503378"; } @@ -106,7 +106,7 @@ class _Login extends State { SizedBox(height: 50), Text( loginType == 1 ? TranslationBase.of(context).enterNationalId : TranslationBase.of(context).enterFile, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), SizedBox(height: 20), // inputWidget("Country", "Saudi Arabia", isEnable: false, hasSelection: true), @@ -119,98 +119,18 @@ class _Login extends State { ), ), SizedBox( - height: 43, - width: double.infinity, - child: FlatButton( - onPressed: isButtonDisabled - ? null - : () { - this.startLogin(); - }, - child: Text( - TranslationBase.of(context).login, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), - ), - disabledColor: Color(0xff575757), - color: Color(0xffD02127), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), - ), + height: 12, ), - ]), - ), - ); - - return AppScaffold( - appBarTitle: TranslationBase.of(context).login, - isShowAppBar: true, - isShowDecPage: false, - body: SingleChildScrollView( - child: Container( - padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), - height: SizeConfig.realScreenHeight * .9, - width: SizeConfig.realScreenWidth, - child: Column( - children: [ - Expanded( - flex: 2, - child: Texts( - loginType == 1 ? TranslationBase.of(context).enterNationalId : TranslationBase.of(context).enterFile, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.start, - )), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Directionality( - textDirection: TextDirection.ltr, - child: MobileNo(controller: mobileNumberController, onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value)), - Directionality( - textDirection: TextDirection.ltr, - child: Container( - child: TextFields( - keyboardType: TextInputType.number, - fontWeight: FontWeight.normal, - controller: nationalIDorFile, - onChanged: (value) => {validateForm()}, - prefixIcon: Icon(loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, color: secondaryColor), - padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), - hintText: loginType == 1 ? TranslationBase.of(context).nationalID : TranslationBase.of(context).fileNo, - ))) - ], - ), - ), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Divider( - color: Colors.grey, - height: 2, - ), - SizedBox( - height: 10, - ), - Row( - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).login, - () => {this.startLogin()}, - color: isButtonDisabled == true ? Colors.grey : Colors.grey[900], - textColor: Colors.white, - )) - ], - ), - ], - )) - ], + DefaultButton( + TranslationBase.of(context).login, + isButtonDisabled + ? null + : () { + this.startLogin(); + }, + disabledColor: Color(0xff575757), ), - ), + ]), ), ); } @@ -240,7 +160,6 @@ class _Login extends State { _labelText, style: TextStyle( fontSize: 11, - fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.44, @@ -254,7 +173,6 @@ class _Login extends State { onChanged: (value) => {validateForm()}, style: TextStyle( fontSize: 14, - fontFamily: "Poppins", height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff2B353E), @@ -265,7 +183,6 @@ class _Login extends State { hintText: _hintText, hintStyle: TextStyle( fontSize: 14, - fontFamily: "Poppins", height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff575757), @@ -278,7 +195,6 @@ class _Login extends State { "+" + prefix, style: TextStyle( fontSize: 14, - fontFamily: "Poppins", height: 21 / 14, fontWeight: FontWeight.w500, color: Color(0xff2E303A), diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index a79598a9..b1f28ced 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -52,15 +52,15 @@ class _WelcomeLogin extends State { SizedBox(height: 16), Text( TranslationBase.of(context).welcome, - style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), ), Text( TranslationBase.of(context).welcomeText, - style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), ), Text( TranslationBase.of(context).welcomeText2, - style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), ), SizedBox( height: 14, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index b65d22e0..d49258a4 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -1,24 +1,18 @@ import 'dart:async'; + import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:firebase_analytics/observer.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; -import 'package:flutter/services.dart'; -import 'analytics/google-analytics.dart'; -import 'config/shared_pref_kay.dart'; -import 'config/size_config.dart'; + import 'core/service/AuthenticatedUserObject.dart'; import 'core/service/privilege_service.dart'; import 'core/viewModels/project_view_model.dart'; import 'locator.dart'; -import 'models/Authentication/authenticated_user.dart'; -import 'widgets/transitions/slide_up_page.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); AuthenticatedUserObject authenticatedUserObject = locator(); @@ -79,7 +73,7 @@ class _SplashScreenState extends State { children: [ Text( TranslationBase.of(context).poweredBy, - style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w400, color: Color(0xff333C45), letterSpacing: -0.56, height: 16 / 14), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xff333C45), letterSpacing: -0.56, height: 16 / 14), ), SizedBox( height: 5, @@ -94,7 +88,7 @@ class _SplashScreenState extends State { ), Text( "Version 1.1.0", - style: TextStyle(fontSize: 10, fontFamily: "Poppins", fontWeight: FontWeight.w400, color: Color(0xff3989898), letterSpacing: 0, height: 12 / 10), + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w400, color: Color(0xff3989898), letterSpacing: 0, height: 12 / 10), ), SizedBox( height: 18, diff --git a/lib/theme/theme_value.dart b/lib/theme/theme_value.dart index fc07dda1..142b26a7 100644 --- a/lib/theme/theme_value.dart +++ b/lib/theme/theme_value.dart @@ -17,7 +17,6 @@ defaultTheme({fontName}) { return ThemeData( fontFamily: fontName, //projectProvider.isArabic ? 'Cairo' : 'WorkSans', - primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, diff --git a/lib/widgets/buttons/defaultButton.dart b/lib/widgets/buttons/defaultButton.dart index 73fe0ab9..eaac78b9 100644 --- a/lib/widgets/buttons/defaultButton.dart +++ b/lib/widgets/buttons/defaultButton.dart @@ -2,10 +2,11 @@ import 'package:flutter/material.dart'; class DefaultButton extends StatelessWidget { final String text; - final Function onPress; + final VoidCallback onPress; final Color textColor; final Color color; - DefaultButton(this.text, this.onPress, {this.color, this.textColor = Colors.white}); + final Color disabledColor; + DefaultButton(this.text, this.onPress, {this.color, this.disabledColor, this.textColor = Colors.white}); @override Widget build(BuildContext context) { @@ -13,15 +14,14 @@ class DefaultButton extends StatelessWidget { height: 43, width: double.infinity, child: FlatButton( - onPressed: () { - onPress(); - }, + onPressed: onPress, child: Text( text, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), ), // color: Color(0xffD02127), color: color ?? const Color(0xffD02127), + disabledColor: disabledColor, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(6), ), diff --git a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart index 420fa7b1..b9847a0b 100644 --- a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart +++ b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart @@ -50,7 +50,7 @@ class LineChartCurvedState extends State { children: [ Text( widget.title, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), SizedBox(height: 16), AspectRatio( @@ -83,7 +83,7 @@ class LineChartCurvedState extends State { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12), + getTextStyles: (value) => TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12), margin: 8, rotateAngle: -0, getTitles: (value) { @@ -107,7 +107,7 @@ class LineChartCurvedState extends State { ), leftTitles: SideTitles( showTitles: true, - getTextStyles: (value) => TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12), + getTextStyles: (value) => TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: 0, height: 18 / 12), getTitles: (value) { return '${value.toInt()}'; diff --git a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart index 58ea2294..309abb0e 100644 --- a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart +++ b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart @@ -51,7 +51,7 @@ class LabResultChartAndDetails extends StatelessWidget { Expanded( child: Text( TranslationBase.of(context).graphDetails, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), ], @@ -74,7 +74,7 @@ class LabResultChartAndDetails extends StatelessWidget { // Expanded( // child: Text( // TranslationBase.of(context).generalResult, - // style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + // style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), // ), // ), // ], diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index 641a0bed..880be43c 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -107,7 +107,7 @@ class _LaboratoryResultWidgetState extends State { Expanded( child: Text( TranslationBase.of(context).generalResult, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), Icon( @@ -164,7 +164,7 @@ class _LaboratoryResultWidgetState extends State { Expanded( child: Text( TranslationBase.of(context).specialResult, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), Icon( diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 4f5fe2a4..ea679f7d 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -161,11 +161,11 @@ Widget myRichText(String title, String value) { return RichText( text: TextSpan( text: title, - style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), children: [ TextSpan( text: " $value", - style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ) ]), ); diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 3f90abbb..bdb733c4 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -92,7 +92,11 @@ class _AppDrawerState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - SvgPicture.asset("assets/images/new/logo.svg"), + SvgPicture.asset( + "assets/images/new/logo.svg", + height: 60, + width: 60, + ), IconButton( icon: Icon(Icons.clear), onPressed: () { @@ -112,20 +116,15 @@ class _AppDrawerState extends State { children: [ Text( (user != null && projectProvider.isLogin) ? user.firstName + ' ' + user.lastName : TranslationBase.of(context).cantSeeProfile, - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 17, - letterSpacing: -1.2, - ), + style: TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.bold, fontSize: 20, letterSpacing: -1.2, height: 35 / 20), ), Text( (user != null && projectProvider.isLogin) - ? TranslationBase.of(context).fileno + ": " + user.patientID.toString() + ? TranslationBase.of(context).fileNumber + ": " + user.patientID.toString() : TranslationBase.of(context).loginRegisterNow, style: TextStyle( - color: Colors.black, - fontSize: 13, + color: Color(0xff2E303A), + fontSize: 16, letterSpacing: -0.96, height: 1, ), @@ -219,17 +218,22 @@ class _AppDrawerState extends State { children: [ AppText( mainUser.firstName + ' ' + mainUser.lastName, - color: Theme.of(context).textTheme.bodyText1.color, + color: Color(0xff2E303A), //Theme.of(context).textTheme.bodyText1.color, fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: -0.33, ), AppText( TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString(), - color: Colors.grey[700], + color: Color(0xff989898), fontSize: 12, letterSpacing: -0.33, ), + Container( + height: 1, + margin: EdgeInsets.only(top: 7.5), + color: Color(0xffEDEDED), + ), ], ), ), @@ -264,15 +268,15 @@ class _AppDrawerState extends State { children: [ AppText( result.patientName, - color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black, + color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Color(0xff2B353E), fontWeight: FontWeight.w600, - fontSize: 12, + fontSize: 11, letterSpacing: -0.33, ), AppText( TranslationBase.of(context).fileno + ": " + result.responseID.toString(), - color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.grey[700], - fontSize: 12, + color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Color(0xff989898), + fontSize: 11, letterSpacing: -0.33, ), Divider( @@ -448,7 +452,7 @@ class _AppDrawerState extends State { Text( "Cloud Solutions", style: TextStyle( - color: Colors.black, + color: Color(0xff2E303A), fontSize: 13, letterSpacing: -0.54, fontWeight: FontWeight.w600, diff --git a/lib/widgets/habib_logo_widget.dart b/lib/widgets/habib_logo_widget.dart index 6754767a..3993d952 100644 --- a/lib/widgets/habib_logo_widget.dart +++ b/lib/widgets/habib_logo_widget.dart @@ -22,15 +22,15 @@ class HabibLogoWidget extends StatelessWidget { children: [ Text( TranslationBase.of(context).welcomeTo, - style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.72, height: 23 / 12), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.72, height: 23 / 12), ), Text( TranslationBase.of(context).drSulaimanText, - style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), ), Text( TranslationBase.of(context).patientApp, - style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.72), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.72), ), SizedBox(height: 2), ], diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index fdf14683..5134c8f9 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -83,7 +83,7 @@ class _PhoneNumberSelectorWidgetState extends State { _labelText, style: TextStyle( fontSize: 11, - fontFamily: "Poppins", + fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.44, @@ -96,7 +96,7 @@ class _PhoneNumberSelectorWidgetState extends State { onChanged: (value) => widget.onNumberChange(value), style: TextStyle( fontSize: 14, - fontFamily: "Poppins", + height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff2B353E), @@ -107,7 +107,7 @@ class _PhoneNumberSelectorWidgetState extends State { hintText: _hintText, hintStyle: TextStyle( fontSize: 14, - fontFamily: "Poppins", + height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff575757), @@ -120,7 +120,7 @@ class _PhoneNumberSelectorWidgetState extends State { prefix, style: TextStyle( fontSize: 14, - fontFamily: "Poppins", + height: 21 / 14, fontWeight: FontWeight.w500, color: Color(0xff2E303A), diff --git a/lib/widgets/new_design/my_tab_view.dart b/lib/widgets/new_design/my_tab_view.dart index b09a228c..91d77039 100644 --- a/lib/widgets/new_design/my_tab_view.dart +++ b/lib/widgets/new_design/my_tab_view.dart @@ -27,7 +27,7 @@ class MyTabView extends StatelessWidget { title, style: TextStyle( fontSize: 16, - fontFamily: "Poppins", + fontWeight: FontWeight.w600, color: value == groupValue ? Color(0xff2B353E) : Color(0xff575757), letterSpacing: -0.48, diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index 51fa0f03..0519df3c 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -83,12 +83,12 @@ class _AppExpandableNotifier extends State { if (_title.isNotEmpty) Text( _title, - style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12), ), Text( _subTitle, maxLines: 1, - style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24), + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24), ), ], ), diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index e5ea9845..d44bac22 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -61,11 +61,11 @@ class _NotAutPageState extends State { SizedBox(height: 16), Text( widget.title, - style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), ), Text( widget.description, - style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), ), SizedBox( height: 14, @@ -107,7 +107,7 @@ class _NotAutPageState extends State { }, child: Text( TranslationBase.of(context).loginregister, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), ), // color: Color(0xffD02127), color: Color(0xffD02127), @@ -152,11 +152,11 @@ class _NotAutPageState extends State { SizedBox(height: 16), Text( widget.title, - style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), ), Text( widget.description, - style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), ), SizedBox( height: 14, @@ -198,7 +198,7 @@ class _NotAutPageState extends State { }, child: Text( TranslationBase.of(context).loginregister, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), ), // color: Color(0xffD02127), color: Color(0xffD02127), diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index add0008a..cb014d64 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'dart:math'; import 'package:provider/provider.dart'; @@ -86,8 +87,8 @@ class SMSOTP { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Image.asset( - type == 1 ? 'assets/images/login/103.png' : 'assets/images/login/104.png', + SvgPicture.asset( + type == 1 ?"assets/images/new/verify_sms.svg":"assets/images/new/verify_whatsapp.svg", height: 50, width: 50, ), @@ -105,41 +106,43 @@ class SMSOTP { SizedBox(height: 22), Text( TranslationBase.of(context).pleaseEnterTheVerificationCode + ' xxxxxxxx' + mobileNo.toString().substring(mobileNo.toString().length - 3), - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), ), SizedBox(height: 18), Directionality( textDirection: TextDirection.ltr, - child: OTPWidget( - autoFocus: true, - controller: _pinPutController, - defaultBorderColor: Color(0xffD8D8D8), - maxLength: 4, - onTextChanged: (text) {}, - pinBoxColor: Colors.white, - onDone: (code) => _onOtpCallBack(code, null), - textBorderColor: Color(0xffD8D8D8), - pinBoxWidth: 68, - pinBoxHeight: 75, - pinTextStyle: TextStyle( - fontSize: 24.0, - color: Color(0xff2B353E), + child: Center( + child: OTPWidget( + autoFocus: true, + controller: _pinPutController, + defaultBorderColor: Color(0xffD8D8D8), + maxLength: 4, + onTextChanged: (text) {}, + pinBoxColor: Colors.white, + onDone: (code) => _onOtpCallBack(code, null), + textBorderColor: Color(0xffD8D8D8), + pinBoxWidth: 60, + pinBoxHeight: 60, + pinTextStyle: TextStyle( + fontSize: 24.0, + color: Color(0xff2B353E), + ), + pinTextAnimatedSwitcherTransition: ProvidedPinBoxTextAnimation.scalingTransition, + pinTextAnimatedSwitcherDuration: Duration(milliseconds: 300), + pinBoxRadius: 10, + keyboardType: TextInputType.number, ), - pinTextAnimatedSwitcherTransition: ProvidedPinBoxTextAnimation.scalingTransition, - pinTextAnimatedSwitcherDuration: Duration(milliseconds: 300), - pinBoxRadius: 10, - keyboardType: TextInputType.number, ), ), SizedBox(height: 30), RichText( text: TextSpan( text: TranslationBase.of(context).validationMessage + '\n', - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), children: [ TextSpan( text: displayTime, - style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48), ), ], ), diff --git a/lib/widgets/otp_widget.dart b/lib/widgets/otp_widget.dart index 918107c0..f44f255b 100644 --- a/lib/widgets/otp_widget.dart +++ b/lib/widgets/otp_widget.dart @@ -295,7 +295,7 @@ class OTPWidgetState extends State with SingleTickerProviderStateMixi List pinCodes = List.generate(widget.maxLength, (int i) { return _buildPinCode(i, context); }); - return Row(children: pinCodes, mainAxisSize: MainAxisSize.min); + return Row(children: pinCodes, mainAxisSize: MainAxisSize.min,mainAxisAlignment: MainAxisAlignment.spaceBetween,); } Widget _buildPinCode(int i, BuildContext context) { From 3f29bbd6b302334f3ac6834ce3e6dd701e3bcc7a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 22 Aug 2021 14:15:49 +0300 Subject: [PATCH 7/7] Updates & fixes --- .../ancillary-orders/ancillaryOrdersDetails.dart | 10 +++++----- lib/pages/MyAppointments/MyAppointments.dart | 1 + lib/pages/landing/landing_page.dart | 2 +- lib/widgets/data_display/medical/doctor_card.dart | 6 ++++-- lib/widgets/others/app_expandable_notifier.dart | 14 +++++++------- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 6f3ef552..bb80886f 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -146,11 +146,11 @@ class _AnicllaryOrdersState extends State ), Row( children: [ - Texts( - TranslationBase.of(context).invoiceDate, -// fontWeight: FontWeight.bold, - color: Colors.red[500], - ), +// Texts( +// TranslationBase.of(context).invoiceDate, +// // fontWeight: FontWeight.bold, +// color: Colors.red[500], +// ), Texts(" : "), Texts( DateUtil.getFormattedDate( diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index ebb2216b..601d5580 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -359,6 +359,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid isLiveCareAppointment: _appointmentResult.isLiveCareAppointment, date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate), isSortByClinic: _isSortByClinic, + appoTime: _appointmentResult.startTime, //projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate) : DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate), ); }, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0515ccd4..2627133d 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -224,7 +224,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); - locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] HMGNetworkConnectivity(context, () { diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index ea679f7d..e60632d1 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -22,9 +22,10 @@ class DoctorCard extends StatelessWidget { final bool isInOutPatient; final bool isLiveCareAppointment; final bool isSortByClinic; + final String appoTime; DoctorCard( - {this.name, this.subName, this.rat, this.date, this.profileUrl, this.isSortByClinic = true, this.billNo, this.onTap, this.onEmailTap, this.isInOutPatient, this.isLiveCareAppointment = false}); + {this.name, this.subName, this.rat, this.date, this.profileUrl, this.isSortByClinic = true, this.billNo, this.onTap, this.onEmailTap, this.isInOutPatient, this.isLiveCareAppointment = false, this.appoTime}); @override Widget build(BuildContext context) { @@ -106,7 +107,8 @@ class DoctorCard extends StatelessWidget { style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), Text( - DateUtil.formatDateToTime(date), + // DateUtil.formatDateToTime(date), + appoTime, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48, height: 18 / 12), ), ], diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index 0519df3c..0e3babbe 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -82,14 +82,14 @@ class _AppExpandableNotifier extends State { children: [ if (_title.isNotEmpty) Text( - _title, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12), + _title + " " + _subTitle, + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12), ), - Text( - _subTitle, - maxLines: 1, - style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24), - ), + // Text( + // _subTitle, + // maxLines: 1, + // style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24), + // ), ], ), ),