Merge branch 'haroon-new-design' into 'development_new_design_2.0'

Haroon new design

See merge request Cloud_Solution/diplomatic-quarter!450
merge-update-with-lab-changes
haroon amjad 4 years ago
commit 76fb93fe9b

@ -442,6 +442,7 @@ const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/
const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc";
const ADD_HHC_ORDER_RC = "rc/api/HHC/add";
const GET_ALL_HHC_ORDERS_RC = 'rc/api/hhc/list';
const UPDATE_HHC_ORDER_RC = 'rc/api/hhc/update';
// CMC RC SERVICES
const GET_ALL_CMC_SERVICES_RC = 'rc/api/cmc/getallcmc';

@ -633,7 +633,7 @@ const Map localizedValues = {
"توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية الاشعة التطعيمات العلاج الطبيعي) ..."
},
"email": {"en": "Email", "ar": "البريد الالكتروني"},
"Book": {"en": "Book", "ar": "احجز"},
"Book": {"en": "Book", "ar": "حجز"},
"AppointmentLabel": {"en": "Appointment", "ar": "موعد"},
"BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"},
"marital-status": {"en": "Marital status", "ar": "الحالة الإجتماعية"},
@ -1091,7 +1091,7 @@ const Map localizedValues = {
"updated-email": {"en": "Updated email successfully", "ar": "تم تحديث البريد الالكتروني"},
"view-list-children": {"en": "View List of Children", "ar": "عرض قائمة الأطفال"},
"covidTest": {"en": "COVID-19 TEST", "ar": "فحص كورونا"},
"driveThru": {"en": "Drive-Thru", "ar": "من السيارة"},
"driveThru": {"en": "Drive-Thru", "ar": "من داخل السيارة"},
"trackDeliveryDriver": {"en": "Track Delivery Driver", "ar": "تتبع السائق"},
"NearestErDesc": {
"en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location",
@ -1542,25 +1542,44 @@ const Map localizedValues = {
"My_File_Details": {"en": "My File Details", "ar": "تفاصيل ملفي"},
"Ecommerce": {"en": "Ecommerce", "ar": "التجارة الإلكترونية"},
"Family_Files": {"en": "Family Files", "ar": "ملفات العائلة"},
"My_Child": {"en": "My Child", "ar": "طفلي"},
"Vaccines": {"en": "Vaccines", "ar": "اللقاحات"},
"Todo": {"en": "Todo", "ar": "لكى يفعل"},
"List": {"en": "List", "ar": "قائمة"},
"Blood": {"en": "Blood", "ar": "دم"},
"Donation": {"en": "Donation", "ar": "هبة"},
"My_Child": {"en": "My Child", "ar": "تطعيمات"},
"Vaccines": {"en": "Vaccines", "ar": "الأطفال"},
"Todo": {"en": "Todo", "ar": "قائمة"},
"List": {"en": "List", "ar": "المهام"},
"Blood": {"en": "Blood", "ar": "التبرع"},
"Donation": {"en": "Donation", "ar": "بالدم"},
"Health": {"en": "Health", "ar": "الصحة"},
"Calculator": {"en": "Calculator", "ar": "آلة حاسبة"},
"Converter": {"en": "Converter", "ar": "محول"},
"Smart": {"en": "Smart", "ar": "ذكي"},
"Watches": {"en": "Watches", "ar": "ساعات"},
"Parking": {"en": "Parking", "ar": "موقف سيارات"},
"parkingTitle2": {"en": "Car parking", "ar": "خدمة"},
"ParkingSubtitle": {"en": "service", "ar": "مواقف السيارات"},
"Details": {"en": "Details", "ar": "تفاصيل"},
"Virtual": {"en": "Virtual", "ar": "افتراضية"},
"News": {"en": "News", "ar": "أخبار"},
"Latest": {"en": "Latest", "ar": "أحدث"},
"Tour": {"en": "Tour", "ar": "رحلة"},
"News": {"en": "News", "ar": "أحدث"},
"Latest": {"en": "Latest", "ar": "ألاخبار"},
"Virtual": {"en": "Virtual", "ar": "جولة"},
"Tour": {"en": "Tour", "ar": "افتراضية"},
"mostViewed": {"en": "Most Viewed", "ar": "الأكثر مشاهدة"},
"newProducts": {"en": "New Products", "ar": "منتجات جديدة"},
"paymentSelected": {"en": "Selected", "ar": "المحدد"},
"moreNotifications": {"en": "More notifications", "ar": "الإشعارات المزيد"},
"familyTitle": {"en": "My Family", "ar": "ملفات"},
"familySubtitle": {"en": "Files", "ar": "العائلة"},
"liveCareTitle": {"en": "LiveCare", "ar": "خدمة"},
"liveCareSubtitle": {"en": "Service", "ar": "لايف كير"},
"pharmacyTitle": {"en": "Al Habib", "ar": "الصيدليات"},
"pharmacySubtitle": {"en": "Pharmacy", "ar": "الحبيب"},
"healthCalculatorTitle": {"en": "Health", "ar": "الحاسبات"},
"healthCalculatorSubtitle": {"en": "Calculators", "ar": "الصحية"},
"waterTitle": {"en": "Water", "ar": "استهلاك"},
"waterSubtitle": {"en": "Consumption", "ar": "الماء"},
"medicalFileTitle2": {"en": "My Medical File", "ar": "تفاصيل"},
"medicalFileSubtitle": {"en": "Details", "ar": "ملفي الطبي"},
"healthConvertersTitle": {"en": "Health", "ar": "تحويل"},
"healthConvertersSubtitle": {"en": "Converters", "ar": "القياسات"},
"syncHealthData": { "en": "Sync Health Data", "ar": "مزامنة البيانات الصحية" },
"steps": { "en": "Steps", "ar": "الخطوات" },
"avgSteps": { "en": "Average Steps", "ar": "متوسط الخطوات" },
"enterDetails": {"en": "Enter Details", "ar": "أدخل التفاصيل"},
};

@ -22,9 +22,12 @@ class EReferralService extends BaseService {
List<SearchEReferralResponseModel> get allReferral => _allReferral;
String _activationCode;
String _logInTokenID;
String _referralNumber;
String get activationCode => _activationCode;
String get referralNumber => _referralNumber;
bool _isActivationCodeValid = false;
bool get isActivationCodeValid => _isActivationCodeValid;
@ -106,6 +109,7 @@ class EReferralService extends BaseService {
CREATE_E_REFERRAL /*'Services/Patients.svc/REST/CreateEReferral'*/,
onSuccess: (dynamic response, int statusCode) {
// TODO Waiting for fix service
_referralNumber = response['ReferralNumber'].toString();
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -104,6 +104,16 @@ class HomeHealthCareService extends BaseService {
}, body: updatePresOrderRequestModel.toJson());
}
Future updateHHCPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false;
await baseAppClient.post(UPDATE_HHC_ORDER_RC, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: updatePresOrderRequestModel.toJson());
}
Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async {
hasError = false;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) {

@ -115,7 +115,7 @@ class BaseAppClient {
}
// body['PatientID'] = 1018977;
// body['TokenID'] = "@dm!n";
body['TokenID'] = "@dm!n";
print("URL : $url");
final jsonBody = json.encode(body);

@ -71,7 +71,8 @@ class HomeHealthCareViewModel extends BaseViewModel {
Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
setState(ViewState.Busy);
await _homeHealthCareService.updateHHCPresOrder(updatePresOrderRequestModel);
// await _homeHealthCareService.updateHHCPresOrder(updatePresOrderRequestModel);
await _homeHealthCareService.updateHHCPresOrderRC(updatePresOrderRequestModel);
if (_homeHealthCareService.hasError) {
error = _homeHealthCareService.error;
setState(ViewState.ErrorLocal);

@ -21,7 +21,7 @@ class EReferralViewModel extends BaseViewModel {
List<GetAllCitiesResponseModel> get allCities => _eReferralService.allCities;
List<SearchEReferralResponseModel> get allReferral => _eReferralService.allReferral;
String get referralNumber => _eReferralService.referralNumber;
void getRelationTypes() async {
setState(ViewState.Busy);

@ -0,0 +1,42 @@
class WeeklyStepsResModel {
int iD;
int patientID;
int medCategoryID;
int medSubCategoryID;
num value;
String machineDate;
bool patientOutSA;
dynamic notes;
bool isActive;
String createdOn;
WeeklyStepsResModel({this.iD, this.patientID, this.medCategoryID, this.medSubCategoryID, this.value, this.machineDate, this.patientOutSA, this.notes, this.isActive, this.createdOn});
WeeklyStepsResModel.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
patientID = json['PatientID'];
medCategoryID = json['MedCategoryID'];
medSubCategoryID = json['MedSubCategoryID'];
value = num.tryParse(json['Value']).toInt();
machineDate = json['MachineDate'];
patientOutSA = json['PatientOutSA'];
notes = json['Notes'];
isActive = json['IsActive'];
createdOn = json['CreatedOn'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ID'] = this.iD;
data['PatientID'] = this.patientID;
data['MedCategoryID'] = this.medCategoryID;
data['MedSubCategoryID'] = this.medSubCategoryID;
data['Value'] = this.value;
data['MachineDate'] = this.machineDate;
data['PatientOutSA'] = this.patientOutSA;
data['Notes'] = this.notes;
data['IsActive'] = this.isActive;
data['CreatedOn'] = this.createdOn;
return data;
}
}

@ -1,5 +1,5 @@
class YearlyStepsResModel {
double valueSum;
num valueSum;
int medCategoryID;
int month;
String monthName;
@ -21,6 +21,7 @@ class YearlyStepsResModel {
monthName = json['MonthName'];
patientID = json['PatientID'];
year = json['Year'];
valueSum = valueSum != null ? valueSum.toInt() : valueSum;
}
Map<String, dynamic> toJson() {

@ -36,6 +36,7 @@ class NewEReferralStepOnePage extends StatefulWidget {
class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
TextEditingController _nameTextController = TextEditingController();
TextEditingController _requesterRelationTextController = TextEditingController();
GetAllRelationshipTypeResponseModel _selectedRelation;
String email;
@ -166,6 +167,11 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
),
),
),
SizedBox(
height: 12,
),
if (_selectedRelation != null && _selectedRelation.iD == 5)
inputWidget(TranslationBase.of(context).requesterRelationship, "", _requesterRelationTextController, isInputTypeNum: false),
],
),
),
@ -180,7 +186,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
width: double.infinity,
child: DefaultButton(
TranslationBase.of(context).next,
(_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty)
(_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty || (_selectedRelation.iD == 5 && _requesterRelationTextController.text.isEmpty))
? null
: () async {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
@ -222,7 +228,8 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
Navigator.of(context).pop();
widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName = _nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + mobileNo;
widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString() + mobileNo;
widget.createEReferralRequestModel.otherRelationship = _requesterRelationTextController.text;
widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD;
}
});

@ -7,11 +7,11 @@ import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -22,7 +22,6 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../dialogs/select_city_dialog.dart';
@ -111,11 +110,10 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
fontWeight: FontWeight.w600,
),
),
...List.generate(
medicalReportImages.length,
(index) => Container(
padding: EdgeInsets.only(top: 6,bottom: 6),
padding: EdgeInsets.only(top: 6, bottom: 6),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
@ -154,7 +152,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
);
},
child: Padding(
padding: EdgeInsets.only(top: 12,bottom: 12),
padding: EdgeInsets.only(top: 12, bottom: 12),
child: Text(
TranslationBase.of(context).selectAttachment,
style: TextStyle(
@ -257,10 +255,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
Padding(
padding: const EdgeInsets.all(5.0),
child: Text(
TranslationBase.of(context).insuredPatientReferral, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600
),
TranslationBase.of(context).insuredPatientReferral,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600),
),
),
],
@ -297,11 +293,10 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
fontWeight: FontWeight.w600,
),
),
...List.generate(
insuredPatientImages.length,
(index) => Container(
padding: EdgeInsets.only(top: 6,bottom: 6),
padding: EdgeInsets.only(top: 6, bottom: 6),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
@ -339,7 +334,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
});
},
child: Padding(
padding: const EdgeInsets.only(top: 12,bottom: 12),
padding: const EdgeInsets.only(top: 12, bottom: 12),
child: Text(
TranslationBase.of(context).selectAttachment,
style: TextStyle(
@ -378,16 +373,23 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length != 0 ? insuredPatientImages[0] : null;
this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured;
// ToDo make the preferred Branch info dynamic
this.widget.createEReferralRequestModel.preferredBranchCode = num.tryParse(projectDropdownValue.split(",")[0]);
this.widget.createEReferralRequestModel.preferredBranchName = projectDropdownValue.split(",")[1];
this.widget.createEReferralRequestModel.otherRelationship = "";
this.widget.createEReferralRequestModel.preferredBranchCode = projectDropdownValue != null && projectDropdownValue.isNotEmpty ? num.tryParse(projectDropdownValue.split(",")[0]) : 0;
this.widget.createEReferralRequestModel.preferredBranchName = projectDropdownValue != null && projectDropdownValue.isNotEmpty ? projectDropdownValue.split(",")[1] : "";
// this.widget.createEReferralRequestModel.otherRelationship = "";
await model.createEReferral(this.widget.createEReferralRequestModel);
if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(model.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).ereferralSaveSuccess);
// AppToast.showSuccessToast(message: TranslationBase.of(context).ereferralSaveSuccess);
showCMCConfirmDialog(
context,
model.referralNumber,
onClick: () {
Navigator.pop(context);
},
);
}
});
},
@ -469,7 +471,6 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
);
}
String getRelationName() {
if (_selectedCity != null)
return _selectedCity.description;

@ -180,7 +180,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
this.widget.changePageViewIndex(2);
this.widget.createEReferralRequestModel.identificationNo = int.parse(_patientIdentificationTextController.text);
this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text;
this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1) + mobileNo;
this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString() + mobileNo;
this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString();
this.widget.createEReferralRequestModel.cityName = _selectedCity.description;
},

@ -31,8 +31,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
width: double.infinity,
child: Container(
decoration: cardRadius(12),
margin:
EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
@ -40,13 +39,7 @@ class _ReferralDetailsState extends State<ReferralDetails> {
children: [
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(
TranslationBase.of(context).ereferral,
style: TextStyle(
letterSpacing: -0.64,
color: Colors.black,
fontSize: 18.0,
fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).ereferral, style: TextStyle(letterSpacing: -0.64, color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.bold)),
),
Container(
width: double.infinity,
@ -54,15 +47,10 @@ class _ReferralDetailsState extends State<ReferralDetails> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).referralStatus),
child: _getNormalText(TranslationBase.of(context).referralStatus),
),
Expanded(
child: _getNormalText(
projectViewModel.isArabic
? widget.referral.statusAr
: widget.referral.status,
isBold: true),
child: _getNormalText(projectViewModel.isArabic ? widget.referral.statusAr : widget.referral.status, isBold: true),
)
],
),
@ -74,13 +62,10 @@ class _ReferralDetailsState extends State<ReferralDetails> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).patientName),
child: _getNormalText(TranslationBase.of(context).patientName),
),
Expanded(
child: _getNormalText(
widget.referral.patientName,
isBold: true),
child: _getNormalText(widget.referral.patientName, isBold: true),
)
],
),
@ -92,13 +77,10 @@ class _ReferralDetailsState extends State<ReferralDetails> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).referralNumber),
child: _getNormalText(TranslationBase.of(context).referralNumber),
),
Expanded(
child: _getNormalText(
widget.referral.referralNumber.toString(),
isBold: true),
child: _getNormalText(widget.referral.referralNumber.toString(), isBold: true),
)
],
),
@ -110,15 +92,10 @@ class _ReferralDetailsState extends State<ReferralDetails> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).referralDate),
child: _getNormalText(TranslationBase.of(context).referralDate),
),
Expanded(
child: _getNormalText(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDateNoTimeZone(
widget.referral.referralDate)),
isBold: true),
child: _getNormalText(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(widget.referral.referralDate)), isBold: true),
)
],
),
@ -130,13 +107,10 @@ class _ReferralDetailsState extends State<ReferralDetails> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).hospital),
child: _getNormalText(TranslationBase.of(context).hospital),
),
Expanded(
child: _getNormalText(
widget.referral.preferredBranchName,
isBold: true),
child: _getNormalText(widget.referral.preferredBranchName ?? "", isBold: true),
)
],
),

@ -1,17 +1,15 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart';
@ -66,14 +64,14 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
@override
Widget build(BuildContext context) {
void showConfirmMessage(HomeHealthCareViewModel model, GetOrderDetailByOrderIDResponseModel order) {
void showConfirmMessage(HomeHealthCareViewModel model, GetCMCAllOrdersResponseModel order) {
showDialog(
context: context,
child: ConfirmCancelOrderDialog(
model: model,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () async {
model.setState(ViewState.Busy);
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
@ -195,7 +193,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2)
InkWell(
onTap: () {
showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
showConfirmMessage(widget.model, widget.model.pendingOrder);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),

@ -90,7 +90,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
} else if (status == 3) {
//completed
_color = Color(0xff359846);
} else if (status == 4) {
} else if (status == 4 || status == 6 || status == 7) {
//cancel // Rejected
_color = Color(0xffD02127);
}

@ -48,29 +48,29 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
initialiseHmgServices(bool isLogin) {
hmgServices.clear();
hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCareTitle, TranslationBase.of(context).liveCareSubtitle, "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin));
hmgServices.add(new HmgServices(2, TranslationBase.of(context).onlinePayment, TranslationBase.of(context).onlinePaymentSubtitle, "assets/images/new/paymentMethods.png", isLogin));
hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin));
hmgServices.add(new HmgServices(4, TranslationBase.of(context).cmcTitle, TranslationBase.of(context).cmcSubtitle, "assets/images/new/comprehensive_checkup.svg", isLogin));
hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin));
hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin));
hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin));
hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin));
hmgServices.add(new HmgServices(8, TranslationBase.of(context).findUs, TranslationBase.of(context).reachUs, "assets/images/new/reach_us.svg", isLogin));
hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFile, TranslationBase.of(context).My_File_Details, "assets/images/new/medical file.svg", isLogin));
hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointment, "assets/images/new/book appointment.svg", isLogin));
hmgServices.add(new HmgServices(11, TranslationBase.of(context).online, TranslationBase.of(context).pharmacy, "assets/images/new/Pharmacy.svg", isLogin));
hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin));
hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin));
hmgServices.add(new HmgServices(11, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin));
hmgServices.add(new HmgServices(12, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin));
hmgServices.add(new HmgServices(13, TranslationBase.of(context).myFamily, TranslationBase.of(context).Family_Files, "assets/images/new/my family.svg", isLogin));
hmgServices.add(new HmgServices(13, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin));
hmgServices.add(new HmgServices(14, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin));
hmgServices.add(new HmgServices(15, TranslationBase.of(context).Todo, TranslationBase.of(context).list, "assets/images/new/todo.svg", isLogin));
hmgServices.add(new HmgServices(16, TranslationBase.of(context).Blood, TranslationBase.of(context).Donation, "assets/images/new/blood donation.svg", isLogin));
hmgServices.add(new HmgServices(17, TranslationBase.of(context).Health, TranslationBase.of(context).Calculator, "assets/images/new/health calculator.svg", isLogin));
hmgServices.add(new HmgServices(18, TranslationBase.of(context).Health, TranslationBase.of(context).Converter, "assets/images/new/health converter.svg", isLogin));
hmgServices.add(new HmgServices(19, TranslationBase.of(context).Smart, TranslationBase.of(context).Watches, "assets/images/new/smart watch.svg", isLogin));
hmgServices.add(new HmgServices(20, TranslationBase.of(context).Parking, TranslationBase.of(context).Details, "assets/images/new/parking details.svg", isLogin));
hmgServices.add(new HmgServices(17, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin));
hmgServices.add(new HmgServices(18, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin));
hmgServices.add(new HmgServices(19, TranslationBase.of(context).smartWatches.split(" ")[0], TranslationBase.of(context).smartWatches.split(" ")[1], "assets/images/new/smart watch.svg", isLogin));
hmgServices.add(new HmgServices(20, TranslationBase.of(context).parkingTitle2, TranslationBase.of(context).parkingSubtitle, "assets/images/new/parking details.svg", isLogin));
hmgServices.add(new HmgServices(21, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin));
hmgServices.add(new HmgServices(22, TranslationBase.of(context).News, TranslationBase.of(context).Latest, "assets/images/new/latest news.svg", isLogin));
hmgServices.add(new HmgServices(22, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin));
}
@override
@ -90,7 +90,7 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
child: Column(
children: [
AspectRatio(
aspectRatio: 1.8,
aspectRatio: 1.9,
child: Container(
width: double.infinity,
height: double.infinity,
@ -106,7 +106,7 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
? Color(0xFFFECB50)
: Color(0xFF122F48)),
child: Padding(
padding: const EdgeInsets.all(30.0),
padding: const EdgeInsets.all(20.0),
child: Stack(
alignment: projectViewModel.isArabic ? Alignment.centerLeft : Alignment.centerRight,
children: [
@ -118,7 +118,7 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
child: Text(
weather,
style: TextStyle(
fontSize: 30,
fontSize: 24,
letterSpacing: -0.83,
fontWeight: FontWeight.bold,
color: Colors.white,
@ -134,11 +134,11 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
color: Colors.white,
),
),
mFlex(1),
mFlex(0),
Text(
TranslationBase.of(context).healthWeatherIndicators,
style: TextStyle(
fontSize: 16,
fontSize: 12,
letterSpacing: -0.96,
fontWeight: FontWeight.bold,
color: Colors.white,
@ -147,7 +147,7 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
Text(
TranslationBase.of(context).healthTipsBasedOnCurrentWeather,
style: TextStyle(
fontSize: 12,
fontSize: 10,
letterSpacing: -0.72,
fontWeight: FontWeight.w600,
color: Colors.white,
@ -163,7 +163,7 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
);
},
child: Padding(
padding: const EdgeInsets.only(top: 8, bottom: 8),
padding: const EdgeInsets.only(top: 0, bottom: 0),
child: Text(
TranslationBase.of(context).moreDetails,
style: TextStyle(fontSize: 12, letterSpacing: -0.72, fontWeight: FontWeight.w600, color: Colors.white, decoration: TextDecoration.underline),

@ -50,7 +50,7 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
? SingleChildScrollView(
child: Column(children: [
AspectRatio(
aspectRatio: 1.8,
aspectRatio: 2.3,
child: Container(
width: double.infinity,
height: double.infinity,
@ -66,7 +66,7 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
? Color(0xFFFECB50)
: Color(0xFF122F48)),
child: Padding(
padding: const EdgeInsets.all(30.0),
padding: const EdgeInsets.all(20.0),
child: Stack(
alignment: projectViewModel.isArabic ? Alignment.centerLeft : Alignment.centerRight,
children: [
@ -78,7 +78,7 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
child: Text(
weather,
style: TextStyle(
fontSize: 30,
fontSize: 24,
letterSpacing: -0.83,
fontWeight: FontWeight.bold,
color: Colors.white,
@ -94,11 +94,11 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
color: Colors.white,
),
),
mFlex(1),
mFlex(0),
Text(
TranslationBase.of(context).healthWeatherIndicators,
style: TextStyle(
fontSize: 16,
fontSize: 12,
letterSpacing: -0.96,
fontWeight: FontWeight.bold,
color: Colors.white,
@ -107,7 +107,7 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
Text(
TranslationBase.of(context).healthTipsBasedOnCurrentWeather,
style: TextStyle(
fontSize: 12,
fontSize: 10,
letterSpacing: -0.72,
fontWeight: FontWeight.w600,
color: Colors.white,

@ -56,7 +56,26 @@ class NotificationsPage extends StatelessWidget {
GifLoaderDialogUtils.hideDialog(context);
},
child: Center(
child: Image.asset('assets/images/notf.png'),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Image.asset('assets/images/notf.png'),
Icon(
Icons.notifications_active,
color: CustomColors.accentColor,
size: 40,
),
Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Text(TranslationBase.of(context).moreNotifications, style: TextStyle(
color: CustomColors.accentColor,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
decoration: TextDecoration.underline
)),
),
],
),
),
);
}
@ -154,91 +173,6 @@ class NotificationsPage extends StatelessWidget {
);
},
itemCount: model.notifications.length + 1)),
// ListView(
// children: model.notifications
// .map(
// (notification) => InkWell(
// onTap: () async {
// if (!notification.isRead) {
// model.markAsRead(notification.id);
// }
// Navigator.push(
// context,
// FadePage(
// page: NotificationsDetailsPage(
// notification: notification,
// )));
// },
// child: Container(
// width: double.infinity,
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: notification.isRead ? CustomColors.white : CustomColors.accentColor.withOpacity(0.05),
// border: Border(
// left: BorderSide(
// color: notification.isRead ? Colors.grey[200] : CustomColors.accentColor,
// width: 5.0,
// ),
// ),
// ),
// child: Row(
// children: <Widget>[
// Expanded(
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)),
// SizedBox(
// height: 5,
// ),
// Row(
// children: [
// Expanded(
// child: Texts(notification.message)),
// if (notification.messageType == "image")
// Icon(FontAwesomeIcons.images, color: CustomColors.grey,)
// ],
// ),
// SizedBox(
// height: 5,
// ),
// Divider(
// height: 5.0,
// color: CustomColors.grey2,
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// ),
// )
// .toList()
// ..add(
// InkWell(
// onTap: () async {
// GifLoaderDialogUtils.showMyDialog(context);
// currentIndex++;
// GetNotificationsRequestModel
// getNotificationsRequestModel =
// new GetNotificationsRequestModel(
// currentPage: currentIndex,
// pagingSize: 14,
// notificationStatusID: 2);
//
// await model.getNotifications(
// getNotificationsRequestModel, context);
// GifLoaderDialogUtils.hideDialog(context);
// },
// child: Center(
// child: Image.asset('assets/images/notf.png'),
// ),
// ),
// )),
);
}
}

@ -53,14 +53,14 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
initialiseHmgServices(bool isLogin) {
hmgServices.clear();
hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCareTitle, TranslationBase.of(context).liveCareSubtitle, "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin));
hmgServices.add(new HmgServices(2, TranslationBase.of(context).onlinePayment, TranslationBase.of(context).onlinePaymentSubtitle, "assets/images/new/paymentMethods.png", isLogin));
hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin));
hmgServices.add(new HmgServices(4, TranslationBase.of(context).cmcTitle, TranslationBase.of(context).cmcSubtitle, "assets/images/new/comprehensive_checkup.svg", isLogin));
hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin));
hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin));
hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin));
hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin));
hmgServices.add(new HmgServices(8, TranslationBase.of(context).findUs, TranslationBase.of(context).reachUs, "assets/images/new/reach_us.svg", isLogin));
}
@ -496,7 +496,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
Container(
width: double.infinity,
height: double.infinity,
padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.4),
padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.3),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
@ -515,7 +515,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
TranslationBase.of(context).onlinePharmacy,
TranslationBase.of(context).pharmacyTitle,
style: TextStyle(
color: Colors.black,
fontSize: 14,
@ -526,7 +526,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
),
projectViewModel.isArabic ? mHeight(5) : Container(),
Text(
TranslationBase.of(context).ecommerceSolution,
TranslationBase.of(context).pharmacySubtitle,
style: TextStyle(
color: Colors.black,
fontSize: 9,

@ -66,7 +66,7 @@ class _HomePageState2 extends State<HomePage2> {
} else {
GifLoaderDialogUtils.showMyDialog(context);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if (pharmacyModuleViewModel.error.isNotEmpty) {
if (!pharmacyModuleViewModel.error.isNotEmpty) {
await pharmacyModuleViewModel.createUser().then((value) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: LandingPagePharmacy()));

@ -276,7 +276,7 @@ class _Login extends State<Login> {
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).push(FadePage(page: RegisterNew())),
},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
cancelFunction: () => {});
dialog.showAlertDialog(context);
});
// SMSOTP.showLoadingDialog(context, false),

@ -150,7 +150,9 @@ class _Register extends State<Register> {
)),
bottomSheet: Container(
width: double.maxFinite,
height: 80.0,
// height: 80.0,
color: Colors.white,
margin: EdgeInsets.only(bottom: 50.0),
child: Row(
children: [
Expanded(

@ -0,0 +1,426 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/SmartWatch/WeeklyStepsResModel.dart';
import 'package:diplomaticquarterapp/models/SmartWatch/YearlyStepsResModel.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class StepsTracker extends StatefulWidget {
@override
_StepsTrackerState createState() => _StepsTrackerState();
}
class _StepsTrackerState extends State<StepsTracker> with SingleTickerProviderStateMixin {
TabController _tabController;
ProjectViewModel projectViewModel;
int weeklyStatsAvgValue = 0;
int monthlyStatsAvgValue = 0;
int yearlyStatsAvgValue = 0;
int avgWeeklyStepsValue = 0;
int weeklyDataLength = 0;
int avgMonthlyStepsValue = 0;
int monthlyDataLength = 0;
int avgYearlyStepsValue = 0;
int yearlyDataLength = 0;
List<WeeklyStepsResModel> weekyStepsList = List();
List<YearlyStepsResModel> yearlyStepsList = List();
List<TimeSeriesSales2> weeklyTimeSeriesData = [];
List<TimeSeriesSales2> monthlyTimeSeriesData = [];
List<TimeSeriesSales2> yearlyTimeSeriesData = [];
bool isWeeklyDataLoaded = false;
bool isMonthlyDataLoaded = false;
bool isYearlyDataLoaded = false;
@override
void initState() {
_tabController = new TabController(length: 3, vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) {
// getYearlyStepsData();
getWeeklyStepsData();
});
super.initState();
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).steps,
showNewAppBar: true,
showNewAppBarTitle: true,
isShowDecPage: false,
body: Column(
mainAxisSize: MainAxisSize.min,
children: [
TabBar(
controller: _tabController,
indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 0, bottom: 0, left: 20, right: 20),
labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [
Tab(text: TranslationBase.of(context).weekly),
Tab(text: TranslationBase.of(context).monthly),
Tab(text: TranslationBase.of(context).yearly),
],
onTap: (value) {
if (value == 0) {
getWeeklyStepsData();
} else if (value == 1) {
} else {
getYearlyStepsData();
}
},
),
Expanded(
child: new TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
isWeeklyDataLoaded ? getWeeklyStepsDetails() : Container(),
isMonthlyDataLoaded ? getMonthlyStepsDetails() : Container(),
isYearlyDataLoaded ? getYearlyStepsDetails() : Container()
],
controller: _tabController,
),
),
],
),
);
}
getWeeklyStepsData() {
avgWeeklyStepsValue = 0;
weeklyDataLength = 0;
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientHealthDataStats(6, 1, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['Med_GetYearStepsTransactionsStsList']);
weekyStepsList.clear();
res['Med_GetWeekStepsTransactionsStsList'].forEach((element) {
weekyStepsList.add(new WeeklyStepsResModel.fromJson(element));
if (element['Value'] != null) {
num value = num.tryParse(element['Value'] ?? "0");
avgWeeklyStepsValue += value.toInt();
weeklyDataLength++;
}
});
generateWeekData();
setState(() {
weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength;
isWeeklyDataLoaded = true;
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
getMonthlyStepsData() {}
getYearlyStepsData() {
avgYearlyStepsValue = 0;
yearlyDataLength = 0;
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientHealthDataStats(6, 3, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['Med_GetYearStepsTransactionsStsList']);
yearlyStepsList.clear();
res['Med_GetYearStepsTransactionsStsList'].forEach((element) {
yearlyStepsList.add(new YearlyStepsResModel.fromJson(element));
if (element['ValueSum'] != null) {
num value = element['ValueSum'];
avgYearlyStepsValue += value.toInt();
yearlyDataLength++;
}
});
generateYearData();
setState(() {
yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength;
isYearlyDataLoaded = true;
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
generateWeekData() {
if (weekyStepsList.length > 0) {
weeklyTimeSeriesData.clear();
weekyStepsList.forEach(
(element) {
weeklyTimeSeriesData.add(
TimeSeriesSales2(
DateUtil.convertStringToDate(element.machineDate),
element.value != null ? element.value : 0.0,
),
);
},
);
}
}
generateYearData() {
if (yearlyStepsList.length > 0) {
yearlyTimeSeriesData.clear();
yearlyStepsList.forEach(
(element) {
yearlyTimeSeriesData.add(
TimeSeriesSales2(
new DateTime(element.year, element.month, 1),
element.valueSum != null ? double.tryParse(element.valueSum.toString()) : 0.0,
),
);
},
);
}
}
getWeeklyStepsDetails() {
return SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
child: ShowChart(
title: "",
timeSeries: weeklyTimeSeriesData,
indexes: weeklyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8,
),
),
Container(
child: Container(
decoration: cardRadius(12),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 5.0),
child: Text(TranslationBase.of(context).avgSteps, style: TextStyle(fontSize: 18.0)),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(weeklyStatsAvgValue.toString() + " " + TranslationBase.of(context).steps, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
),
),
Container(
decoration: cardRadius(12),
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(TranslationBase.of(context).details,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
)),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
weekyStepsList.isEmpty
? Container(
child: Center(
child: Text(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullDataWeekly(context),
),
],
),
)
],
),
),
],
),
);
}
getMonthlyStepsDetails() {
return Container(
child: Text("Monthly"),
);
}
getYearlyStepsDetails() {
return SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
child: ShowChart(
title: "",
timeSeries: yearlyTimeSeriesData,
indexes: yearlyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8,
),
),
Container(
child: Container(
decoration: cardRadius(12),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 5.0),
child: Text(TranslationBase.of(context).avgSteps, style: TextStyle(fontSize: 18.0)),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(yearlyStatsAvgValue.toString() + " " + TranslationBase.of(context).steps, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
),
),
Container(
decoration: cardRadius(12),
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(TranslationBase.of(context).details,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
)),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
yearlyStepsList.isEmpty
? Container(
child: Center(
child: Text(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context),
),
],
),
)
],
),
),
],
),
);
}
List<TableRow> fullData(BuildContext context) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Utils.tableColumnTitle(TranslationBase.of(context).date),
Utils.tableColumnTitle(TranslationBase.of(context).steps),
],
),
);
yearlyStepsList.forEach(
(step) {
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
new DateTime(step.year, step.month, 1),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),
Utils.tableColumnValue(step.valueSum.toString(), isCapitable: false, mProjectViewModel: projectViewModel),
],
),
);
},
);
return tableRow;
}
List<TableRow> fullDataWeekly(BuildContext context) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Utils.tableColumnTitle(TranslationBase.of(context).date),
Utils.tableColumnTitle(TranslationBase.of(context).steps),
],
),
);
weekyStepsList.forEach(
(step) {
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(step.machineDate),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),
Utils.tableColumnValue(step.value.toString(), isCapitable: false, mProjectViewModel: projectViewModel),
],
),
);
},
);
return tableRow;
}
}

@ -1,6 +1,9 @@
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/stepsTracker.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/Steps/stepsTracker.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
// import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart';
@ -10,7 +13,6 @@ class HealthDataList extends StatefulWidget {
}
class _HealthDataListState extends State<HealthDataList> {
// List<DataType> dataTypes = List();
@override
@ -27,191 +29,134 @@ class _HealthDataListState extends State<HealthDataList> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "Smartwatches",
isShowAppBar: true,
body: Container(
height: MediaQuery
.of(context)
.size
.height,
margin: EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Heart Rate",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/sleep_data.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Sleep Data",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: StepsTracker(),
),
);
},
child: Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Steps",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
appBarTitle: TranslationBase.of(context).smartWatches,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Container(
height: MediaQuery.of(context).size.height,
margin: EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0),
),
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Distance",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Heart Rate", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset("assets/images/SmartWatches/sleep_data.png", width: 60.0, height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Sleep Data", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: StepsTracker(),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
);
},
child: Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Energy",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
child: Text("Steps", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
],
),
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery
.of(context)
.size
.height * 0.1,
color: Colors.grey[100],
child: Column(
children: <Widget>[
),
Divider(
color: Colors.transparent,
color: Colors.grey[500],
),
InkWell(
onTap: () {
print("ReadLast");
// readLast();
},
child:Container(
height: (MediaQuery
.of(context)
.size
.height/2)*0.12,
width: MediaQuery
.of(context)
.size
.width * 0.8,
decoration: BoxDecoration(
color: Colors.grey[800],
borderRadius: BorderRadius.circular(6.0),
Row(
children: [
Container(
child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0),
),
child: Container(
padding: EdgeInsets.only(top: 10.0),
child: Text(
'Sync Health Data' , textAlign: TextAlign.center,style: TextStyle(
color: Colors.white , fontSize: 18.0
),
),
),),),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Distance", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Energy", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
],
),
));
),
),
bottomSheet: Container(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton(TranslationBase.of(context).syncHealthData, () {
print("ReadLast");
// readLast();
}),
),
),
);
}
// void readLast() async {
// print("ReadLast");
// final result = await FitKit.readLast(DataType.DISTANCE);
// print(result);
// print(result);
// }
//
// void readAll() async {
// if (await FitKit.requestPermissions(dataTypes)) {
// for (DataType type in dataTypes) {
// final results = await FitKit.read(
// type,
// dateFrom: DateTime.now().subtract(Duration(days: 7)),
// dateTo: DateTime.now(),
// limit: 100,
// );
// print(results);
// print(results.length);
// }
// readLast();
// }
// }
}
// void readLast() async {
// print("ReadLast");
// final result = await FitKit.readLast(DataType.DISTANCE);
// print(result);
// print(result);
// }
//
// void readAll() async {
// if (await FitKit.requestPermissions(dataTypes)) {
// for (DataType type in dataTypes) {
// final results = await FitKit.read(
// type,
// dateFrom: DateTime.now().subtract(Duration(days: 7)),
// dateTo: DateTime.now(),
// limit: 100,
// );
// print(results);
// print(results.length);
// }
// readLast();
// }
// }
}

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchI
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
@ -37,9 +38,11 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "Sync Health Data",
appBarTitle: TranslationBase.of(context).smartWatches,
isShowAppBar: true,
isShowDecPage: true,
showNewAppBar: true,
showNewAppBarTitle: true,
description: TranslationBase.of(context).infoHealthData,
imagesInfo: [
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/0.png'),
@ -56,9 +59,10 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
Flexible(
// margin: EdgeInsets.only(top: 10.0),
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(
@ -85,8 +89,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Text("Supported Smartwatches",
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
fontFamily: "WorkSans")),
fontWeight: FontWeight.bold)),
),
Container(
child: Row(
@ -371,7 +374,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
),
Container(
margin: EdgeInsets.fromLTRB(
15.0, 110.0, 15.0, 15.0),
15.0, 80.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
@ -854,6 +857,10 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
_openHealthDataList() {
Navigator.push(
context, MaterialPageRoute(builder: (context) => HealthDataList()));
context,
FadePage(
page: HealthDataList(),
),
);
}
}

@ -1,249 +0,0 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/models/SmartWatch/YearlyStepsResModel.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class StepsTracker extends StatefulWidget {
@override
_StepsTrackerState createState() => _StepsTrackerState();
}
class _StepsTrackerState extends State<StepsTracker>
with SingleTickerProviderStateMixin {
TabController _tabController;
int weeklyStatsAvgValue = 0;
int monthlyStatsAvgValue = 0;
int yearlyStatsAvgValue = 0;
int avgStepsValue = 0;
int dataLength = 0;
List<YearlyStepsResModel> yearlyStepsList = List();
List<TimeSeriesSales> yearlyTimeSeriesData = [];
bool isDataLoaded = false;
@override
void initState() {
_tabController = new TabController(length: 3, vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) {
getYearlyStepsData();
});
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: "Steps",
isShowDecPage: false,
body: Container(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TabBar(
tabs: [
Tab(text: TranslationBase.of(context).weekly),
Tab(text: TranslationBase.of(context).monthly),
Tab(text: TranslationBase.of(context).yearly),
],
controller: _tabController,
),
Expanded(
child: new TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
isDataLoaded ? getWeeklyStepsDetails() : Container(),
isDataLoaded ? getMonthlyStepsDetails() : Container(),
isDataLoaded ? getYearlyStepsDetails() : Container()
],
controller: _tabController,
),
),
],
),
),
);
}
getYearlyStepsData() {
avgStepsValue = 0;
dataLength = 0;
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientHealthDataStats(6, 3, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['Med_GetYearStepsTransactionsStsList']);
yearlyStepsList.clear();
res['Med_GetYearStepsTransactionsStsList'].forEach((element) {
print('in forEach');
yearlyStepsList.add(new YearlyStepsResModel.fromJson(element));
if (element['ValueSum'] != null) {
double value = element['ValueSum'];
avgStepsValue += value.toInt();
dataLength++;
}
});
print("innnnnnnnnnnnnnnnn");
print(avgStepsValue);
print(dataLength);
setState(() {
yearlyStatsAvgValue = avgStepsValue ~/ dataLength;
isDataLoaded = true;
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
// AppToast.showErrorToast(message: err);
print(err);
});
}
generateData() {
if (yearlyStepsList.length > 0) {
yearlyTimeSeriesData.clear();
yearlyStepsList.forEach(
(element) {
yearlyTimeSeriesData.add(
TimeSeriesSales(
new DateTime(element.year, element.month, 1),
element.valueSum != null ? element.valueSum.toInt() : 0,
),
);
},
);
yearlyTimeSeriesData.forEach((element) {
print(element.sales);
print(element.time);
});
}
return [
new charts.Series<TimeSeriesSales, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (TimeSeriesSales sales, _) => sales.time,
measureFn: (TimeSeriesSales sales, _) => sales.sales,
data: yearlyTimeSeriesData,
)
];
}
getWeeklyStepsDetails() {
return Container(
child: Text("Weekly"),
);
}
getMonthlyStepsDetails() {
return Container(
child: Text("Monthly"),
);
}
getYearlyStepsDetails() {
return Container(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
child: AppTimeSeriesChart(
seriesList: generateData(),
chartName: "Steps",
startDate: DateTime(
yearlyStepsList[0].year, yearlyStepsList[0].month, 1),
endDate: DateTime(
yearlyStepsList[yearlyStepsList.length - 1].year,
yearlyStepsList[yearlyStepsList.length - 1].month,
1),
),
),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Colors.grey[400], width: 0.6)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 15.0),
child:
Text("Average Steps", style: TextStyle(fontSize: 18.0)),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(yearlyStatsAvgValue.toString() + " Steps",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
),
),
Container(
margin: EdgeInsets.all(10.0),
child: Divider(
color: Colors.grey[500],
),
),
Container(
transform: Matrix4.translationValues(0.0, -10.0, 0.0),
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("History", style: TextStyle(fontSize: 14.0)),
Row(
children: [
Text("view more", style: TextStyle(fontSize: 14.0)),
Container(
margin: EdgeInsets.only(left: 3.0, right: 3.0),
transform: Matrix4.translationValues(0.0, 1.5, 0.0),
width: 30.0,
height: 30.0,
child: Image.asset(
"assets/images/new-design/view_more.png",
fit: BoxFit.contain),
),
],
),
],
),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Colors.grey[400], width: 0.6)),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 15.0),
child: Text("Date",
style: TextStyle(
fontSize: 18.0, fontWeight: FontWeight.bold)),
),
Container(
padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 0.0),
child: Text("Steps", style: TextStyle(fontSize: 18.0)),
),
],
),
),
),
],
),
);
}
}

@ -1761,7 +1761,9 @@ class TranslationBase {
String get referralNumber => localizedValues['referralNumber'][locale.languageCode];
String get needPrescription => localizedValues['needPrescription'][locale.languageCode];
String get outOfStockMsg => localizedValues['outOfStockMsg'][locale.languageCode];
String get requestID => localizedValues['requestID'][locale.languageCode];
String get OrderStatus => localizedValues['OrderStatus'][locale.languageCode];
@ -1799,8 +1801,11 @@ class TranslationBase {
String get quantitySize => localizedValues['quantitySize'][locale.languageCode];
String get addToCart => localizedValues['addToCart'][locale.languageCode];
String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode];
String get removeFromWishlist => localizedValues['removeFromWishlist'][locale.languageCode];
String get buyNow => localizedValues['buyNow'][locale.languageCode];
String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode];
@ -2475,10 +2480,52 @@ class TranslationBase {
String get Latest => localizedValues["Latest"][locale.languageCode];
String get Tour => localizedValues["Tour"][locale.languageCode];
String get mostViewed => localizedValues["mostViewed"][locale.languageCode];
String get newProducts => localizedValues["newProducts"][locale.languageCode];
String get enterDetails => localizedValues["enterDetails"][locale.languageCode];
String get paymentSelected => localizedValues["paymentSelected"][locale.languageCode];
String get moreNotifications => localizedValues["moreNotifications"][locale.languageCode];
String get familyTitle => localizedValues["familyTitle"][locale.languageCode];
String get familySubtitle => localizedValues["familySubtitle"][locale.languageCode];
String get liveCareTitle => localizedValues["liveCareTitle"][locale.languageCode];
String get liveCareSubtitle => localizedValues["liveCareSubtitle"][locale.languageCode];
String get pharmacyTitle => localizedValues["pharmacyTitle"][locale.languageCode];
String get pharmacySubtitle => localizedValues["pharmacySubtitle"][locale.languageCode];
String get parkingTitle2 => localizedValues["parkingTitle2"][locale.languageCode];
String get parkingSubtitle => localizedValues["ParkingSubtitle"][locale.languageCode];
String get healthCalculatorTitle => localizedValues["healthCalculatorTitle"][locale.languageCode];
String get healthCalculatorSubtitle => localizedValues["healthCalculatorSubtitle"][locale.languageCode];
String get waterTitle => localizedValues["waterTitle"][locale.languageCode];
String get waterSubtitle => localizedValues["waterSubtitle"][locale.languageCode];
String get medicalFileTitle2 => localizedValues["medicalFileTitle2"][locale.languageCode];
String get medicalFileSubtitle => localizedValues["medicalFileSubtitle"][locale.languageCode];
String get healthConvertersTitle => localizedValues["healthConvertersTitle"][locale.languageCode];
String get healthConvertersSubtitle => localizedValues["healthConvertersSubtitle"][locale.languageCode];
String get syncHealthData => localizedValues["syncHealthData"][locale.languageCode];
String get steps => localizedValues["steps"][locale.languageCode];
String get avgSteps => localizedValues["avgSteps"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -23,7 +23,7 @@ class ImageOptions {
icon: FeatherIcons.image,
onTap: () async {
File _image =
await ImagePicker.pickImage(source: ImageSource.gallery);
await ImagePicker.pickImage(source: ImageSource.gallery, imageQuality: 50);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);
@ -37,7 +37,7 @@ class ImageOptions {
icon: FeatherIcons.camera,
onTap: () async {
File _image =
await ImagePicker.pickImage(source: ImageSource.camera);
await ImagePicker.pickImage(source: ImageSource.camera, imageQuality: 50);
String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes);

@ -34,6 +34,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:in_app_review/in_app_review.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
@ -47,6 +48,7 @@ class AppDrawer extends StatefulWidget {
}
class _AppDrawerState extends State<AppDrawer> {
final InAppReview _inAppReview = InAppReview.instance;
@override
void initState() {
@ -377,11 +379,12 @@ class _AppDrawerState extends State<AppDrawer> {
InkWell(
child: DrawerItem(TranslationBase.of(context).rateApp, Icons.star, bottomLine: false, letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider),
onTap: () {
if (Platform.isIOS) {
launch("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978");
} else {
launch("https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en");
}
openAppReviewDialog();
// if (Platform.isIOS) {
// launch("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978");
// } else {
// launch("https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en");
// }
},
),
InkWell(
@ -607,6 +610,12 @@ class _AppDrawerState extends State<AppDrawer> {
});
}
openAppReviewDialog() async {
if (await _inAppReview.isAvailable()) {
_inAppReview.requestReview();
}
}
void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
}

@ -189,6 +189,8 @@ dependencies:
in_app_update: ^1.1.15
in_app_review: ^1.0.4
badges: ^1.1.4
# open_settings: ^2.0.1
# Dep by Zohaib

Loading…
Cancel
Save