Merge branch 'master' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan-patientapp

merge-requests/140/head
Sultan Khan 4 years ago
commit 8de838a6dc

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -85,8 +85,11 @@ const GET_BABYINFORMATION_REQUEST =
const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID';
///userInformation
const GET_USERINFORMATION_REQUEST =
'Services/Community.svc/REST/GetUserInformation_New';
const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New';
///Update email
const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail';
const UPDATE_PATENT_INFO = 'Services/Community.svc/REST/UpdateUserInfo_New';
///addNewChild
const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby';
@ -94,8 +97,8 @@ const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby';
///newUserId
const GET_NEW_USER_REQUEST = 'Services/Community.svc/REST/CreateNewUser_New';
///delteChild
const DELETE_CHILD_REQUEST = 'Services/Community.svc/REST/DeleteBaby';
///delete Child
const DELETE_CHILD_REQUEST = '/Services/Community.svc/REST/DeleteBaby';
///addNewTABLE
const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable';
@ -355,6 +358,13 @@ const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// pharmacy
const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer";
const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
// Home Health Care
const HHC_GET_ALL_SERVICES =
"Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
@ -371,6 +381,16 @@ const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =
'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const GET_PATIENT_ALL_PRES_ORD= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER= 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
// External API
const ADD_ADDRESS_INFO= "https://mdlaboratories.com/exacartapi/api/addcustomeraddress";
const GET_CUSTOMER_ADDRESSES= "https://mdlaboratories.com/exacartapi/api/Customers/";
const GET_CUSTOMER_INFO = "https://mdlaboratories.com/exacartapi/api/VerifyCustomer";
const TIMER_MIN = 10;
const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw";

@ -360,7 +360,7 @@ const Map localizedValues = {
"en": "Home Health Care Service",
'ar': 'الرعاية الصحية المنزلية'
},
"OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدلايات الحبيب'},
"OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدليات الحبيب'},
"EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'},
"OnlinePaymentService": {
"en": "Online Payment Service",
@ -679,6 +679,39 @@ const Map localizedValues = {
"ar": "هذة الخدمة تتطلب تسجيل الدخول"
},
// pharmacy module
"medicationRefill": {
"en": "MEDICATION REFILL",
"ar": "إعادة تعبئة الدواء"
},
"offersAndPromotions": {
"en": "OFFERS & SPECIAL PROMOTIONS",
"ar": "العروض والترقيات الخاصة"
},
"myPrescriptions": {
"en": "MY PRESCRIPTIONS",
"ar": "وصفاتي"
},
"searchAndScanMedication": {
"en": "SEARCH & SCAN FOR MEDICATION",
"ar": "البحث والمسح للأدوية"
},
"shopByBrands": {
"en": "Shop By Brands",
"ar": "تسوق حسب الماركات"
},
"recentlyViewed": {
"en": "Recently Viewed",
"ar": "شوهدت مؤخرا"
},
"bestSellers": {
"en": "Best Sellers",
"ar": "أفضل البائعين"
},
"deleteAllItems": {
"en": "Delete All Items",
"ar": "حذف كافة العناصر"
},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
@ -687,6 +720,9 @@ const Map localizedValues = {
"drag-point": {
"en": "Drag point to change your age",
"ar": "اسحب لتغيير عمرك"
},"HHCNotAuthMsg": {
"en": "This service provides a set of home health care services, continuous and comprehensive follow-up in their places of residence for those who cannot access health facilities, such as (laboratory analyzes - radiology - vaccinations - physical therapy), etc.",
"ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة"
},
"email": {"en": "Email", "ar": "البريد الالكتروني"},
"Book": {"en": "Book", "ar": "احجز"},
@ -1056,4 +1092,96 @@ const Map localizedValues = {
"ar": "إستبيان"
},
"vaccination": {
"en": "Vaccination",
"ar": "جدول التطعيمات"
},
"welcomeBack": {
"en": "Welcome back",
"ar": "مرحبا مرة أخرى"
},
"instructions": {
"en": "Please ensure that the email address is up-to-date and process to view the schedule",
"ar": "يرجى التأكد من صحة عنوان البريد الالكتروني و المتابعة لعرض الجدول "
},
"update-email": {
"en": "Update Email",
"ar": "تحديث البريد الالكتروني"
},
"updated-email": {
"en": "Updated email successfully",
"ar": "تم تحديث البريد الالكتروني"
},
"view-list-children": {
"en": "View List of Children",
"ar": "عرض قائمة الأطفال"
},
"add-child": {
"en": "Add New Child",
"ar": "اضافة طفل"
},
"child-name": {
"en": "Child Name",
"ar": "اسم الطفل"
},
"childDob": {
"en": "Birth Date",
"ar": "تاريخ الولادة"
},
"delete": {
"en": "Delete",
"ar": "حذف"
},
"deleted-child-mes": {
"en": "The request was successful. The children have removed from the vaccination schedule subscription service.",
"ar": "تم حذف الطفل بنجاح"
},
"deleted-child":{
"en":"Delete child",
"ar":"إالغاء الطفل"
},
"visit": {
"en": "Visit",
"ar": "زيارة"
},
"description-vaccination": {
"en": "Description",
"ar": "وصف"
},
"due-date": {
"en": "Due date",
"ar": "تاريخ الاستحقاق"
},
"valid-email": {
"en": "Please enter valid email",
"ar": "الرجاء إدخال عنوان بريد صحيح"
},
"confirm-send": {
"en": "Send the child's schedule to the email?",
"ar": "ارسال جدول التطعيمات الى بريدك الالكتروني؟"
},
"email-success": {
"en": " The request was successful. You will receive the Schedule in moments.",
"ar": "تم ارسال جدول التطعيمات "
},
"add-instructions": {
"en": "Add the child's information below to recieve the schedule of vaccinations.",
"ar": "أضف معلومات الطفل لاستلام جدول التطعيمات"
},
"added-child": {
"en": "The request was successful. You have added a child to the vaccination schedule subscription service.",
"ar": "تمت الاضافة بنجاح."
},
"appUpdate": {
"en": "UPDATE THE APP",
"ar": "تحديث التطبيق"
},
"ereferralSaveSuccess": {
"en": "The referral request has been submitted successfully, you will be contacted ASAP to complete the process. Referral request no is ",
"ar": " تم إرسال طلب الإحالة بنجاح ، وسيتم الاتصال بك في أسرع وقت ممكن لإكمال العملية. رقم طلب الإحالة"
},
};

@ -19,4 +19,5 @@ const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment';
const IS_VIBRATION = 'is_vibration';
const THEME_VALUE = 'is_vibration';
const MAIN_USER = 'main-user';
const WEATHER = 'weather';
const WEATHER = 'weather';
const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited';

@ -0,0 +1,76 @@
class GetAllProjectsResponseModel {
String desciption;
Null desciptionN;
int iD;
String legalName;
String legalNameN;
String name;
Null nameN;
String phoneNumber;
String setupID;
int distanceInKilometers;
bool isActive;
String latitude;
String longitude;
int mainProjectID;
Null projectOutSA;
bool usingInDoctorApp;
GetAllProjectsResponseModel(
{this.desciption,
this.desciptionN,
this.iD,
this.legalName,
this.legalNameN,
this.name,
this.nameN,
this.phoneNumber,
this.setupID,
this.distanceInKilometers,
this.isActive,
this.latitude,
this.longitude,
this.mainProjectID,
this.projectOutSA,
this.usingInDoctorApp});
GetAllProjectsResponseModel.fromJson(Map<String, dynamic> json) {
desciption = json['Desciption'];
desciptionN = json['DesciptionN'];
iD = json['ID'];
legalName = json['LegalName'];
legalNameN = json['LegalNameN'];
name = json['Name'];
nameN = json['NameN'];
phoneNumber = json['PhoneNumber'];
setupID = json['SetupID'];
distanceInKilometers = json['DistanceInKilometers'];
isActive = json['IsActive'];
latitude = json['Latitude'];
longitude = json['Longitude'];
mainProjectID = json['MainProjectID'];
projectOutSA = json['ProjectOutSA'];
usingInDoctorApp = json['UsingInDoctorApp'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Desciption'] = this.desciption;
data['DesciptionN'] = this.desciptionN;
data['ID'] = this.iD;
data['LegalName'] = this.legalName;
data['LegalNameN'] = this.legalNameN;
data['Name'] = this.name;
data['NameN'] = this.nameN;
data['PhoneNumber'] = this.phoneNumber;
data['SetupID'] = this.setupID;
data['DistanceInKilometers'] = this.distanceInKilometers;
data['IsActive'] = this.isActive;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['MainProjectID'] = this.mainProjectID;
data['ProjectOutSA'] = this.projectOutSA;
data['UsingInDoctorApp'] = this.usingInDoctorApp;
return data;
}
}

@ -0,0 +1,85 @@
class Addresses {
String id;
String firstName;
String lastName;
String email;
String company;
int countryId;
String country;
String stateProvinceId;
String city;
String address1;
String address2;
String zipPostalCode;
String phoneNumber;
String faxNumber;
String customerAttributes;
String createdOnUtc;
String province;
String latLong;
Addresses(
{this.id,
this.firstName,
this.lastName,
this.email,
this.company,
this.countryId,
this.country,
this.stateProvinceId,
this.city,
this.address1,
this.address2,
this.zipPostalCode,
this.phoneNumber,
this.faxNumber,
this.customerAttributes,
this.createdOnUtc,
this.province,
this.latLong});
Addresses.fromJson(Map<String, dynamic> json) {
id = json['id'];
firstName = json['first_name'];
lastName = json['last_name'];
email = json['email'];
company = json['company'];
countryId = json['country_id'];
country = json['country'];
stateProvinceId = json['state_province_id'];
city = json['city'];
address1 = json['address1'];
address2 = json['address2'];
zipPostalCode = json['zip_postal_code'];
phoneNumber = json['phone_number'];
faxNumber = json['fax_number'];
customerAttributes = json['customer_attributes'];
createdOnUtc = json['created_on_utc'];
province = json['province'];
latLong = json['lat_long'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['first_name'] = this.firstName;
data['last_name'] = this.lastName;
data['email'] = this.email;
data['company'] = this.company;
data['country_id'] = this.countryId;
data['country'] = this.country;
data['state_province_id'] = this.stateProvinceId;
data['city'] = this.city;
data['address1'] = this.address1;
data['address2'] = this.address2;
data['zip_postal_code'] = this.zipPostalCode;
data['phone_number'] = this.phoneNumber;
data['fax_number'] = this.faxNumber;
data['customer_attributes'] = this.customerAttributes;
data['created_on_utc'] = this.createdOnUtc;
data['province'] = this.province;
data['lat_long'] = this.latLong;
return data;
}
}

@ -0,0 +1,128 @@
class Customer {
String fileNumber;
String iqamaNumber;
int isOutSa;
int patientType;
String gender;
String birthDate;
String phone;
String countryCode;
String yahalaAccountno;
String billingAddress;
String shippingAddress;
String id;
String username;
String email;
String firstName;
String lastName;
String languageId;
String adminComment;
String isTaxExempt;
String hasShoppingCartItems;
String active;
String deleted;
String isSystemAccount;
String systemName;
String lastIpAddress;
String createdOnUtc;
String lastLoginDateUtc;
String lastActivityDateUtc;
String registeredInStoreId;
Customer(
{this.fileNumber,
this.iqamaNumber,
this.isOutSa,
this.patientType,
this.gender,
this.birthDate,
this.phone,
this.countryCode,
this.yahalaAccountno,
this.billingAddress,
this.shippingAddress,
this.id,
this.username,
this.email,
this.firstName,
this.lastName,
this.languageId,
this.adminComment,
this.isTaxExempt,
this.hasShoppingCartItems,
this.active,
this.deleted,
this.isSystemAccount,
this.systemName,
this.lastIpAddress,
this.createdOnUtc,
this.lastLoginDateUtc,
this.lastActivityDateUtc,
this.registeredInStoreId});
Customer.fromJson(Map<String, dynamic> json) {
fileNumber = json['file_number'];
iqamaNumber = json['iqama_number'];
isOutSa = json['is_out_sa'];
patientType = json['patient_type'];
gender = json['gender'];
birthDate = json['birth_date'];
phone = json['phone'];
countryCode = json['country_code'];
yahalaAccountno = json['yahala_accountno'];
billingAddress = json['billing_address'];
shippingAddress = json['shipping_address'];
id = json['id'];
username = json['username'];
email = json['email'];
firstName = json['first_name'];
lastName = json['last_name'];
languageId = json['language_id'];
adminComment = json['admin_comment'];
isTaxExempt = json['is_tax_exempt'];
hasShoppingCartItems = json['has_shopping_cart_items'];
active = json['active'];
deleted = json['deleted'];
isSystemAccount = json['is_system_account'];
systemName = json['system_name'];
lastIpAddress = json['last_ip_address'];
createdOnUtc = json['created_on_utc'];
lastLoginDateUtc = json['last_login_date_utc'];
lastActivityDateUtc = json['last_activity_date_utc'];
registeredInStoreId = json['registered_in_store_id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['file_number'] = this.fileNumber;
data['iqama_number'] = this.iqamaNumber;
data['is_out_sa'] = this.isOutSa;
data['patient_type'] = this.patientType;
data['gender'] = this.gender;
data['birth_date'] = this.birthDate;
data['phone'] = this.phone;
data['country_code'] = this.countryCode;
data['yahala_accountno'] = this.yahalaAccountno;
data['billing_address'] = this.billingAddress;
data['shipping_address'] = this.shippingAddress;
data['id'] = this.id;
data['username'] = this.username;
data['email'] = this.email;
data['first_name'] = this.firstName;
data['last_name'] = this.lastName;
data['language_id'] = this.languageId;
data['admin_comment'] = this.adminComment;
data['is_tax_exempt'] = this.isTaxExempt;
data['has_shopping_cart_items'] = this.hasShoppingCartItems;
data['active'] = this.active;
data['deleted'] = this.deleted;
data['is_system_account'] = this.isSystemAccount;
data['system_name'] = this.systemName;
data['last_ip_address'] = this.lastIpAddress;
data['created_on_utc'] = this.createdOnUtc;
data['last_login_date_utc'] = this.lastLoginDateUtc;
data['last_activity_date_utc'] = this.lastActivityDateUtc;
data['registered_in_store_id'] = this.registeredInStoreId;
return data;
}
}

@ -0,0 +1,98 @@
import 'PharmacyImageObject.dart';
class Manufacturer {
String id;
String name;
String namen;
// List<LocalizedNames> localizedNames;
String description;
int manufacturerTemplateId;
String metaKeywords;
String metaDescription;
String metaTitle;
int pageSize;
String pageSizeOptions;
String priceRanges;
bool published;
bool deleted;
int displayOrder;
String createdOnUtc;
String updatedOnUtc;
PharmacyImageObject image;
Manufacturer(
{this.id,
this.name,
this.namen,
// this.localizedNames,
this.description,
this.manufacturerTemplateId,
this.metaKeywords,
this.metaDescription,
this.metaTitle,
this.pageSize,
this.pageSizeOptions,
this.priceRanges,
this.published,
this.deleted,
this.displayOrder,
this.createdOnUtc,
this.updatedOnUtc,
this.image});
Manufacturer.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
namen = json['namen'];
// if (json['localized_names'] != null) {
// localizedNames = new List<LocalizedNames>();
// json['localized_names'].forEach((v) {
// localizedNames.add(new LocalizedNames.fromJson(v));
// });
// }
description = json['description'];
manufacturerTemplateId = json['manufacturer_template_id'];
metaKeywords = json['meta_keywords'];
metaDescription = json['meta_description'];
metaTitle = json['meta_title'];
pageSize = json['page_size'];
pageSizeOptions = json['page_size_options'];
priceRanges = json['price_ranges'];
published = json['published'];
deleted = json['deleted'];
displayOrder = json['display_order'];
createdOnUtc = json['created_on_utc'];
updatedOnUtc = json['updated_on_utc'];
image = json['image'] != null
? new PharmacyImageObject.fromJson(json['image'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['namen'] = this.namen;
// if (this.localizedNames != null) {
// data['localized_names'] =
// this.localizedNames.map((v) => v.toJson()).toList();
// }
data['description'] = this.description;
data['manufacturer_template_id'] = this.manufacturerTemplateId;
data['meta_keywords'] = this.metaKeywords;
data['meta_description'] = this.metaDescription;
data['meta_title'] = this.metaTitle;
data['page_size'] = this.pageSize;
data['page_size_options'] = this.pageSizeOptions;
data['price_ranges'] = this.priceRanges;
data['published'] = this.published;
data['deleted'] = this.deleted;
data['display_order'] = this.displayOrder;
data['created_on_utc'] = this.createdOnUtc;
data['updated_on_utc'] = this.updatedOnUtc;
if (this.image != null) {
data['image'] = this.image.toJson();
}
return data;
}
}

@ -0,0 +1,27 @@
class PharmacyImageObject {
int id;
int position;
String src;
String thumb;
String attachment;
PharmacyImageObject({this.id, this.position, this.src, this.thumb, this.attachment});
PharmacyImageObject.fromJson(Map<String, dynamic> json) {
id = json['id'];
position = json['position'];
src = json['src'];
thumb = json['thumb'];
attachment = json['attachment'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['position'] = this.position;
data['src'] = this.src;
data['thumb'] = this.thumb;
data['attachment'] = this.attachment;
return data;
}
}

@ -0,0 +1,149 @@
import 'PharmacyImageObject.dart';
import 'Reviews.dart';
class PharmacyProduct {
String id;
String name;
String namen;
String shortDescription;
String fullDescription;
String fullDescriptionn;
int approvedRatingSum;
int approvedTotalReviews;
String sku;
bool isRx;
String rxMessage;
String rxMessagen;
int stockQuantity;
String stockAvailability;
String stockAvailabilityn;
bool allowBackInStockSubscriptions;
int orderMinimumQuantity;
int orderMaximumQuantity;
double price;
double oldPrice;
String discountName;
String discountNamen;
String discountPercentage;
int displayOrder;
List<int> discountIds;
List<Reviews> reviews;
List<PharmacyImageObject> images;
PharmacyProduct(
{this.id,
this.name,
this.namen,
this.shortDescription,
this.fullDescription,
this.fullDescriptionn,
this.approvedRatingSum,
this.approvedTotalReviews,
this.sku,
this.isRx,
this.rxMessage,
this.rxMessagen,
this.stockQuantity,
this.stockAvailability,
this.stockAvailabilityn,
this.allowBackInStockSubscriptions,
this.orderMinimumQuantity,
this.orderMaximumQuantity,
this.price,
this.oldPrice,
this.discountName,
this.discountNamen,
this.discountPercentage,
this.displayOrder,
this.discountIds,
this.reviews,
this.images});
PharmacyProduct.fromJson(Map<String, dynamic> json) {
try {
id = json['id'];
name = json['name'];
namen = json['namen'];
shortDescription = json['short_description'];
fullDescription = json['full_description'];
fullDescriptionn = json['full_descriptionn'];
approvedRatingSum = json['approved_rating_sum'];
approvedTotalReviews = json['approved_total_reviews'];
sku = json['sku'];
isRx = json['is_rx'];
rxMessage = json['rx_message'];
rxMessagen = json['rx_messagen'];
stockQuantity = json['stock_quantity'];
stockAvailability = json['stock_availability'];
stockAvailabilityn = json['stock_availabilityn'];
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
orderMinimumQuantity = json['order_minimum_quantity'];
orderMaximumQuantity = json['order_maximum_quantity'];
price = json['price'];
oldPrice = json['old_price'];
discountName = json['discount_name'];
discountNamen = json['discount_namen'];
discountPercentage = json['discount_percentage'];
displayOrder = json['display_order'];
if (json['discount_ids'] != null) {
discountIds = new List<int>();
json['discount_ids'].forEach((v) {
discountIds.add(v);
});
}
if (json['reviews'] != null) {
reviews = new List<Reviews>();
json['reviews'].forEach((v) {
reviews.add(new Reviews.fromJson(v));
});
}
if (json['images'] != null) {
images = new List<PharmacyImageObject>();
json['images'].forEach((v) {
images.add(new PharmacyImageObject.fromJson(v));
});
}
} catch (e) {
print(e);
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['namen'] = this.namen;
data['short_description'] = this.shortDescription;
data['full_description'] = this.fullDescription;
data['full_descriptionn'] = this.fullDescriptionn;
data['approved_rating_sum'] = this.approvedRatingSum;
data['approved_total_reviews'] = this.approvedTotalReviews;
data['sku'] = this.sku;
data['is_rx'] = this.isRx;
data['rx_message'] = this.rxMessage;
data['rx_messagen'] = this.rxMessagen;
data['stock_quantity'] = this.stockQuantity;
data['stock_availability'] = this.stockAvailability;
data['stock_availabilityn'] = this.stockAvailabilityn;
data['allow_back_in_stock_subscriptions'] =
this.allowBackInStockSubscriptions;
data['order_minimum_quantity'] = this.orderMinimumQuantity;
data['order_maximum_quantity'] = this.orderMaximumQuantity;
data['price'] = this.price;
data['old_price'] = this.oldPrice;
data['discount_name'] = this.discountName;
data['discount_namen'] = this.discountNamen;
data['discount_percentage'] = this.discountPercentage;
data['display_order'] = this.displayOrder;
if (this.discountIds != String) {
data['discount_ids'] = this.discountIds.map((v) => v).toList();
}
if (this.reviews != String) {
data['reviews'] = this.reviews.map((v) => v.toJson()).toList();
}
if (this.images != String) {
data['images'] = this.images.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -0,0 +1,82 @@
import '../pharmacies/Customer.dart';
class Reviews {
int id;
int position;
int reviewId;
int customerId;
int productId;
int storeId;
bool isApproved;
String title;
String reviewText;
Null replyText;
int rating;
int helpfulYesTotal;
int helpfulNoTotal;
String createdOnUtc;
Customer customer;
Null product;
Reviews(
{this.id,
this.position,
this.reviewId,
this.customerId,
this.productId,
this.storeId,
this.isApproved,
this.title,
this.reviewText,
this.replyText,
this.rating,
this.helpfulYesTotal,
this.helpfulNoTotal,
this.createdOnUtc,
this.customer,
this.product});
Reviews.fromJson(Map<String, dynamic> json) {
id = json['id'];
position = json['position'];
reviewId = json['review_id'];
customerId = json['customer_id'];
productId = json['product_id'];
storeId = json['store_id'];
isApproved = json['is_approved'];
title = json['title'];
reviewText = json['review_text'];
replyText = json['reply_text'];
rating = json['rating'];
helpfulYesTotal = json['helpful_yes_total'];
helpfulNoTotal = json['helpful_no_total'];
createdOnUtc = json['created_on_utc'];
customer = json['customer'] != null
? new Customer.fromJson(json['customer'])
: null;
product = json['product'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['position'] = this.position;
data['review_id'] = this.reviewId;
data['customer_id'] = this.customerId;
data['product_id'] = this.productId;
data['store_id'] = this.storeId;
data['is_approved'] = this.isApproved;
data['title'] = this.title;
data['review_text'] = this.reviewText;
data['reply_text'] = this.replyText;
data['rating'] = this.rating;
data['helpful_yes_total'] = this.helpfulYesTotal;
data['helpful_no_total'] = this.helpfulNoTotal;
data['created_on_utc'] = this.createdOnUtc;
if (this.customer != null) {
data['customer'] = this.customer.toJson();
}
data['product'] = this.product;
return data;
}
}

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
@ -47,8 +48,9 @@ class CMCService extends BaseService {
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
onSuccess: (dynamic response, int statusCode) {
cmcAllPresOrdersList.clear();
cmcAllOrderDetail.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
if (data['ServiceID'] == 3)
if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService())
cmcAllPresOrdersList
.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
});
@ -104,7 +106,7 @@ class CMCService extends BaseService {
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
hasError = false;
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER,
await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true;
}, onFailure: (String error, int statusCode) {

@ -0,0 +1,211 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.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/add_new_address_Request_Model.dart';
import 'package:intl/intl.dart';
import '../base_service.dart';
class CustomerAddressesService extends BaseService {
List<AddressInfo> addressesList = List();
CustomerInfo customerInfo;
Future addAddressInfo({ AddNewAddressRequestModel
addNewAddressRequestModel }) async {
addNewAddressRequestModel.customer.email = customerInfo.email;
addNewAddressRequestModel.customer.id = customerInfo.customerId;
addNewAddressRequestModel.customer.roleIds = [3];
addNewAddressRequestModel.customer.addresses[0].email = customerInfo.email;
addNewAddressRequestModel.customer.addresses[0].phoneNumber = customerInfo.mobileNumber;
addNewAddressRequestModel.customer.addresses[0].firstName = user.firstName;
addNewAddressRequestModel.customer.addresses[0].lastName = user.lastName;
addNewAddressRequestModel.customer.addresses[0].countryId = 69;
var f = DateFormat('E, d MMM yyyy HH:mm:ss');
var date = f.format(DateTime.now().toUtc()) + " GMT";
addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date;
hasError = false;
await baseAppClient.post(ADD_ADDRESS_INFO,
onSuccess: (dynamic response, int statusCode) {
addressesList.clear();
response["customers"][0]["addresses"].forEach((data) {
addressesList
.add(AddressInfo.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: addNewAddressRequestModel.toJson(), isExternal: true, isAllowAny: true);
}
Future getCustomerAddresses() async {
Map<String, String> queryParams = {
'fields':'addresses'
};
hasError = false;
await baseAppClient.get("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}",
onSuccess: (dynamic response, int statusCode) {
addressesList.clear();
response["customers"][0]["addresses"].forEach((data) {
addressesList
.add(AddressInfo.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams, isExternal: true);
}
Future getCustomerInfo() async {
Map<String, String> queryParams = {
'FileNumber':'${user.patientID}'
};
hasError = false;
await baseAppClient.get(GET_CUSTOMER_INFO,
onSuccess: (dynamic response, int statusCode) {
customerInfo= CustomerInfo.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams, isExternal: true);
}
}
class CustomerInfo {
bool isRegistered;
String userName;
Null password;
String email;
Null errorMessage;
String mobileNumber;
int customerId;
CustomerInfo(
{this.isRegistered,
this.userName,
this.password,
this.email,
this.errorMessage,
this.mobileNumber,
this.customerId});
CustomerInfo.fromJson(Map<String, dynamic> json) {
isRegistered = json['IsRegistered'];
userName = json['UserName'];
password = json['Password'];
email = json['Email'];
errorMessage = json['ErrorMessage'];
mobileNumber = json['MobileNumber'];
customerId = json['CustomerId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['IsRegistered'] = this.isRegistered;
data['UserName'] = this.userName;
data['Password'] = this.password;
data['Email'] = this.email;
data['ErrorMessage'] = this.errorMessage;
data['MobileNumber'] = this.mobileNumber;
data['CustomerId'] = this.customerId;
return data;
}
}
class AddressInfo {
String id;
String firstName;
String lastName;
String email;
Null company;
int countryId;
String country;
Null stateProvinceId;
String city;
String address1;
String address2;
String zipPostalCode;
String phoneNumber;
Null faxNumber;
String customerAttributes;
String createdOnUtc;
Null province;
String latLong;
AddressInfo(
{this.id,
this.firstName,
this.lastName,
this.email,
this.company,
this.countryId,
this.country,
this.stateProvinceId,
this.city,
this.address1,
this.address2,
this.zipPostalCode,
this.phoneNumber,
this.faxNumber,
this.customerAttributes,
this.createdOnUtc,
this.province,
this.latLong});
AddressInfo.fromJson(Map<String, dynamic> json) {
id = json['id'];
firstName = json['first_name'];
lastName = json['last_name'];
email = json['email'];
company = json['company'];
countryId = json['country_id'];
country = json['country'];
stateProvinceId = json['state_province_id'];
city = json['city'];
address1 = json['address1'];
address2 = json['address2'];
zipPostalCode = json['zip_postal_code'];
phoneNumber = json['phone_number'];
faxNumber = json['fax_number'];
customerAttributes = json['customer_attributes'];
createdOnUtc = json['created_on_utc'];
province = json['province'];
latLong = json['lat_long'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['first_name'] = this.firstName;
data['last_name'] = this.lastName;
data['email'] = this.email;
data['company'] = this.company;
data['country_id'] = this.countryId;
data['country'] = this.country;
data['state_province_id'] = this.stateProvinceId;
data['city'] = this.city;
data['address1'] = this.address1;
data['address2'] = this.address2;
data['zip_postal_code'] = this.zipPostalCode;
data['phone_number'] = this.phoneNumber;
data['fax_number'] = this.faxNumber;
data['customer_attributes'] = this.customerAttributes;
data['created_on_utc'] = this.createdOnUtc;
data['province'] = this.province;
data['lat_long'] = this.latLong;
return data;
}
}

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
@ -14,6 +15,9 @@ class EReferralService extends BaseService {
List<GetAllCitiesResponseModel> _allCities = List();
List<GetAllCitiesResponseModel> get allCities => _allCities;
List<GetAllProjectsResponseModel> _allProjects = List();
List<GetAllProjectsResponseModel> get allProjects => _allProjects;
List<SearchEReferralResponseModel> _allReferral = List();
List<SearchEReferralResponseModel> get allReferral => _allReferral;
String _activationCode;
@ -53,6 +57,20 @@ class EReferralService extends BaseService {
}, body: {});
}
Future getAllProjects() async {
await baseAppClient.post(GET_PROJECT,
onSuccess: (dynamic response, int statusCode) {
_allProjects.clear();
response['ListProject'].forEach((city) {
_allProjects
.add(GetAllProjectsResponseModel.fromJson(city));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {});
}
Future sendActivationCodeForEReferral(
SendActivationCodeForEReferralRequestModel
@ -60,6 +78,7 @@ class EReferralService extends BaseService {
hasError = false;
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_E_REFERRAL,
onSuccess: (dynamic response, int statusCode) {
print(response["VerificationCode"]);
_activationCode = response["VerificationCode"];
_logInTokenID = response["LogInTokenID"];
@ -86,19 +105,20 @@ class EReferralService extends BaseService {
}, body: checkActivationCodeForEReferralRequestModel.toJson());
}
Future createEReferral(
Future<dynamic> createEReferral(
CreateEReferralRequestModel createEReferralRequestModel
) async {
hasError = false;
dynamic localRes;
await baseAppClient.post(CREATE_E_REFERRAL/*'Services/Patients.svc/REST/CreateEReferral'*/,
onSuccess: (dynamic response, int statusCode) {
// TODO Waiting for fix service
var asd= ("EEEEEE");
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: createEReferralRequestModel.toJson());
return Future.value(localRes);
}
Future getEReferrals(

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart';
@ -7,6 +8,8 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.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/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import '../base_service.dart';
@ -15,9 +18,10 @@ class HomeHealthCareService extends BaseService {
List<GetHHCAllPresOrdersResponseModel> hhcAllPresOrdersList = List();
List<GetOrderDetailByOrderIDResponseModel> hhcAllOrderDetail = List();
List<AddressInfo> addressesList = List();
bool isOrderUpdated;
CustomerInfo customerInfo;
Future getHHCAllServices(
HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
hasError = false;
@ -37,11 +41,11 @@ class HomeHealthCareService extends BaseService {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel =
GetHHCAllPresOrdersRequestModel();
hasError = false;
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORD,
onSuccess: (dynamic response, int statusCode) {
hhcAllPresOrdersList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
if (data['ServiceID'] == 2)
if (data['ServiceID'] == OrderService.HOME_HEALTH_CARE.getIdOrderService())
hhcAllPresOrdersList
.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
});
@ -91,3 +95,5 @@ class HomeHealthCareService extends BaseService {
}, body: order.toJson());
}
}

@ -14,19 +14,12 @@ class CreteNewBabyService extends BaseService {
Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async {
hasError = false;
await getUser();
Map<String, dynamic> body = Map.from(newChild.toJson());
body['CreatedBy'] = 102;
body['EditedBy'] = 102;
body['UserID'] = userID;
body['AlertBy'] = 2;
body['EmailAddress'] = user.emailAddress;
body['IsLogin'] = true;
body['LogInTokenID'] = await sharedPref.getString(TOKEN);
body['MobileNumber'] = user.mobileNumber;
body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_NEWCHILD_REQUEST,

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart';
@ -17,22 +18,13 @@ class DeleteBabyService extends BaseService{
List<DeleteBaby> deleteBabyModelList= List();
Future getDeleteBabyOrder({DeleteBaby deleteChild,int babyID}) async {
Future getDeleteBabyOrder({List_BabyInformationModel babyInfo}) async {
hasError = false;
await getUser();
Map<String, dynamic> body = Map.from(deleteChild.toJson());
// body['CreatedBy'] = 102;
Map<String, dynamic> body = Map();
body['EditedBy'] = 102;
//body['BabyID'] = babyID;
//body['BabyID'] = createNewBabyModelList ;
// body['AlertBy'] = 2;
// body['EmailAddress'] = user.emailAddress;
body['IsLogin'] = true;
body['LogInTokenID'] = await sharedPref.getString(TOKEN);
body['MobileNumber'] = user.mobileNumber;
body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode;
body['BabyID'] = babyInfo.babyID;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(DELETE_CHILD_REQUEST,
@ -45,31 +37,6 @@ class DeleteBabyService extends BaseService{
}, body: body);
}
// Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async {
// hasError = false;
// await getUser();
// Map<String, dynamic> body = Map.from(newChild.toJson());
// body['CreatedBy'] = 102;
// body['EditedBy'] = 102;
// body['UserID'] = userID;
// body['AlertBy'] = 2;
// body['EmailAddress'] = user.emailAddress;
// body['IsLogin'] = true;
// body['LogInTokenID'] = await sharedPref.getString(TOKEN);
// body['MobileNumber'] = user.mobileNumber;
// body['NationalID'] = user.nationalityID;
// body['ZipCode'] = user.zipCode;
//
// body['isDentalAllowedBackend'] = false;
//
// await baseAppClient.post(GET_NEWCHILD_REQUEST,
// onSuccess: (dynamic response, int statusCode) {
// var asd ="";
// },
// onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: body);
// }
}

@ -1,27 +0,0 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/get_vacainations_itemsmodel.dart';
import '../base_service.dart';
class GetVccinationsItemsService extends BaseService {
List<GET_VACCINATIONS_ITEMSMODEL> getVaccinationsItemModelList = List();
Map<String, dynamic> body = Map();
Future getaccinationsitemOrders() async {
hasError = false;
await baseAppClient.post(GET_TABLE_REQUEST,
onSuccess: (dynamic response, int statusCode) {
getVaccinationsItemModelList.clear();
response['List_CreateVaccinationTableModel'].forEach((vital) {
getVaccinationsItemModelList.add(
GET_VACCINATIONS_ITEMSMODEL.fromJson(vital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -4,11 +4,11 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_m
import '../base_service.dart';
class UserInformationService extends BaseService {
List<List_UserInformationModel> userInformationModelList = List();
Map<String, dynamic> body = Map();
List_UserInformationModel userInformationModel = List_UserInformationModel();
Future getUserInformationOrders() async {
hasError = false;
Map<String, dynamic> body = Map();
await getUser();
body['CreatedBy'] = 102;
body['EditedBy'] = 102;
@ -22,14 +22,44 @@ class UserInformationService extends BaseService {
await baseAppClient.post(GET_USERINFORMATION_REQUEST,
onSuccess: (dynamic response, int statusCode) {
userInformationModelList.clear();
response['List_UserInformationModel_New'].forEach((vital) {
userInformationModelList.add(List_UserInformationModel.fromJson(vital));
userInformationModel = List_UserInformationModel.fromJson(vital);
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future updateEmail(String email) async {
hasError = false;
Map<String, dynamic> body = Map();
body['IsInternalRequest'] = true;
body['EmailAddress'] = email;
body['IsLogin'] = true;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_PATENT_EMAIL,
onSuccess: (dynamic response, int statusCode) {
var asd = "";
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future updateUserInfo(String email) async {
hasError = false;
Map<String, dynamic> body = Map();
body['IsInternalRequest'] = true;
body['EmailAddress'] = email;
body['IsLogin'] = true;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_PATENT_INFO,
onSuccess: (dynamic response, int statusCode) {
var asd = "";
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import '../base_service.dart';
class VaccinationTableService extends BaseService {
@ -10,19 +12,16 @@ class VaccinationTableService extends BaseService {
Future getCreateVaccinationTableOrders() async {
Future getCreateVaccinationTableOrders({List_BabyInformationModel babyInfo, List_UserInformationModel informationModel, bool isSendEmail=false}) async {
hasError = false;
await getUser();
body['BabyName']="fffffffffff eeeeeeeeeeeeee";
body['DOB'] = "/Date(1585774800000+0300)/";
body['EmailAddress'] = user.emailAddress;
body['BabyName']=babyInfo.babyName;
body['DOB'] = DateUtil.convertDateToString(babyInfo.dOB);
body['EmailAddress'] = informationModel.emailAddress;
body['isDentalAllowedBackend'] = false;
body['SendEmail'] = false;
body['SendEmail'] = isSendEmail;
body['IsLogin'] =true;
await baseAppClient.post(GET_TABLE_REQUEST,
onSuccess: (dynamic response, int statusCode) {
createVaccinationTableModelList.clear();

@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:provider/provider.dart';
@ -31,74 +33,82 @@ class BaseAppClient {
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false}) async {
String url = BASE_URL + endPoint;
bool isAllowAny = false,
bool isExternal = false}) async {
String url;
if (isExternal) {
url = endPoint;
} else {
url = BASE_URL + endPoint;
}
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getString(APP_LANGUAGE);
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = body.containsKey('LanguageID')
? body['LanguageID'] != null
? body['LanguageID']
: languageID == 'ar'
? 1
: 2
: languageID == 'ar'
? 1
: 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getString(APP_LANGUAGE);
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = body.containsKey('LanguageID')
? body['LanguageID'] != null
? body['LanguageID']
: languageID == 'ar'
? 1
: 2
: languageID == 'en'
? 2
: 1;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = DeviceTypeID;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
body['DeviceTypeID'] = DeviceTypeID;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
:user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
body['PatientID'] =
body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSessionId(token);
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSessionId(token);
}
}
}
@ -122,6 +132,10 @@ class BaseAppClient {
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(
AppGlobal.context, parsed['ErrorEndUserMessage']);
}
if (isAllowAny) {
onSuccess(parsed, statusCode);
} else if (parsed['IsAuthenticated'] == null) {
@ -163,12 +177,60 @@ class BaseAppClient {
}
}
Future navigateToAppUpdate(context, String text) async {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => AppUpdatePage(appUpdateText: text)));
}
get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams,
bool isExternal = false}) async {
String url;
if (isExternal) {
url = endPoint;
} else {
url = BASE_URL + endPoint;
}
if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query;
url += '?' + queryString;
}
print("URL : $url");
if (await Utils.checkConnection()) {
final response = await http.get(
url.trim(),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
onSuccess(parsed, statusCode);
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
}
logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID);
await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
_vitalSignService.weightKg ="";
_vitalSignService.heightCm="";
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
false;
_vitalSignService.weightKg = "";
_vitalSignService.heightCm = "";
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
}

@ -0,0 +1,29 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class OrderPreviewService extends BaseService{
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
List<Addresses> addresses = List();
Future getBannerListList() async {
hasError = false;
try {
await baseAppClient.get(GET_CUSTOMERS_ADDRESSES,
onSuccess: (dynamic response, int statusCode) {
addresses.clear();
response['customers'][0]['addresses'].forEach((item) {
addresses.add(Addresses.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
} catch (error) {
throw error;
}
}
}

@ -0,0 +1,97 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PharmacyModuleService extends BaseService {
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
List<PharmacyImageObject> bannerItems = List();
List<Manufacturer> manufacturerList = List();
List<PharmacyProduct> bestSellerProducts = List();
List<PharmacyProduct> lastVisitedProducts = List();
Future getBannerListList() async {
hasError = false;
try {
await baseAppClient.get(GET_PHARMACY_BANNER,
onSuccess: (dynamic response, int statusCode) {
bannerItems.clear();
response['images'].forEach((item) {
bannerItems.add(PharmacyImageObject.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
} catch (error) {
throw error;
}
}
Future getTopManufacturerList() async {
Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try {
await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER,
onSuccess: (dynamic response, int statusCode) {
manufacturerList.clear();
response['manufacturer'].forEach((item) {
manufacturerList.add(Manufacturer.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
}
}
Future getBestSellerProducts() async {
Map<String, String> queryParams = {
'fields':
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews',
};
try {
await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT,
onSuccess: (dynamic response, int statusCode) {
bestSellerProducts.clear();
response['products'].forEach((item) {
bestSellerProducts.add(PharmacyProduct.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
}
}
Future getLastVisitedProducts() async {
String lastVisited = "";
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
null) {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try {
await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
lastVisitedProducts.clear();
response['products'].forEach((item) {
lastVisitedProducts.add(PharmacyProduct.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
} catch (error) {
throw error;
}
}
}
}

@ -0,0 +1,136 @@
class AddNewAddressRequestModel {
Customer customer;
AddNewAddressRequestModel({this.customer});
AddNewAddressRequestModel.fromJson(Map<String, dynamic> json) {
customer = json['customer'] != null
? new Customer.fromJson(json['customer'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.customer != null) {
data['customer'] = this.customer.toJson();
}
return data;
}
}
class Customer {
List<Addresses> addresses;
int id;
String email;
List<int> roleIds;
Customer({this.addresses, this.id, this.email, this.roleIds});
Customer.fromJson(Map<String, dynamic> json) {
if (json['addresses'] != null) {
addresses = new List<Addresses>();
json['addresses'].forEach((v) {
addresses.add(new Addresses.fromJson(v));
});
}
id = json['id'];
email = json['email'];
roleIds = json['role_ids'].cast<int>();
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.addresses != null) {
data['addresses'] = this.addresses.map((v) => v.toJson()).toList();
}
data['id'] = this.id;
data['email'] = this.email;
data['role_ids'] = this.roleIds;
return data;
}
}
class Addresses {
int id;
String firstName;
String lastName;
String email;
Null company;
int countryId;
String country;
Null stateProvinceId;
String city;
String address1;
String address2;
String zipPostalCode;
String phoneNumber;
Null faxNumber;
String customerAttributes;
String createdOnUtc;
Null province;
String latLong;
Addresses(
{this.id,
this.firstName,
this.lastName,
this.email,
this.company,
this.countryId,
this.country,
this.stateProvinceId,
this.city,
this.address1,
this.address2,
this.zipPostalCode,
this.phoneNumber,
this.faxNumber,
this.customerAttributes,
this.createdOnUtc,
this.province,
this.latLong});
Addresses.fromJson(Map<String, dynamic> json) {
id = json['id'];
firstName = json['first_name'];
lastName = json['last_name'];
email = json['email'];
company = json['company'];
countryId = json['country_id'];
country = json['country'];
stateProvinceId = json['state_province_id'];
city = json['city'];
address1 = json['address1'];
address2 = json['address2'];
zipPostalCode = json['zip_postal_code'];
phoneNumber = json['phone_number'];
faxNumber = json['fax_number'];
customerAttributes = json['customer_attributes'];
createdOnUtc = json['created_on_utc'];
province = json['province'];
latLong = json['lat_long'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['first_name'] = this.firstName;
data['last_name'] = this.lastName;
data['email'] = this.email;
data['company'] = this.company;
data['country_id'] = this.countryId;
data['country'] = this.country;
data['state_province_id'] = this.stateProvinceId;
data['city'] = this.city;
data['address1'] = this.address1;
data['address2'] = this.address2;
data['zip_postal_code'] = this.zipPostalCode;
data['phone_number'] = this.phoneNumber;
data['fax_number'] = this.faxNumber;
data['customer_attributes'] = this.customerAttributes;
data['created_on_utc'] = this.createdOnUtc;
data['province'] = this.province;
data['lat_long'] = this.latLong;
return data;
}
}

@ -9,14 +9,19 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/cmc_service.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
import 'add_new_address_Request_Model.dart';
class CMCViewModel extends BaseViewModel {
CMCService _cMCService =
locator<CMCService>();
CustomerAddressesService _customerAddressesService =
locator<CustomerAddressesService>();
List<AddressInfo> get addressesList =>
_customerAddressesService.addressesList;
List<GetCMCServicesResponseModel> get cmcAllServicesList =>
_cMCService.cmcAllServicesList;
@ -94,7 +99,6 @@ class CMCViewModel extends BaseViewModel {
await _cMCService
.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel);
}
//TODO check it in uat
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
setState(ViewState.Busy);
order.createdBy = user.patientID;
@ -107,4 +111,44 @@ class CMCViewModel extends BaseViewModel {
getCmcAllPresOrders();
}
}
Future getCustomerAddresses() async {
setState(ViewState.Busy);
await _customerAddressesService.getCustomerAddresses(
);
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _customerAddressesService.getCustomerInfo(
);
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {
await getCustomerAddresses();
}
}
Future addAddressInfo(
{AddNewAddressRequestModel addNewAddressRequestModel}) async {
setState(ViewState.Busy);
await _customerAddressesService.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel
);
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -8,18 +8,28 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.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/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/home_health_care_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:intl/intl.dart';
import '../../../locator.dart';
import 'add_new_address_Request_Model.dart';
class HomeHealthCareViewModel extends BaseViewModel {
HomeHealthCareService _homeHealthCareService =
locator<HomeHealthCareService>();
CustomerAddressesService _customerAddressesService =
locator<CustomerAddressesService>();
List<HHCGetAllServicesResponseModel> get hhcAllServicesList =>
_homeHealthCareService.hhcAllServicesList;
List<AddressInfo> get addressesList =>
_customerAddressesService.addressesList;
List<GetHHCAllPresOrdersResponseModel> get hhcAllPresOrders =>
_homeHealthCareService.hhcAllPresOrdersList;
@ -93,5 +103,44 @@ class HomeHealthCareViewModel extends BaseViewModel {
}
Future getCustomerAddresses() async {
setState(ViewState.Busy);
await _customerAddressesService.getCustomerAddresses(
);
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _customerAddressesService.getCustomerInfo(
);
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {
await getCustomerAddresses();
}
}
Future addAddressInfo(
{AddNewAddressRequestModel addNewAddressRequestModel}) async {
setState(ViewState.Busy);
await _customerAddressesService.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel
);
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
@ -18,64 +19,92 @@ class EReferralViewModel extends BaseViewModel {
List<GetAllRelationshipTypeResponseModel> get relationTypes =>
_eReferralService.relationTypes;
List<GetAllCitiesResponseModel> get allCities => _eReferralService.allCities;
List<SearchEReferralResponseModel> get allReferral => _eReferralService.allReferral;
List<GetAllProjectsResponseModel> get allHospitals =>
_eReferralService.allProjects;
List<SearchEReferralResponseModel> get allReferral =>
_eReferralService.allReferral;
void getRelationTypes() async {
void getRelationTypes() async {
setState(ViewState.Busy);
await _eReferralService.getRelationTypes();
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.Error);
} else{
} else {
setState(ViewState.Idle);
}
}
void getAllCities() async {
void getAllCities() async {
setState(ViewState.Busy);
await _eReferralService.getAllCities();
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.Error);
} else{
} else {
setState(ViewState.Idle);
}
}
void sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async {
void getAllProjects() async {
setState(ViewState.Busy);
await _eReferralService.getAllProjects();
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
void sendActivationCodeForEReferral(
SendActivationCodeForEReferralRequestModel
sendActivationCodeForEReferralRequestModel) async {
setState(ViewState.BusyLocal);
await _eReferralService.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
await _eReferralService.sendActivationCodeForEReferral(
sendActivationCodeForEReferralRequestModel);
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.ErrorLocal);
} else{
} else {
setState(ViewState.Idle);
}
}
checkActivationCodeForEReferral(CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async {
checkActivationCodeForEReferral(
CheckActivationCodeForEReferralResponseModel
checkActivationCodeForEReferralRequestModel) async {
setState(ViewState.BusyLocal);
await _eReferralService.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel);
await _eReferralService.checkActivationCodeForEReferral(
checkActivationCodeForEReferralRequestModel);
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.ErrorLocal);
} else{
} else {
setState(ViewState.Idle);
}
}
void createEReferral(
Future<dynamic> createEReferral(
CreateEReferralRequestModel createEReferralRequestModel) async {
dynamic localRes;
setState(ViewState.BusyLocal);
await _eReferralService.createEReferral(createEReferralRequestModel);
await _eReferralService
.createEReferral(createEReferralRequestModel)
.then((response) {
localRes = response;
});
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
return Future.value(localRes);
}
getEReferrals(SearchEReferralRequestModel searchEReferralRequestModel) async {

@ -13,7 +13,6 @@ class AddNewChildViewModel extends BaseViewModel {
CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>();
ChildVaccinesService _childVaccinesService = locator<ChildVaccinesService>();
// DeleteBabyService _deleteBabyService = locator<DeleteBabyService>();
bool isAdded = false;
///create new baby
createNewBabyOrders({ CreateNewBaby newChild}) async {
@ -25,13 +24,7 @@ class AddNewChildViewModel extends BaseViewModel {
} else {
isAdded = true;
setState(ViewState.Idle);
await _childVaccinesService.getAllBabyInformationOrders();
if (_childVaccinesService.hasError) {
error = _childVaccinesService.error;
setState(ViewState.Error);
} else{
}
}
}

@ -16,14 +16,11 @@ class ChildVaccinesViewModel extends BaseViewModel{
List<List_BabyInformationModel> get babyInformationModelList=> _childVaccinesService.babyInformationModelList;
//===========
CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>();
DeleteBabyService _deleteBabyService = locator<DeleteBabyService>();
bool isAdded = false;
bool isDeleted = false;
//============
getNewUserOrders() async {
@ -48,25 +45,15 @@ class ChildVaccinesViewModel extends BaseViewModel{
///delete baby
deleteBabyOrders({ DeleteBaby newChild}) async {
deleteBabyOrders({ List_BabyInformationModel babyInfo}) async {
setState(ViewState.Busy);
//await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID);
await _deleteBabyService.getDeleteBabyOrder(deleteChild: newChild,babyID: newChild.babyID);
//getDeleteBabyOrder(deleteChild: newChild,);
// getDeleteBabyOrder
if (_creteNewBabyService.hasError) {
error = _creteNewBabyService.error;
await _deleteBabyService.getDeleteBabyOrder(babyInfo: babyInfo);
if (_deleteBabyService.hasError) {
error = _deleteBabyService.error;
setState(ViewState.Error);
} else {
isDeleted = true;
setState(ViewState.Idle);
await _childVaccinesService.getAllBabyInformationOrders();
if (_childVaccinesService.hasError) {
error = _childVaccinesService.error;
setState(ViewState.Error);
} else{
}
getBabyInformatioRequestOrders();
}
}

@ -8,8 +8,7 @@ class UserInformationViewModel extends BaseViewModel {
UserInformationService _userInformationService =
locator<UserInformationService>();
List<List_UserInformationModel> get userInformationModelList =>
_userInformationService.userInformationModelList;
List_UserInformationModel get userInformationModelList => _userInformationService.userInformationModel;
getUserInformationRequestOrders() async {
setState(ViewState.Busy);
@ -20,4 +19,15 @@ class UserInformationViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
updateEmail(String email)async{
setState(ViewState.Busy);
await _userInformationService.updateEmail(email);
await _userInformationService.updateUserInfo(email);
if (_userInformationService.hasError) {
error = _userInformationService.error;
setState(ViewState.Error);
} else
await getUserInformationRequestOrders();
}
}

@ -1,30 +1,27 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/vaccination_table_service.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
class VaccinationTableViewModel extends BaseViewModel {
VaccinationTableService _creteVaccinationTableService =
locator<VaccinationTableService>();
class VaccinationTableViewModel extends BaseViewModel{
List<CreateVaccinationTable> get creteVaccinationTableModelList =>
_creteVaccinationTableService.createVaccinationTableModelList;
VaccinationTableService _creteVaccinationTableService = locator<VaccinationTableService>();
// String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent;
//String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent;
List<CreateVaccinationTable> get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList;
getCreateVaccinationTable() async {
getCreateVaccinationTable({List_BabyInformationModel babyInfo, List_UserInformationModel informationModel, bool isSendEmail =false}) async {
setState(ViewState.Busy);
await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders();
if ( _creteVaccinationTableService.hasError) {
error = _creteVaccinationTableService.error;
await _creteVaccinationTableService.getCreateVaccinationTableOrders(babyInfo: babyInfo,informationModel: informationModel,isSendEmail: isSendEmail);
if (_creteVaccinationTableService.hasError) {
error = _creteVaccinationTableService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,8 @@
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
class OrderPreviewViewModel extends BaseViewModel {
OrderPreviewService _orderService = locator<OrderPreviewService>();
}

@ -0,0 +1,73 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
class PharmacyModuleViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
List<PharmacyProduct> get bestSellerProduct =>
_pharmacyService.bestSellerProducts;
List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts;
Future getPharmacyHomeData() async {
setState(ViewState.Busy);
await _pharmacyService.getBannerListList();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
_getTopManufacturerList();
}
}
List<String> getBannerImagesUrl() {
List<String> images = List();
images.add('assets/images/pharmacy_module/pharmacy_logo_green.png');
_pharmacyService.bannerItems.forEach((element) {
images.add(element.src);
});
return images;
}
_getTopManufacturerList() async {
await _pharmacyService.getTopManufacturerList();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
_getBestSellerProducts();
}
}
_getBestSellerProducts() async {
await _pharmacyService.getBestSellerProducts();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
_getLastVisitedProducts();
}
}
_getLastVisitedProducts() async {
await _pharmacyService.getLastVisitedProducts();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:get_it/get_it.dart';
import 'core/service/AlHabibMedicalService/cmc_service.dart';
import 'core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'core/service/AlHabibMedicalService/e_referral_service.dart';
import 'core/service/AlHabibMedicalService/home_health_care_service.dart';
import 'core/service/AuthenticatedUserObject.dart';
@ -44,8 +45,11 @@ import 'core/service/medical/prescriptions_service.dart';
import 'core/service/medical/radiology_service.dart';
import 'core/service/medical/reports_monthly_service.dart';
import 'core/service/medical/vital_sign_service.dart';
import 'core/service/parmacyModule/order-preview-service.dart';
import 'core/service/notifications_service.dart';
import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'core/service/parmacyModule/parmacy_module_service.dart';
import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'core/viewModels/appointment_rate_view_model.dart';
import 'core/viewModels/blooddonation/blood_details_view_model.dart';
@ -82,6 +86,8 @@ import 'core/viewModels/pharmacies_view_model.dart';
import 'core/service/pharmacies_service.dart';
import 'core/service/insurance_service.dart';
import 'core/viewModels/insurance_card_View_model.dart';
import 'core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'core/viewModels/qr_view_model.dart';
import 'core/viewModels/vaccine_view_model.dart';
import 'core/service/vaccine_service.dart';
@ -135,6 +141,9 @@ void setupLocator() {
locator.registerLazySingleton(() => VaccinationTableService());
locator.registerLazySingleton(() => NotificationService());
locator.registerLazySingleton(() => WeatherService());
locator.registerLazySingleton(() => PharmacyModuleService());
locator.registerLazySingleton(() => OrderPreviewService());
locator.registerLazySingleton(() => CustomerAddressesService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -174,8 +183,12 @@ void setupLocator() {
locator.registerFactory(() => EyeViewModel());
locator.registerFactory(() => ActiveMedicationsViewModel());
locator.registerFactory(() => AskDoctorViewModel());
locator.registerFactory(() => AllergiesViewModel());
locator.registerFactory(() => HomeHealthCareViewModel());
locator.registerFactory(() => CMCViewModel());
locator.registerFactory(() => NotificationViewModel());
locator.registerFactory(() => PharmacyModuleViewModel());
locator.registerFactory(() => OrderPreviewViewModel());
}

@ -63,7 +63,7 @@ class MyApp extends StatelessWidget {
const Locale('ar', ''), // Arabic
const Locale('en', ''), // English
],
//theme: themeNotifier.getTheme(),
// theme: themeNotifier.getTheme(),
theme:ThemeData(
fontFamily:projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
@ -76,26 +76,31 @@ class MyApp extends StatelessWidget {
},
),
hintColor: Colors.grey[400],
textTheme: TextTheme(
headline1: TextStyle(
color: Color(0xffB8382C),
),
),
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffEEEEEE),
scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100],
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
primaryColor: Colors.grey,
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.grey,
cardColor: Colors.white,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Color(0xff40ACC9),
brightness: Brightness.dark,
elevation: 10.0,
color: Colors.grey[700],
brightness: Brightness.light,
elevation: 0.0,
actionsIconTheme: IconThemeData(
color: Color(0xff40ACC9),
color: Colors.grey[800],
),
),
),

@ -0,0 +1,147 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_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/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
class CMCLocationPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final dynamic model;
const CMCLocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model})
: super(key: key);
@override
_CMCLocationPageState createState() =>
_CMCLocationPageState();
}
class _CMCLocationPageState
extends State<CMCLocationPage> {
double latitude = 0;
double longitude = 0;
@override
void initState() {
latitude = widget.latitude;
longitude = widget.longitude;
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<CMCViewModel>(
onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold(
isShowDecPage: false,
isShowAppBar: true,
baseViewModel: model,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () async {
print(selectedPlace);
AddNewAddressRequestModel
addNewAddressRequestModel =
new AddNewAddressRequestModel(
customer: Customer(addresses: [
Addresses(
address1:
selectedPlace.formattedAddress,
address2: selectedPlace
.formattedAddress,
customerAttributes: "",
city: "",
createdOnUtc: "",
id: 0,
latLong: "$latitude,$longitude",
email: "")
]),
);
selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer
.addresses[0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer
.addresses[0].zipPostalCode =
e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer
.addresses[0].city =
e.longName;
}
});
await model.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(
message: "Address Added Successfully");
}
Navigator.of(context).pop();
},
label: " Add New Address ",
),
],
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false,
),
));
}
}

@ -134,7 +134,7 @@ class _NewCMCPageState extends State<NewCMCPage>
children: <Widget>[
widget.model.cmcAllOrderDetail.length != 0
? FractionallySizedBox(
heightFactor: 0.8,
heightFactor: 0.9,
widthFactor: 0.9,
child: Container(
width: double.infinity,

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -199,26 +201,42 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
child: SecondaryButton(
label: "Next",
textColor: Theme.of(context).backgroundColor,
onTap: () {
if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) {
color: Colors.grey[800],
onTap: () async {
if (widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList.length !=
0 ||
widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList ==
null) {
int index = widget.model.cmcAllServicesList.length;
PatientERCMCInsertServicesList
patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList(
price: widget.model.cmcAllServicesList[index-1].price,
serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(),
selectedServiceName: widget.model.cmcAllServicesList[index-1].description,
selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description,
price: widget
.model.cmcAllServicesList[index - 1].price,
serviceID: widget
.model.cmcAllServicesList[index - 1].serviceID
.toString(),
selectedServiceName: widget.model
.cmcAllServicesList[index - 1].description,
selectedServiceNameAR: widget.model
.cmcAllServicesList[index - 1].description,
recordID: 1,
totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice,
totalPrice: widget
.model.cmcAllServicesList[index - 1].totalPrice,
vAT: widget.model.cmcAllServicesList[index-1].vAT);
widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = [
patientERCMCInsertServicesList
];
widget.changePageViewIndex(1);
await widget.model.getCustomerInfo();
if(widget.model.state == ViewState.ErrorLocal){
Utils.showErrorToast();
} else {
widget.changePageViewIndex(1);
}
}
},
),

@ -149,6 +149,7 @@ class _NewCMCStepThreePageState
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: "Confirm",
color: Colors.grey[800],
onTap: () async {
await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) {

@ -1,19 +1,22 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_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/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
import 'cmc_location_page.dart';
class NewCMCStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
@ -41,12 +44,13 @@ class _NewCMCStepTowPageState
extends State<NewCMCStepTowPage> {
double latitude = 0;
double longitude = 0;
AddressInfo _selectedAddress;
@override
void initState() {
if (widget.cmcInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude;
longitude = widget.longitude;
setLatitudeAndLongitude();
} else {
latitude = widget.cmcInsertPresOrderRequestModel.latitude;
longitude = widget.cmcInsertPresOrderRequestModel.longitude;
@ -54,60 +58,152 @@ class _NewCMCStepTowPageState
super.initState();
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) {
if (latLong == null)
latLong = widget.model.addressesList[widget.model.addressesList
.length - 1].latLong;
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
return AppScaffold(
isShowDecPage: false,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.cmcInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.cmcInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).next,
),
body: Stack(
children: [
PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
CMCLocationPage(
latitude: latitude,
longitude: longitude,
),
),
);
},
label: " Add New Address ",
),
SizedBox(height: 10,),
SecondaryButton(
color: Colors.red
[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.cmcInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.cmcInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).confirm,
),
);
],
)
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false,
),
Container(
child: InkWell(
onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList),
child: Container(
padding: EdgeInsets.all(10),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getAddressName(), fontSize: 14,),),
Icon(Icons.arrow_drop_down)
],
),
),
),
height: 56, width: double.infinity, color: Theme
.of(context)
.scaffoldBackgroundColor,
)
],
),
);
}
void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog(
context: context,
child: SelectLocationDialog(
addresses: addresses,
selectedAddress: _selectedAddress
,
onValueSelected: (value) {
setLatitudeAndLongitude(latLong: value.latLong);
setState(() {
_selectedAddress = value;
});
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: true,
),
);
}
String getAddressName() {
if (_selectedAddress != null)
return _selectedAddress.address1;
else
return "Select Address" /*TranslationBase.of(context).selectHospital*/;
}
}

@ -1,68 +0,0 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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:hexcolor/hexcolor.dart';
import 'cmc_page.dart';
class CMCIndexPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).serviceInformation,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
"CMC",
fontWeight: FontWeight.normal,
fontSize: 25,
color: Color(0xff60686b),
),
SizedBox(
height: 12,
),
Texts(
"This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.",
fontWeight: FontWeight.normal,
fontSize: 17,
),
SizedBox(
height: 22,
),
Center(
child: Image.asset(
'assets/images/AlHabibMedicalService/Wifi-AR.png')),
SizedBox(
height: 77,
),
],
)),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: () => Navigator.push(
context,
FadePage(
page: CMCPage(),
),
),
label: "CMC",
textColor: Theme.of(context).backgroundColor),
),
],
),
));
}
}

@ -40,7 +40,8 @@ class _CMCPageState extends State<CMCPage>
},
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).homeHealthCare,
description: TranslationBase.of(context).HHCNotAuthMsg,
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(

@ -40,34 +40,32 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NewEReferralStepOnePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepTowPage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepThreePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
],
),
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NewEReferralStepOnePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepTowPage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepThreePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
],
),
),
),

@ -6,28 +6,29 @@ import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.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/E-Referral/e_referral_confirm_sms_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
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';
class NewEReferralStepOnePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex;
const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key);
const NewEReferralStepOnePage(
{Key key, this.createEReferralRequestModel, this.changePageViewIndex})
: super(key: key);
@override
_NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState();
_NewEReferralStepOnePageState createState() =>
_NewEReferralStepOnePageState();
}
class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
@ -64,27 +65,25 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
context: context,
barrierDismissible: false,
child: EReferralConfirmSMSDialog(
phoneNumber: _selectedCountry['code']+_mobileTextController.text,
onSucces: (){
Navigator.of(context).pop();
widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName=_nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text;
widget.createEReferralRequestModel.requesterRelationship=_selectedRelation.iD;
}
),
phoneNumber: _selectedCountry['code'] + _mobileTextController.text,
onSucces: () {
Navigator.of(context).pop();
widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName =
_nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo =
_selectedCountry['code'].toString().substring(1) +
_mobileTextController.text;
widget.createEReferralRequestModel.requesterRelationship =
_selectedRelation.iD;
}),
).then((value) {
print("dialog dismissed");
print(value);
if (value != null && value) {
}
if (value != null && value) {}
});
}
return BaseView<EReferralViewModel>(
onModelReady: (model) => model.getRelationTypes(),
builder: (_, model, widget) => AppScaffold(
@ -92,7 +91,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.all(12),
margin: EdgeInsets.all(10),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
@ -100,11 +99,10 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
height: 80,
),
Center(
child: Texts(
// TranslationBase.of(context).advancePaymentLabel,
"Referral requester information",
textAlign: TextAlign.center,
),
@ -185,34 +183,30 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
),
),
bottomSheet: Container(
height: MediaQuery
.of(context)
.size
.height * 0.1,
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
padding: EdgeInsets.all(9),
child: SecondaryButton(
textColor: Colors.white,
label: "Next",
onTap: () async {
SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel =
SendActivationCodeForEReferralRequestModel(
onTap: () async {
SendActivationCodeForEReferralRequestModel
sendActivationCodeForEReferralRequestModel =
SendActivationCodeForEReferralRequestModel(
zipCode: _selectedCountry['code'],
patientMobileNumber: int.parse(
_mobileTextController.text),);
await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
patientMobileNumber: int.parse(_mobileTextController.text),
);
await model.sendActivationCodeForEReferral(
sendActivationCodeForEReferralRequestModel);
showSMSDialog();
},
loading: model.state == ViewState.BusyLocal,
disabled:
_nameTextController.text.isEmpty ||
disabled: _nameTextController.text.isEmpty ||
_selectedRelation == null ||
_mobileTextController.text.isEmpty,
),
)));
}
void confirmSelectRelationTypeDialog(
@ -261,12 +255,8 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
}
class MobileNumberTextFiled extends StatelessWidget {
const MobileNumberTextFiled({
Key key,
this.controller,
this.code
}) : super(key: key);
const MobileNumberTextFiled({Key key, this.controller, this.code})
: super(key: key);
final TextEditingController controller;
final String code;

@ -1,21 +1,23 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_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/E-Referral/dialogs/select_project_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.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';
class NewEReferralStepThreePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex;
@ -32,7 +34,8 @@ class NewEReferralStepThreePage extends StatefulWidget {
class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
TextEditingController _nameTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController();
GetAllCitiesResponseModel _selectedCity;
GetAllProjectsResponseModel _selectedHospital;
GetAllSharedRecordsByStatusList selectedPatientFamily;
List<EReferralAttachment> medicalReportImages = [];
@ -50,6 +53,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
@override
Widget build(BuildContext context) {
return BaseView<EReferralViewModel>(
onModelReady: (model) => model.getAllProjects(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
@ -64,7 +68,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
height: 80,
),
Center(
child: Texts(
@ -103,8 +107,13 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
ImageOptions.showImageOptions(context,
(String image) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
medicalReportImages.add(eReferralAttachment);
EReferralAttachment eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
medicalReportImages
.add(eReferralAttachment);
});
});
},
@ -158,15 +167,17 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
width: 8,
),
Texts(
medicalReportImages[index].fileName,
medicalReportImages[index]
.fileName,
),
],
),
InkWell(
onTap: () {
setState(() {
medicalReportImages
.remove(medicalReportImages[index]);
medicalReportImages.remove(
medicalReportImages[
index]);
});
},
child: Icon(
@ -205,7 +216,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
InkWell(
onTap: () =>
confirmSelectCityDialog(model.allCities),
confirmSelectHospital(model.allHospitals),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
@ -262,12 +273,12 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
],
),
),
if(isPatientInsured)
SizedBox(
height: 12,
),
if (isPatientInsured)
SizedBox(
height: 12,
),
Opacity(
opacity: isPatientInsured?1:0,
opacity: isPatientInsured ? 1 : 0,
child: Container(
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
@ -276,16 +287,21 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
child: Column(
children: [
InkWell(
onTap: () {
ImageOptions.showImageOptions(context,
(String image) {
setState(() {
EReferralAttachment
eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
insuredPatientImages=[eReferralAttachment];
insuredPatientImages = [
eReferralAttachment
];
});
});
},
@ -333,8 +349,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Icon(
FontAwesomeIcons.paperclip),
Icon(FontAwesomeIcons
.paperclip),
SizedBox(
width: 8,
),
@ -346,8 +362,9 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
InkWell(
onTap: () {
setState(() {
insuredPatientImages
.remove(insuredPatientImages[index]);
insuredPatientImages.remove(
insuredPatientImages[
index]);
});
},
child: Icon(
@ -378,50 +395,72 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
textColor: Colors.white,
label: "Submit",
onTap: () async {
this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages;
this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length !=0?insuredPatientImages[0]:null;
this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured;
this
.widget
.createEReferralRequestModel
.medicalReportAttachment = medicalReportImages;
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 = 15;
this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
this.widget.createEReferralRequestModel.preferredBranchCode =
_selectedHospital.iD;
this.widget.createEReferralRequestModel.preferredBranchName =
_selectedHospital.desciption;
this.widget.createEReferralRequestModel.otherRelationship =
"";
// this.widget.createEReferralRequestModel.fullName= "";
this.widget.createEReferralRequestModel.otherRelationship= "";
// this.widget.createEReferralRequestModel.;
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
await model.createEReferral(this.widget.createEReferralRequestModel);
await model
.createEReferral(this.widget.createEReferralRequestModel)
.then((value) {
AlertDialogBox(
context: context,
confirmMessage:
TranslationBase.of(context).ereferralSaveSuccess +
value['ReferralNumber'].toString(),
okText: TranslationBase.of(context).ok,
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
navigateToHome(context);
}).showAlertDialog(context);
});
},
loading: model.state == ViewState.BusyLocal,
disabled: medicalReportImages.length == 0 ,
disabled: medicalReportImages.length == 0,
),
)));
}
void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) {
Future navigateToHome(context) async {
Navigator.of(context).popAndPushNamed(HOME);
}
void confirmSelectHospital(List<GetAllProjectsResponseModel> projects) {
showDialog(
context: context,
child: SelectCityDialog(
cities: cities,
selectedCity: _selectedCity,
child: SelectHospitalDialog(
hospitals: projects,
selectedHospital: _selectedHospital,
onValueSelected: (value) {
setState(() {
_selectedCity = value;
_selectedHospital = value;
});
},
),
);
}
String getRelationName() {
if (_selectedCity != null)
return _selectedCity.description;
if (_selectedHospital != null)
return _selectedHospital.desciption;
else
return "Select Relationship" /*TranslationBase.of(context).selectHospital*/;
return "Select Hospital*" /*TranslationBase.of(context).selectHospital*/;
}
}

@ -71,7 +71,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 30,
height: 80,
),
Center(
child: Texts(

@ -0,0 +1,129 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
class SelectHospitalDialog extends StatefulWidget {
final List<GetAllProjectsResponseModel> hospitals;
final Function(GetAllProjectsResponseModel) onValueSelected;
GetAllProjectsResponseModel selectedHospital;
SelectHospitalDialog(
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override
_SelectHospitalDialogState createState() => _SelectHospitalDialogState();
}
class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
@override
void initState() {
super.initState();
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Divider(),
...List.generate(
widget.hospitals.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedHospital = widget.hospitals[index];
});
},
child: ListTile(
title: Text(widget.hospitals[index].desciption),
leading: Radio(
value: widget.hospitals[index],
groupValue: widget.selectedHospital,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedHospital = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedHospital);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),
),
),
],
)
],
)
],
);
}
}

@ -88,13 +88,13 @@ class _EReferralPageState extends State<EReferralPage>
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts("New Referral"),
child: Texts("New Referral", fontSize: 14.0),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts("Search for Referrals"),
child: Texts("Search for Referrals", fontSize: 14.0),
),
),
],

@ -0,0 +1,145 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_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/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
class LocationPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final dynamic model;
const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model})
: super(key: key);
@override
_LocationPageState createState() =>
_LocationPageState();
}
class _LocationPageState
extends State<LocationPage> {
double latitude = 0;
double longitude = 0;
@override
void initState() {
latitude = widget.latitude;
longitude = widget.longitude;
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold(
isShowDecPage: false,
isShowAppBar: true,
baseViewModel: model,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () async {
AddNewAddressRequestModel
addNewAddressRequestModel =
new AddNewAddressRequestModel(
customer: Customer(addresses: [
Addresses(
address1:
selectedPlace.formattedAddress,
address2: selectedPlace
.formattedAddress,
customerAttributes: "",
city: "",
createdOnUtc: "",
id: 0,
latLong: "$latitude,$longitude",
email: "")
]),
);
selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer
.addresses[0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer
.addresses[0].zipPostalCode =
e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer
.addresses[0].city =
e.longName;
}
});
await model.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(
message: "Address Added Successfully");
}
Navigator.of(context).pop();
},
label: " Add New Address ",
),
],
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false,
),
));
}
}

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -138,9 +139,17 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length == 0,
onTap: (){
widget.changePageViewIndex(1);
.length == 0 || widget.model.state == ViewState.BusyLocal,
color: Colors.grey[800],
loading:widget.model.state == ViewState.BusyLocal,
onTap: () async{
await widget.model.getCustomerInfo();
if(widget.model.state == ViewState.ErrorLocal){
Utils.showErrorToast();
} else {
widget.changePageViewIndex(1);
}
},
textColor: Theme.of(context).backgroundColor),
),

@ -155,6 +155,7 @@ class _NewHomeHealthCareStepThreePageState
disabled: widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList.length ==
0,
color: Colors.grey[800],
onTap: () async {
await widget.model.insertPresPresOrder(
order: widget.patientERInsertPresOrderRequestModel);

@ -1,17 +1,20 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
import 'location_page.dart';
class NewHomeHealthCareStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
@ -40,73 +43,163 @@ class _NewHomeHealthCareStepTowPageState
extends State<NewHomeHealthCareStepTowPage> {
double latitude = 0;
double longitude = 0;
AddressInfo _selectedAddress;
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude;
longitude = widget.longitude;
setLatitudeAndLongitude();
} else {
latitude = widget.patientERInsertPresOrderRequestModel.latitude;
longitude = widget.patientERInsertPresOrderRequestModel.longitude;
}
super.initState();
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) {
if (latLong == null)
latLong = widget.model.addressesList[widget.model.addressesList
.length - 1].latLong;
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientERInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.patientERInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).next,
),
),
);
body: Stack(
children: [
PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
LocationPage(
latitude: latitude,
longitude: longitude,
),
),
);
},
label: " Add New Address ",
),
SizedBox(height: 10,),
SecondaryButton(
color: Colors.red[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientERInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.patientERInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: " Continue ",
),
],
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false,
),
Container(
child: InkWell(
onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList),
child: Container(
padding: EdgeInsets.all(10),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getAddressName(), fontSize: 14,),),
Icon(Icons.arrow_drop_down)
],
),
),
),
height: 56, width: double.infinity, color: Theme
.of(context)
.scaffoldBackgroundColor,
)
],
),
);
}
void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog(
context: context,
child: SelectLocationDialog(
addresses: addresses,
selectedAddress: _selectedAddress
,
onValueSelected: (value) {
setLatitudeAndLongitude(latLong: value.latLong);
setState(() {
_selectedAddress = value;
});
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: true,
),
);
}
String getAddressName() {
if (_selectedAddress != null)
return _selectedAddress.address1;
else
return "Select Address" /*TranslationBase.of(context).selectHospital*/;
}
}

@ -1,69 +0,0 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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:hexcolor/hexcolor.dart';
import 'home_health_care_page.dart';
class HomeHealthCareIndexPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).serviceInformation,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
TranslationBase.of(context).homeHealthCare,
fontWeight: FontWeight.normal,
fontSize: 25,
color: Color(0xff60686b),
),
SizedBox(
height: 12,
),
Texts(
TranslationBase.of(context).homeHealthCareText,
fontWeight: FontWeight.normal,
fontSize: 17,
),
SizedBox(
height: 22,
),
Center(
child: Image.asset(
'assets/images/AlHabibMedicalService/Wifi-AR.png')),
SizedBox(
height: 77,
),
],
)),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: () => Navigator.push(
context,
FadePage(
page: HomeHealthCarePage(),
),
),
label: TranslationBase.of(context).loginRegister,
textColor: Theme.of(context).backgroundColor),
),
],
),
));
}
}

@ -42,7 +42,9 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
},
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
description: TranslationBase.of(context).HHCNotAuthMsg,
appBarTitle: TranslationBase.of(context).homeHealthCare,
// appBarTitle: TranslationBase.of(context).homeHealthCare,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(

@ -152,6 +152,16 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/new-design/my_file_bottom_bar.png',
title: TranslationBase.of(context).myMedicalFile,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: LiveCareHome(),
),
),
imageLocation: 'assets/images/new-design/liveCare_ar_bg.png',
title: TranslationBase.of(context).livecare,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -176,6 +186,15 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).onlinePaymentService,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(),
),
imageLocation:
'assets/images/al-habib_online_payment_service_icon.png',
title: 'Covid-19- Drive-Thru Test',
),
ServicesContainer(
onTap: () {
Navigator.push(
@ -190,6 +209,37 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
imageLocation: 'assets/images/emergency_service_image.png',
title: TranslationBase.of(context).emergencyService,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: ParkingPage(),
),
),
imageLocation: 'assets/images/pharmacy_logo.png',
title: 'Pharmacy'),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: InsuranceUpdate(),
),
),
imageLocation:
'assets/images/medical/insurance_card_icon.png',
title: TranslationBase.of(context).updateInsurance,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: authUser.patientID == null
? EReferralIndexPage()
: EReferralPage()),
),
imageLocation: 'assets/images/ereferral_service_icon.png',
title: 'E-Referral',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -201,6 +251,15 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/new-design/family_menu_icon_red.png',
title: 'My Family',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: ChildVaccinesPage()),
),
imageLocation:
'assets/images/new-design/children_vaccines_icon.png',
title: 'Child Vaccines',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -212,6 +271,61 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/new-design/upcoming_icon_bottom_bar.png',
title: TranslationBase.of(context).todoList,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: SymptomInfo()),
),
imageLocation: 'assets/images/new-design/body_icon.png',
title: 'Symptom Checker'),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: BloodDonationPage()),
),
imageLocation: 'assets/images/new-design/blood_icon.png',
title: 'Blood Donation',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: (HealthCalculators()),
),
),
imageLocation:
'assets/images/new-design/health_calculator_icon.png',
title: 'Health Calculators',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: HealthConverter(),
),
),
imageLocation:
'assets/images/new-design/health_convertor_icon.png',
title: 'Health Converter',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: H2OPageIndexPage(),
),
),
imageLocation: 'assets/images/new-design/water_icon.png',
title: 'H2O',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(),
),
imageLocation: 'assets/images/new-design/smartwatch_icon.png',
title: TranslationBase.of(context).smartWatches,
),
ServicesContainer(
onTap: () => Navigator.push(
context,

@ -0,0 +1,120 @@
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.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/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
import 'dialogs/delete_child.dart';
class ChildDetailsWidget extends StatelessWidget {
final ChildVaccinesViewModel model;
final List_BabyInformationModel babyInfo;
final List_UserInformationModel informationModel;
final Function onTapDelete;
ChildDetailsWidget({this.model, this.babyInfo, this.informationModel, this.onTapDelete});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: (){
Navigator.push(
context,
FadePage(
page: VaccinationTablePage(
babyInfo: babyInfo,
informationModel: informationModel,
),
),
);
},
child: Container(
margin: EdgeInsets.only(left: 5, right: 5, bottom: 10),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.white,
),
padding: EdgeInsets.all(12),
width: 200,
//double.infinity,
child: Column(
children: [
Row(children: [
Texts(TranslationBase.of(context).childName),
]),
Row(children: [
Texts(babyInfo.babyName.trim()),
]),
Row(children: [
IconButton(
icon: Image.asset(babyInfo.gender == 1
? 'assets/images/new-design/male.png'
: 'assets/images/new-design/female.png'),
tooltip: '',
onPressed: () {
},
),
Texts(babyInfo.genderDescription),
IconButton(
icon: Icon(
Icons.remove_red_eye,
color: Colors.red,
),
tooltip: '',
onPressed: () {
Navigator.push(
context,
FadePage(
page: VaccinationTablePage(
babyInfo: babyInfo,
informationModel: informationModel,
),
),
);
},
)
]),
Row(children: [
Texts(TranslationBase.of(context).childDob),
]),
Row(
children: [
IconButton(
icon: new Image.asset(
'assets/images/new-design/calender-secondary.png'),
tooltip: '',
),
Texts(
DateUtil.yearMonthDay(babyInfo.dOB),
),
],
),
Row(children: [
IconButton(
icon: new Image.asset('assets/images/new-design/garbage.png'),
tooltip: '',
onPressed: () async {
onTapDelete();
},
),
Texts(TranslationBase.of(context).delete),
]),
SizedBox(
height: 12,
),
],
),
),
);
}
}

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -21,39 +22,16 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
enum Gender { Male, Female, NON }
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
class AddNewChildPage extends StatefulWidget {
final int frequency;
final int days;
final String itemDescription;
String dateAdd;
List<DateTime> _scheduleList = List();
List<DayOfWeek> daysOfWeek = [
DayOfWeek.Monday,
DayOfWeek.Tuesday,
DayOfWeek.Wednesday,
DayOfWeek.Thursday,
DayOfWeek.Friday,
DayOfWeek.Saturday,
DayOfWeek.Sunday
];
DateTime startDay;
DateTime endDay;
//AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key);
AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) {
AddNewChildPage() {
startDay = DateTime.now();
endDay =
DateTime.now(); //endDay = DateTime.now().add(Duration(days: days));
int hour = 24; //(24 / frequency).round();
int durations = 24 ~/ hour;
for (int count = 0; count < durations; count++) {
_scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day, (hour * count)));
}
endDay = DateTime.now();
}
@override
@ -61,150 +39,140 @@ class AddNewChildPage extends StatefulWidget {
}
class _AddNewChildPageState extends State<AddNewChildPage> {
int tappedIndex;
int checkedValue;
@override
void initState() {
super.initState();
tappedIndex = -1;
}
TextEditingController _firstTextController = TextEditingController();
TextEditingController _secondTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON;
Gender gender = Gender.Male;
CreateNewUser_New newUserChild = CreateNewUser_New();
//ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel();
List_BabyInformationModel addvancedModel = List_BabyInformationModel();
CreateNewBaby newChild = CreateNewBaby();
List_UserInformationModel informationModel = List_UserInformationModel();
String firstName = "";
String secondName = "";
@override
Widget build(BuildContext context) {
return BaseView<AddNewChildViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: "Vaccintion",
appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.all(12),
child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 50,
),
Texts(
"Add the child's information below to recieve the schedule of vaccinations.",
//+model.user.firstName,
textAlign: TextAlign.center,
height: 25,
),
Texts(TranslationBase.of(context).addInstructions),
SizedBox(
height: 12,
height: 20,
),
NewTextFields(
hintText: "First Name",
hintText: TranslationBase.of(context).firstName,
controller: _firstTextController,
onChanged: (value) {
setState(() {
firstName = value;
});
},
),
SizedBox(
height: 12,
),
NewTextFields(
hintText: "Second Name",
hintText: TranslationBase.of(context).lastName,
controller: _secondTextController,
onChanged: (value) {
secondName = value;
},
),
SizedBox(
height: 12,
height: 20,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Gender:",
TranslationBase.of(context).gender + " :",
textAlign: TextAlign.end,
),
],
),
SizedBox(
height: 15,
),
Container(
height: MediaQuery.of(context).size.height * 0.12,
height: 60,
width: double.infinity,
padding: EdgeInsets.all(12),
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.12,
width: 175,
color: Colors.white,
child: SecondaryButton(
textColor:
checkedValue == 1 ? Colors.white : Colors.black,
color: checkedValue == 1 ? Colors.red : Colors.white,
label: "Male",
//
onTap: () {
setState(() {
checkedValue = 1;
print("checkedValue=" + checkedValue.toString());
});
// bloodDetails.
},
Expanded(
child: AnimatedContainer(
duration: Duration(milliseconds: 400),
height: 60,
color: Colors.white,
child: SecondaryButton(
textColor:
checkedValue == 1 ? Colors.white : Colors.black,
color:
checkedValue == 1 ? Colors.red : Colors.white,
label: TranslationBase.of(context).male,
onTap: () {
setState(() {
checkedValue = 1;
});
},
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.12,
width: 175,
color: Colors.white,
child: SecondaryButton(
textColor:
checkedValue == 2 ? Colors.white : Colors.black,
color: checkedValue == 2 ? Colors.red : Colors.white,
label: "Female",
//
onTap: () {
setState(() {
checkedValue = 2;
print("checkedValue=" + checkedValue.toString());
});
// bloodDetails.city=_selectedHospital.toString();
// bloodDetails.
},
Expanded(
child: AnimatedContainer(
duration: Duration(milliseconds: 400),
height: 60,
color: Colors.white,
child: SecondaryButton(
textColor:
checkedValue == 2 ? Colors.white : Colors.black,
color:
checkedValue == 2 ? Colors.red : Colors.white,
label: TranslationBase.of(context).female,
onTap: () {
setState(() {
checkedValue = 2;
});
},
),
),
)
],
),
),
//==========
SizedBox(
height: 6,
height: 20,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Date Of Birth::",
TranslationBase.of(context).dob + " :",
textAlign: TextAlign.end,
),
],
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
// minTime: DateTime(
// DateTime.now().year, DateTime.now().month - 1, 1),
minTime: DateTime(1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
@ -213,7 +181,6 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
});
},
currentTime: widget.startDay,
// locale: projectViewModel.localeType
);
},
child: Container(
@ -224,99 +191,63 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(//getStartDay()
// DateUtil.yearMonthDay(DateTime.now())
getStartDay()),
Icon(
Icons.calendar_today,
color: Colors.black,
)
),
SizedBox(
width: 25,
),
Expanded(child: Texts(getStartDay())),
],
),
),
),
SizedBox(
height: 12,
height: 25,
),
Container(
height: MediaQuery.of(context).size.height * 0.12,
height: 60,
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue == false
? Colors.white24
: Color.fromRGBO(
63,
72,
74,
1,
),
label: "Add",
//
onTap: () async{
newChild.babyName = _firstTextController.text + " " + _secondTextController.text;
color: Colors.grey[800],
disabled: (checkedValue == null ||
firstName.isEmpty ||
secondName.isEmpty),
label: TranslationBase.of(context).add,
onTap: () async {
newChild.babyName = _firstTextController.text +
" " +
_secondTextController.text;
newChild.gender = checkedValue.toString();
newChild.strDOB = getStartDay();
newChild.strDOB = widget.startDay.toIso8601String();
newChild.tempValue = true;
newChild.isLogin = true;
await model.createNewBabyOrders(newChild: newChild);
if(model.isAdded){
AppToast.showSuccessToast(message: "Record Added");
Navigator.pop(context,model.isAdded);
}else{
//TODO handling error
if (model.isAdded) {
AppToast.showSuccessToast(
message: TranslationBase.of(context).addedChild);
Navigator.pop(context, model.isAdded);
} else {
AppToast.showSuccessToast(message: model.error);
}
},
),
),
//=========
],
),
),
),
// bottomSheet:
// bottomSheet:
),
);
}
String getStartDay() {
return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}";
}
String getEndDay() {
return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}";
}
String getDateTime(DateTime dateTime) {
return '${dateTime.hour}:${dateTime.minute}';
}
String getDays() {
String days = "";
widget.daysOfWeek.forEach((element) {
days += "${DateUtil.getDay(element)},";
});
return days;
}
void confirmSelectDayDialog() {
showDialog(
context: context,
child: DayCheckBoxDialog(
title: 'Select Day',
selectedDaysOfWeek: widget.daysOfWeek,
onValueSelected: (value) {
setState(() {
widget.daysOfWeek = value;
});
},
),
);
return "${widget.startDay.day}-${widget.startDay.month}-${widget.startDay.year}";
}
}

@ -1,10 +1,12 @@
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -12,191 +14,109 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
import 'ChidDetailsWidget.dart';
import 'dialogs/delete_child.dart';
class ChildPage extends StatefulWidget {
final List_UserInformationModel informationModel;
const ChildPage({Key key, this.informationModel}) : super(key: key);
@override
_ChildPageState createState() => _ChildPageState();
}
class _ChildPageState extends State<ChildPage>
with SingleTickerProviderStateMixin {
DeleteBaby deleteBaby = DeleteBaby();
@override
Widget build(BuildContext context) {
var checkedValue = true;
return BaseView<ChildVaccinesViewModel>(
onModelReady: (model) => model.getNewUserOrders(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: " Vaccination",
baseViewModel: model,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 15, right: 15, top: 70),
child: Column(
children: [
...List.generate(
model.babyInformationModelList.length,
(index) => Container(
margin: EdgeInsets.only(
left: 0, right: 0, bottom: 20),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.white, width: 0.5),
borderRadius:
BorderRadius.all(Radius.circular(5)),
color: Colors.white,
),
padding: EdgeInsets.all(12),
width: 200,//double.infinity,
child: Column(
children: [
Row(children: [
Texts("CHILD NAME"),
]),
Row(children: [
Texts(model
.babyInformationModelList[index]
.babyName
.trim()),
]),
Row(children: [
IconButton(
icon: Image.asset(model
.babyInformationModelList[
index]
.gender ==
1
? 'assets/images/new-design/male.png'
: 'assets/images/new-design/female.png'),
tooltip: '',
onPressed: () {
setState(() {
// _volume += 10;
// launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
});
},
),
Texts(model
.babyInformationModelList[index]
.genderDescription),
IconButton(
icon: Icon(
Icons.remove_red_eye,
color: Colors.red,
),
tooltip: '',
onPressed: () {
Navigator.push(
context,
FadePage(
page: VaccinationTablePage(),
),
);
},
)
]),
Row(children: [
Texts("Birthday"),
]),
Row(children: [
IconButton(
icon: new Image.asset(
'assets/images/new-design/calender-secondary.png'),
tooltip: '',
onPressed: () {
setState(() {
});
},
),
Texts(DateUtil.yearMonthDay(model
.babyInformationModelList[index]
.dOB)),
]),
Row(children: [
IconButton(
icon: new Image.asset(
'assets/images/new-design/garbage.png'),
tooltip: '',
onPressed: ()async {
//=====================
await model.deleteBabyOrders(newChild:deleteBaby );
deleteBaby.babyID=model.babyInformationModelList[index]
.babyID;
await model.deleteBabyOrders(newChild:deleteBaby );
if(model.isDeleted){
AppToast.showSuccessToast(message: "Record Deleted");
Navigator.pop(context,model.isDeleted);
}else{
//TODO handling error
}
},
),
Texts("Delete"),
]),
SizedBox(
height: 12,
),
],
),
),
)
],
))
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue == false
? Colors.white24
: Color.fromRGBO(
63,
72,
74,
1,
),
label: "ADD NEW CHILD ",
//
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddNewChildPage(),
),
).then((value) {
if (value) model.getNewUserOrders();
});
onModelReady: (model) => model.getNewUserOrders(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).vaccination,
baseViewModel: model,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 10),
child: Column(
children: [
GridView.builder(
shrinkWrap: true,
primary: false,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: MediaQuery.of(context).size.width /
(MediaQuery.of(context).size.height / 1.45),
),
itemCount: model.babyInformationModelList.length,
itemBuilder: (BuildContext context, int index) {
return ChildDetailsWidget(
model: model,
babyInfo: model.babyInformationModelList[index],
informationModel: widget.informationModel,
onTapDelete: () {
showDialog(
context: context,
child: DeleteChild(onTap: () async {
await model.deleteBabyOrders(babyInfo: model.babyInformationModelList[index]);
if (model.isDeleted) {
AppToast.showSuccessToast(
message:
TranslationBase.of(context).emailSuccess,
toastLength: Toast.LENGTH_LONG);
} else {
AppToast.showSuccessToast(message: model.error);
}
}),
);
},
);
},
),
),
));
SizedBox(
height: 15,
),
],
),
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue == false
? Colors.white24
: Color.fromRGBO(
63,
72,
74,
1,
),
label: TranslationBase.of(context).addChild,
//
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddNewChildPage(),
),
).then((value) {
if (value!=null)
model.getNewUserOrders();
});
},
),
),
),
);
}
}

@ -1,10 +1,10 @@
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
@ -13,214 +13,142 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ChildVaccinesPage extends StatefulWidget {
@override
_ChildVaccinesPageState createState() => _ChildVaccinesPageState();
}
class _ChildVaccinesPageState extends State<ChildVaccinesPage>
with SingleTickerProviderStateMixin{
with SingleTickerProviderStateMixin {
TextEditingController titleController = TextEditingController();
var checkedValue=false;
String addEmail="";
var checkedValue = false;
String addEmail = "";
final updateEmailFormKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return BaseView<UserInformationViewModel>(
onModelReady: (model) => model.getUserInformationRequestOrders(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
baseViewModel: model,
appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(10.0),
child:Container(
child: Texts("Welcome back",fontSize: 20,),
) ,
),
Divider(color:Colors.black , indent: 10,
endIndent: 10,),
SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(10.0),
child:Container(
child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,),
) ,
isShowAppBar: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
child: Texts(
TranslationBase.of(context).welcomeBackV,
fontSize: 20,
),
Divider(color:Colors.black , indent: 10,
endIndent: 10,),
Padding(
padding: const EdgeInsets.all(10.0),
child:Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
fillColor: Colors.red,
hintText: model.user.emailAddress,
controller: titleController,
fontSize: 20,
hintColor: Colors.black,
fontWeight: FontWeight.w600,
onChanged: (text) {
addEmail=text;
model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true;
},
validator: (value) {
if (value == null)
{
return model.user.emailAddress;
}
else
{
return model.user.emailAddress;}
},
),
),
),
),
Divider(
color: Colors.black,
indent: 10,
endIndent: 10,
),
SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
child: Texts(
TranslationBase.of(context).instructions,
fontSize: 20,
),
Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,),
label: "UPDATE EMAIL",
//
onTap: (){
model.user.emailAddress=addEmail.toString();
AppToast.showSuccessToast(
message: "Email updated");
// bloodDetails.city=_selectedHospital.toString();
// bloodDetails.
),
),
Divider(
color: Colors.black,
indent: 10,
endIndent: 10,
),
Form(
key: updateEmailFormKey,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
fillColor: Colors.red,
initialValue: model.userInformationModelList.emailAddress,
fontSize: 20,
hintColor: Colors.black,
fontWeight: FontWeight.w600,
onChanged: (text) {
setState(() {
addEmail = text;
});
},
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context).enterEmail;
else if (!RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(value))
return TranslationBase.of(context).validEmail;
return null;
},
),
),
Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: Color.fromRGBO(63, 72, 74, 1,),
label: " VIEW LIST OF CHILDREN",
//
onTap: () => Navigator.push(
context,
FadePage(
page: ChildPage(),
),
),
),
),
// Texts(
// // TranslationBase.of(context).advancePaymentLabel,
// model.user.emailAddress,
// textAlign: TextAlign.center,
// ),
SizedBox(
height: 12,
),
SizedBox(
height: 12,
),
SizedBox(
height: 12,
),
SizedBox(
height: 12,
),
SizedBox(
height: 12,
),
),
Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: model.userInformationModelList.emailAddress == addEmail ? Colors.white24 : Color.fromRGBO(63, 72, 74, 1,),
disabled: addEmail.isEmpty,
label: TranslationBase.of(context).updateEmail,
onTap: () async{
final form = updateEmailFormKey.currentState;
if (form.validate()) {
form.save();
await model.updateEmail(addEmail);
AppToast.showSuccessToast(message: TranslationBase.of(context).updatedEmail);
}
},
),
),
Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: Color.fromRGBO(
63,
72,
74,
1,
),
SizedBox(
height: 10,
label: TranslationBase.of(context).viewListChildren,
onTap: () => Navigator.push(
context,
FadePage(
page: ChildPage(informationModel: model.userInformationModelList,),
),
),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Center(
// child: Container(
// color: Colors.white,
// width: 350,
// child: InkWell(
// onTap: () {
// showDialog(
// context: context,
// builder: (_) =>
// AssetGiffyDialog(
// title: Text(
// "",
// style: TextStyle(
// fontSize: 22.0,
// fontWeight:
// FontWeight
// .w600),
// ),
// image: Image.asset(
// 'assets/images/BloodChrt_EN.png'),
// buttonCancelText:
// Text('cancel'),
// buttonCancelColor:
// Colors.grey,
// onlyCancelButton: true,
// ));
// },
// child: Container(
// width: 250,
// height: 200,
// child:Image.asset(
// 'assets/images/BloodChrt_EN.png')),
// ),
// ),
// ),
// ],
// ),
SizedBox(
height: MediaQuery.of(context).size.height * 0.15,
)
],
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.15,
)
],
),
),
),
);
}
}

@ -5,15 +5,18 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SelectGenderDialog extends StatefulWidget {
final Email;
class ConfirmSendEmailDialog extends StatefulWidget {
final email;
final Function onTap;
const ConfirmSendEmailDialog({Key key, this.email, this.onTap})
: super(key: key);
const SelectGenderDialog({Key key, this.Email}) : super(key: key);
@override
_SelectGenderDialogState createState() => _SelectGenderDialogState();
_ConfirmSendEmailDialogState createState() => _ConfirmSendEmailDialogState();
}
class _SelectGenderDialogState extends State<SelectGenderDialog> {
class _ConfirmSendEmailDialogState extends State<ConfirmSendEmailDialog> {
@override
Widget build(BuildContext context) {
return SimpleDialog(
@ -21,22 +24,15 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
Container(
child: Column(
children: [
Texts(TranslationBase.of(context).confirm),
Divider(),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
//beneficiaryType = Gender.Male;
});
},
child: ListTile(
title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "),
),
child: ListTile(
title: Text(TranslationBase.of(context).confirmSend +
"\n ${widget.email} "),
),
)
],
@ -44,15 +40,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
SizedBox(
height: 5.0,
),
SizedBox(
height: 5.0,
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
@ -82,8 +70,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
flex: 1,
child: InkWell(
onTap: () {
AppToast.showSuccessToast(message: "Email Sended");
// widget.onValueSelected(beneficiaryType);
widget.onTap();
Navigator.pop(context);
},
child: Padding(
@ -105,7 +92,4 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
],
);
}
}

@ -6,6 +6,10 @@ import 'package:flutter/material.dart';
class DeleteChild extends StatefulWidget {
final Function onTap;
const DeleteChild({Key key, this.onTap}) : super(key: key);
@override
_DeleteChildState createState() => _DeleteChildState();
}
@ -18,21 +22,14 @@ class _DeleteChildState extends State<DeleteChild> {
Container(
child: Column(
children: [
Texts(TranslationBase.of(context).confirm),
Divider(),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
//beneficiaryType = Gender.Male;
});
},
child: ListTile(
title: Text("Delete the child "),
child: ListTile(
title: Texts(TranslationBase.of(context).deletedChild),
),
),
)
],
@ -40,15 +37,7 @@ class _DeleteChildState extends State<DeleteChild> {
SizedBox(
height: 5.0,
),
SizedBox(
height: 5.0,
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
@ -78,7 +67,7 @@ class _DeleteChildState extends State<DeleteChild> {
flex: 1,
child: InkWell(
onTap: () {
// widget.onValueSelected(beneficiaryType);
widget.onTap();
Navigator.pop(context);
},
child: Padding(

@ -1,101 +1,181 @@
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/widgets/buttons/secondary_button.dart';
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:flutter_flexible_toast/flutter_flexible_toast.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'dialogs/SelectGenderDialog.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'dialogs/ConfirmSendEmailDialog.dart';
class VaccinationTablePage extends StatelessWidget {
final List_BabyInformationModel babyInfo;
final List_UserInformationModel informationModel;
const VaccinationTablePage({Key key, this.babyInfo, this.informationModel})
: super(key: key);
@override
Widget build(BuildContext context) {
var checkedValue;
return BaseView<VaccinationTableViewModel>(
onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(),
onModelReady: (model) => model.getCreateVaccinationTable(babyInfo: babyInfo, informationModel: informationModel),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
baseViewModel: model,
appBarTitle: "Vaccination",
appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView(
child:Container(
margin: EdgeInsets.only(left: 15,right: 15,top: 70),
child: Container(
margin: EdgeInsets.only(left: 15, right: 15, top: 10),
child: Column(
children: [//babyInformationModelList.length
...List.generate(model.creteVaccinationTableModelList.length, (index) =>
Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.white,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Column(
children: [
Texts(TranslationBase.of(context).childName),
Texts(
babyInfo.babyName ?? '',
fontWeight: FontWeight.w600,
),
],
),
),
Expanded(
child: Column(
children: [
Texts(TranslationBase.of(context).childDob),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
FontAwesomeIcons.calendarCheck,
color: Colors.red,
),
SizedBox(
width: 15,
),
Texts(DateUtil.yearMonthDay(babyInfo.dOB) ?? ''),
],
),
],
),
),
],
),
SizedBox(
height: 15,
),
Divider(),
Column(
children: [
Row(
children: [
Texts(TranslationBase.of(context).visit),
SizedBox(
width: 10,
),
padding: EdgeInsets.all(12),
width: double.infinity,
child: Column(
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Texts(TranslationBase.of(context)
.descriptionVaccination),
],
),
),
Texts(TranslationBase.of(context).dueDate),
],
),
],
),
...List.generate(
model.creteVaccinationTableModelList.length,
(index) => Container(
padding: EdgeInsets.all(12),
width: double.infinity,
child: Column(
children: [
Row(
children: [
Row(children: [
Text(model.creteVaccinationTableModelList[index].visit),
SizedBox(width: 10,),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Html(
// data:"<html><head><style type='text/css'>.Test {list-style-image:url('http://10.50.100.198:4444/Images/Bullet_List_Small.png');}</style></head><body><table><tr align='left'><td align='left'>BCG</td></tr><tr align='left'><td align='left'>HEPATITIS B</td></tr></table></body></html>"//model.creteVaccinationTableModelList[index].vaccinesDescription
data:model.creteVaccinationTableModelList[index].vaccinesDescription,
),
],),
),
Text(model.creteVaccinationTableModelList[index].givenAt),
],),
Divider(color:Colors.black ,),
Texts(model
.creteVaccinationTableModelList[index].visit),
SizedBox(
width: 10,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Html(
data: model
.creteVaccinationTableModelList[index]
.vaccinesDescription,
),
],
),
),
Texts(model
.creteVaccinationTableModelList[index].givenAt),
],
)
)
),
Divider(
color: Colors.white,
height: 3,
thickness: 1.0,
),
],
),
),
)
],
),
),
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,),
label: "Send Email ",
//
onTap: () {
//SelectGenderDialog();
//===============
showDialog(
context: context,
child: SelectGenderDialog(
),
);
//=========
}
bottomSheet: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue == false
? Colors.white24
: Color.fromRGBO(
63,
72,
74,
1,
),
label: TranslationBase.of(context).sendEmail,
onTap: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: informationModel.emailAddress,
onTap: () async {
await model.getCreateVaccinationTable(babyInfo: babyInfo, informationModel: informationModel,isSendEmail: true);
AppToast.showSuccessToast(message: TranslationBase.of(context).emailSuccess,toastLength: Toast.LENGTH_LONG);
},
),
);
},
),
),
),
),

@ -0,0 +1,109 @@
import 'dart:io';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:url_launcher/url_launcher.dart';
class AppUpdatePage extends StatefulWidget {
String appUpdateText;
AppUpdatePage({@required this.appUpdateText});
@override
_AppUpdatePageState createState() => _AppUpdatePageState();
}
class _AppUpdatePageState extends State<AppUpdatePage> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "App Update",
backgroundColor: Colors.white,
isShowAppBar: false,
isShowDecPage: false,
body: SingleChildScrollView(
child: Container(
child: Column(
children: [
Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
SvgPicture.asset(
"assets/images/new-design/update_rocket_image.svg",
fit: BoxFit.fill),
]),
Container(
margin: EdgeInsets.only(top: 40.0),
width: MediaQuery.of(context).size.width,
child: Text(TranslationBase.of(context).appUpdate,
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xff2d6c90).withOpacity(1.0),
fontSize: 22.0,
fontWeight: FontWeight.bold))),
],
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: SvgPicture.asset("assets/images/new-design/HMG_logo.svg",
fit: BoxFit.fill),
),
Container(
margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
width: MediaQuery.of(context).size.width,
child: Text(widget.appUpdateText,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey[600],
fontSize: 16.0,
height: 1.5,
fontWeight: FontWeight.bold))),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: Colors.red[800],
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
openAppUpdateLink();
},
child: Text(TranslationBase.of(context).appUpdate,
style: TextStyle(fontSize: 18.0)),
),
),
),
],
),
),
),
);
}
openAppUpdateLink() {
if (Platform.isAndroid) {
_launchURL("https://play.google.com/store/apps/details?id=com.ejada.hmg");
}
if (Platform.isIOS) {
_launchURL("https://itunes.apple.com/app/id733503978");
}
}
_launchURL(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
}

File diff suppressed because it is too large Load Diff

@ -155,122 +155,124 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}).catchError((err) {
print(err);
});
//
// //_firebase Background message handler
Future.delayed(Duration.zero, () => setTheme());
//_firebase Background message handler
// _firebaseMessaging.configure(
// onMessage: (Map<String, dynamic> message) async {
// showDialog("onMessage: $message");
// print("onMessage: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
//
// if (Platform.isAndroid) {
// if (message['data'].containsKey("is_call")) {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message['data']);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found Android");
// }
// } else {
// print("Is Call Not Found Android");
// }
// },
// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// onLaunch: (Map<String, dynamic> message) async {
// print("onLaunch: $message");
// showDialog("onLaunch: $message");
// },
// onResume: (Map<String, dynamic> message) async {
// print("onResume: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// showDialog("onResume: $message");
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
// },
// );
// // onMessage: (Map<String, dynamic> message) async {
// // showDialog("onMessage: $message");
// // print("onMessage: $message");
// // print(message);
// // print(message['name']);
// // print(message['appointmentdate']);
// //
// // if (Platform.isIOS) {
// // if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData)))
// // .then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// //
// // if (Platform.isAndroid) {
// // if (message['data'].containsKey("is_call")) {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap =
// // new Map<String, dynamic>.from(message['data']);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData)))
// // .then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found Android");
// // }
// // } else {
// // print("Is Call Not Found Android");
// // }
// // },
// // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// // onLaunch: (Map<String, dynamic> message) async {
// // print("onLaunch: $message");
// // showDialog("onLaunch: $message");
// // },
// // onResume: (Map<String, dynamic> message) async {
// // print("onResume: $message");
// // print(message);
// // print(message['name']);
// // print(message['appointmentdate']);
// //
// // showDialog("onResume: $message");
// //
// // if (Platform.isIOS) {
// // if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap =
// // new Map<String, dynamic>.from(message);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData)))
// // .then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // },
// );
}
showDialogs(String message) {
@ -460,9 +462,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
case 2:
return TranslationBase.of(context).bookAppo;
case 3:
return TranslationBase.of(context).myFamily;
case 4:
return TranslationBase.of(context).services;
case 4:
return TranslationBase.of(context).bookAppo;
}
}
setTheme() async{

@ -1,14 +1,19 @@
import 'dart:math';
import 'package:badges/badges.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart';
import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -16,14 +21,24 @@ import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profil
import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import 'package:provider/provider.dart';
import '../../locator.dart';
import 'active_medications/ActiveMedicationsPage.dart';
import 'allergies_page.dart';
import 'ask_doctor/ask_doctor_home_page.dart';
import 'balance/my_balance_page.dart';
import 'doctor/doctor_home_page.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'eye/EyeHomePage.dart';
import 'eye/EyeMeasurementsPage.dart';
import 'labs/labs_home_page.dart';
import 'my_trackers/my_trackers.dart';
class MedicalProfilePage extends StatefulWidget {
@override
@ -119,8 +134,8 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
position:
BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: Color(0xFF40ACC9)
.withOpacity(1.0),
badgeColor: Colors
.red[800].withOpacity(1.0),
borderRadius:
BorderRadius.circular(8),
badgeContent: Container(
@ -185,52 +200,48 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
page: HomePrescriptionsPage(),
),
);
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myDoctor,
imagePath: 'doctor_icon.png',
.medicines,
imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context)
.myDoctorSubtitle,
.medicinesSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: HomePrescriptionsPage(),
),
);
},
onTap: () => Navigator.push(
context,
FadePage(
page: VitalSignDetailsScreen(),
),
),
child: MedicalProfileItem(
title: TranslationBase.of(context)
.medicines,
imagePath: 'prescription_icon.png',
.vitalSigns,
imagePath: 'vital_signs.png',
subTitle: TranslationBase.of(context)
.medicinesSubtitle,
.vitalSignsSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceCard()));
},
onTap: () => Navigator.push(context,
FadePage(page: ActiveMedicationsPage())),
child: MedicalProfileItem(
title: TranslationBase.of(context)
.insurance,
imagePath: 'insurance_card_icon.png',
.myMedical,
imagePath: 'active_medications.png',
subTitle: TranslationBase.of(context)
.insuranceSubtitle,
.myMedicalSubtitle,
),
),
),
@ -241,14 +252,20 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(context,
FadePage(page: AllergiesPage())),
onTap: () {
Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
);
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.allergies,
imagePath: 'my_allergies_icon.png',
.myDoctor,
imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context)
.allergiesSubtitle,
.myDoctorSubtitle,
),
),
),
@ -259,13 +276,13 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Navigator.push(
context,
FadePage(
page: PatientSickLeavePage()));
page: EyeMeasurementsPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
subTitle: TranslationBase.of(context)
.sickSubtitle,
.eyeSubtitle,
),
),
),
@ -273,24 +290,83 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: InsuranceApproval()));
Navigator.push(context,
FadePage(page: InsuranceCard()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.insuranceApproval,
imagePath:
'insurance_approvals_icon.png',
.insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context)
.insuranceApprovalSubtitle,
.insuranceSubtitle,
),
),
),
],
),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceUpdate()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.updateInsurance,
imagePath: 'insurance_update_icon_.png',
subTitle: TranslationBase.of(context)
.updateInsuranceSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceApproval()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.insuranceApproval,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context)
.insuranceApprovalSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap:()=> Navigator.push(context, FadePage(page: AllergiesPage())) ,
child: MedicalProfileItem(
title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context)
.allergiesSubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyVaccines()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myVaccines,
imagePath: 'my_vaccines_icon.png',
subTitle: TranslationBase.of(context)
.myVaccinesSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
@ -308,9 +384,153 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
),
Expanded(
child: Container(),
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MonthlyReportsPage()));
},
child: MedicalProfileItem(
title:
TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png',
subTitle: TranslationBase.of(context)
.monthlySubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PatientSickLeavePage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context)
.sickSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyBalancePage()));
},
child: MedicalProfileItem(
title:
TranslationBase.of(context).myBalance,
imagePath: 'check-in.png',
subTitle: TranslationBase.of(context)
.myBalanceSubtitle,
),
),
),
Expanded(
flex: 1,
child: MedicalProfileItem(
title:
TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png',
subTitle: TranslationBase.of(context)
.patientCallSubtitle,
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
onTap: () {
Navigator.push(
context, FadePage(page: SmartWatchInstructions()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context)
.smartWatchesSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: MyTrackers()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.myTrackers,
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context)
.myTrackersSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: (){
Navigator.push(context,
FadePage(page: AskDoctorHomPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png',
subTitle: TranslationBase.of(context)
.askYourSubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
child: MedicalProfileItem(
title:
TranslationBase.of(context).internet,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context)
.internetSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
// onTap: () {
// Navigator.push(
// context, FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title:
TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context)
.chatbotSubtitle,
),
),
),
Expanded(
flex: 1,
child: Container(),
),
]),

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart';
class HealthDataList extends StatefulWidget {
@ -8,6 +9,19 @@ class HealthDataList extends StatefulWidget {
}
class _HealthDataListState extends State<HealthDataList> {
List<DataType> dataTypes = List();
@override
void initState() {
dataTypes.add(DataType.DISTANCE);
dataTypes.add(DataType.STEP_COUNT);
dataTypes.add(DataType.HEART_RATE);
dataTypes.add(DataType.SLEEP);
dataTypes.add(DataType.ENERGY);
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -132,7 +146,7 @@ class _HealthDataListState extends State<HealthDataList> {
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () {
// launch(model.radImageURL);
readAll();
},
label: 'Sync Health Data',
backgroundColor: Colors.grey[800],
@ -142,4 +156,26 @@ class _HealthDataListState extends State<HealthDataList> {
),
));
}
void readLast() async {
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: 15)),
dateTo: DateTime.now(),
limit: 100,
);
print(results);
print(results.length);
}
readLast();
}
}
}

@ -31,6 +31,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
return AppScaffold(
appBarTitle: "Sync Health Data",
isShowAppBar: true,
isShowDecPage: false,
body: Container(
child: Platform.isIOS
? _getAppleWatchInstructions()
@ -88,6 +89,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 1",
style: TextStyle(
@ -108,8 +111,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 2",
overflow: TextOverflow.clip,
softWrap: true,
style: TextStyle(
fontSize: 12.0)),
)
@ -135,6 +142,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 3",
style: TextStyle(
@ -155,6 +164,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 4",
style: TextStyle(
@ -182,6 +193,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 5",
style: TextStyle(
@ -202,6 +215,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 6",
style: TextStyle(
@ -427,7 +442,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 0.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
@ -657,7 +672,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(15.0),
margin: EdgeInsets.all(12.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:

@ -46,7 +46,7 @@ class VitalSignItem extends StatelessWidget {
des,
style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0xff40ACC9),
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold,
),
),
@ -76,11 +76,12 @@ class VitalSignItem extends StatelessWidget {
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(text: lastVal),
TextSpan(text: lastVal + " "),
TextSpan(
text: " " + unit,
style: TextStyle(
color: Color(0xff40ACC9),
color:
Theme.of(context).textTheme.headline1.color,
),
),
]),

@ -0,0 +1,48 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class OrderPreviewPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<OrderPreviewViewModel>(
builder: (_, model, wi) => AppScaffold(
title: "Shopping Cart",
isShowAppBar: true,
isShowDecPage: false,
baseViewModel: model,
backgroundColor: Colors.white,
body: Container(
width: double.infinity,
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureIconButton(
TranslationBase.of(context).deleteAllItems,
Icon(Icons.delete_outline_sharp, color: Colors.grey.shade800,),
onTap: () => {},
),
const Divider(
color: Colors.grey,
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
),
],
),
),
),
),
),
);
}
}

@ -0,0 +1,245 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/order-preview-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
class PharmacyPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<PharmacyModuleViewModel>(
// onModelReady: (model) => model.getPharmacyHomeData(),
onModelReady: (model) => model.getPharmacyHomeData(),
builder: (_, model, wi) => AppScaffold(
title: "",
isShowAppBar: true,
isShowDecPage: false,
baseViewModel: model,
backgroundColor: Colors.white,
body: Container(
width: double.infinity,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BannerPager(model),
GridViewButtons(),
/*BannerPager(model.getBannerImagesUrl()),*/
Container(
margin: EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).shopByBrands,
bold: true,
),
BorderedButton(
TranslationBase.of(context).viewAll,
hasBorder: true,
vPadding: 6,
borderColor: Colors.green,
color: Colors.green,
handler: () {},
),
],
),
),
Container(
height: 60,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ManufacturerItem(model.manufacturerList[i]),
scrollDirection: Axis.horizontal,
itemCount: model.manufacturerList.length,
),
),
Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).recentlyViewed,
bold: true,
),
BorderedButton(
TranslationBase.of(context).viewAll,
hasBorder: true,
vPadding: 6,
borderColor: Colors.green,
color: Colors.green,
handler: () {},
),
],
),
),
Container(
height: model.lastVisitedProducts.length > 0 ? MediaQuery.of(context).size.height / 4 : 0,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ProductTileItem(model.lastVisitedProducts[i]),
scrollDirection: Axis.horizontal,
itemCount: model.lastVisitedProducts.length,
),
),
Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).bestSellers,
bold: true,
),
BorderedButton(
TranslationBase.of(context).viewAll,
hasBorder: true,
borderColor: Colors.green,
color: Colors.green,
vPadding: 6,
handler: () {},
),
],
),
),
Container(
height: MediaQuery.of(context).size.height / 4,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ProductTileItem(model.bestSellerProduct[i]),
scrollDirection: Axis.horizontal,
itemCount: model.bestSellerProduct.length,
),
),
],
),
),
),
),
);
}
}
class GridViewButtons extends StatelessWidget {
@override
Widget build(BuildContext context) {
final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8;
return Container(
child: SizedBox(
height: gridHeight,
child: GridView.count(
childAspectRatio: 2.2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
controller: new ScrollController(keepScrollOffset: false),
shrinkWrap: true,
padding: const EdgeInsets.all(4.0),
crossAxisCount: 2,
children: [
DashboardItem(
imageName: 'pharmacy_module/bg_1.png',
hasColorFilter: false,
opacity: 0.8,
child: GridViewCard(
TranslationBase.of(context).offersAndPromotions,
'assets/images/pharmacy_module/offer_icon.png',
() {
Navigator.push(context, FadePage(page: OrderPreviewPage()));
}),
),
DashboardItem(
imageName: 'pharmacy_module/bg_2.png',
opacity: 0,
hasColorFilter: false,
child: GridViewCard(TranslationBase.of(context).medicationRefill,
'assets/images/pharmacy_module/medication_icon.png', () {}),
),
DashboardItem(
imageName: 'pharmacy_module/bg_3.png',
opacity: 0,
hasColorFilter: false,
child: GridViewCard(TranslationBase.of(context).myPrescriptions,
'assets/images/pharmacy_module/prescription_icon.png', () {}),
),
DashboardItem(
imageName: 'pharmacy_module/bg_4.png',
opacity: 0,
hasColorFilter: false,
child: GridViewCard(
TranslationBase.of(context).searchAndScanMedication,
'assets/images/pharmacy_module/search_scan_icon.png',
() {}),
),
],
),
),
);
}
}
class GridViewCard extends StatelessWidget {
final String text;
final String cardImage;
final Function handler;
GridViewCard(this.text, this.cardImage, this.handler);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(4.0),
child: Container(
child: Row(
children: [
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 2,
child: Padding(
padding: const EdgeInsets.all(6),
child: Texts(
text,
color: Colors.white,
fontSize: SizeConfig.textMultiplier * 1.5,
),
),
),
Expanded(
child: BorderedButton(
TranslationBase.of(context).viewAll,
handler: handler,
),
),
],
),
),
Expanded(
child: Align(
alignment: Alignment.centerRight,
child: Image.asset(
cardImage,
fit: BoxFit.cover,
),
),
),
],
),
),
);
}
}

@ -0,0 +1,19 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class ProductDetailScreen extends StatelessWidget {
final PharmacyProduct product;
ProductDetailScreen(this.product);
@override
Widget build(BuildContext context) {
return AppScaffold(
body: Center(
child: Texts("id = ${product.id}"),
),
);
}
}

@ -0,0 +1,88 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class BannerPager extends StatefulWidget {
final PharmacyModuleViewModel _model;
BannerPager(this._model);
@override
_BannerPagerState createState() => _BannerPagerState();
}
class _BannerPagerState extends State<BannerPager> {
int _current = 0;
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
CarouselSlider(
options: CarouselOptions(
aspectRatio: 7 / 2,
enlargeCenterPage: true,
enableInfiniteScroll: false,
initialPage: 0,
autoPlay: true,
autoPlayInterval: Duration(seconds: 3),
autoPlayAnimationDuration: Duration(milliseconds: 800),
autoPlayCurve: Curves.decelerate,
onPageChanged: (index, reason) {
setState(() {
_current = index;
});
},
),
items: widget._model
.getBannerImagesUrl()
.mapIndexed(
(item, index) => Container(
margin: EdgeInsets.symmetric(horizontal: 1.0),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5.0)),
child: Center(
child: index == 0
? Image.asset(
item,
fit: BoxFit.cover,
)
: Image.network(
item,
fit: BoxFit.cover,
),
),
),
),
)
.toList(),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: widget._model
.getBannerImagesUrl()
.mapIndexed(
(item, index) => Container(
width: 12.0,
height: 4.0,
margin:
EdgeInsets.symmetric(vertical: 0.0, horizontal: 2.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: _current == index
? Color.fromRGBO(0, 250, 0, 0.9)
: Color.fromRGBO(0, 0, 0, 0.4),
),
),
)
.toList(),
),
)
],
));
}
}

@ -0,0 +1,13 @@
import 'package:flutter/material.dart';
class ProductOrderItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListTile(
leading: Icon(
Icons.delete_outline_sharp,
color: Colors.grey.shade800,
),
);
}
}

@ -0,0 +1,146 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/phramacy-product-detail-page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class ProductTileItem extends StatelessWidget {
final AppSharedPreferences sharedPref = AppSharedPreferences();
final PharmacyProduct item;
ProductTileItem(this.item);
void productOnClick(BuildContext ctx) {
_saveLastVisitProducts();
Navigator.push(ctx, FadePage(page: ProductDetailScreen(item)));
}
void _saveLastVisitProducts() async {
String lastVisited = "";
bool isIdExist = false;
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
null) {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
lastVisited.split(",").forEach((id) {
if (id == item.id) {
isIdExist = true;
}
});
}
if (!isIdExist) {
if (lastVisited == "") {
// it means there is no lastVisited yet
lastVisited = "${item.id}";
} else {
// there is lastVisited id's and this product id is not found
lastVisited += ",${item.id}";
}
sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, lastVisited);
}
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return InkWell(
onTap: () => productOnClick(context),
splashColor: Theme.of(context).primaryColor,
child: Card(
elevation: 2,
shape: Border(right: BorderSide(color: Colors.grey.shade300, width: 1)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 0),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center,
child: Image.network(
item.images[0].src,
fit: BoxFit.cover,
height: 80,
),
),
Container(
width: item.rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
item.rxMessage != null ? item.rxMessage : "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
)
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
projectProvider.isArabic ? item.name : item.namen,
regular: true,
fontSize: 12,
fontWeight: FontWeight.w400,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${item.price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: item.approvedTotalReviews > 0
? (item.approvedRatingSum.toDouble() /
item.approvedTotalReviews.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${item.approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
),
],
),
)
],
),
),
),
);
}
}

@ -0,0 +1,35 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:flutter/material.dart';
class ManufacturerItem extends StatelessWidget {
final Manufacturer item;
ManufacturerItem(this.item);
@override
Widget build(BuildContext context) {
return Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: Container(
decoration: BoxDecoration(
border: Border(
right: BorderSide(color: Colors.grey.shade300, width: 1),
bottom: BorderSide(color: Colors.grey.shade300, width: 1),
left: BorderSide(color: Colors.grey.shade300, width: 1),
top: BorderSide(color: Colors.grey.shade300, width: 1)),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Image.network(
item.image.src,
fit: BoxFit.cover,
),
),
),
);
}
}

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/
import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family-member.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family_type.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/login/confirm-login.dart';
@ -36,7 +37,8 @@ const String SYMPTOM_CHECKER = 'symptom-checker';
const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info';
const String SELECT_GENDER = 'select-gender';
const String SETTINGS = 'settings';
const String HEALTH_WEATHER ='health-weather';
const String HEALTH_WEATHER = 'health-weather';
const String APP_UPDATE = 'app_update';
var routes = {
SPLASH: (_) => SplashScreen(),
HOME: (_) => LandingPage(),
@ -55,5 +57,6 @@ var routes = {
SYMPTOM_CHECKER_INFO: (_) => SymptomInfo(),
SELECT_GENDER: (_) => SelectGender(),
SETTINGS: (_) => Settings(),
HEALTH_WEATHER: (_)=> HealthWeatherIndicator()
HEALTH_WEATHER: (_) => HealthWeatherIndicator(),
APP_UPDATE: (_) => AppUpdatePage()
};

@ -65,6 +65,7 @@ final blueBackground = Color(0xFFFFFFFF);
},
),
hintColor: Colors.grey[400],
accentColor: Color(0xffB8382C),
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffEEEEEE),

@ -21,7 +21,7 @@ class DateUtil {
static String convertDateToString(DateTime date) {
const start = "/Date(";
const end = "+0300)";
const end = "+0300)/";
int milliseconds = date.millisecondsSinceEpoch;
return start + "$milliseconds" + end;
@ -341,6 +341,7 @@ class DateUtil {
break;
case DayOfWeek.Sunday:
return "Sunday";
break;
}
return "";

@ -1,7 +1,6 @@
import 'dart:async';
import 'package:diplomaticquarterapp/config/localized_values.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart';
import 'package:flutter/foundation.dart' show SynchronousFuture;
import 'package:flutter/material.dart';
@ -148,7 +147,7 @@ class TranslationBase {
String get idNo => localizedValues['national-id'][locale.languageCode];
String get fileNo => localizedValues['fileNo'][locale.languageCode];
String get fileno => localizedValues['fileno'][locale.languageCode];
String get fileno => localizedValues['fileno'][locale.languageCode];
String get forgotPassword =>
localizedValues['forgotFileNo'][locale.languageCode];
@ -697,6 +696,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
localizedValues['ServiceInformation'][locale.languageCode];
String get homeHealthCare =>
localizedValues['HomeHealthCare'][locale.languageCode];
String get HHCNotAuthMsg =>
localizedValues['HHCNotAuthMsg'][locale.languageCode];
String get homeHealthCareText =>
localizedValues['HomeHealthCareText'][locale.languageCode];
String get loginRegister =>
@ -706,6 +707,23 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get infoRadiology =>
localizedValues['info-radiology'][locale.languageCode];
// pharmacy module
String get medicationRefill =>
localizedValues['medicationRefill'][locale.languageCode];
String get offersAndPromotions =>
localizedValues['offersAndPromotions'][locale.languageCode];
String get myPrescriptions =>
localizedValues['myPrescriptions'][locale.languageCode];
String get searchAndScanMedication =>
localizedValues['searchAndScanMedication'][locale.languageCode];
String get shopByBrands =>
localizedValues['shopByBrands'][locale.languageCode];
String get recentlyViewed =>
localizedValues['recentlyViewed'][locale.languageCode];
String get bestSellers => localizedValues['bestSellers'][locale.languageCode];
String get deleteAllItems =>
localizedValues['deleteAllItems'][locale.languageCode];
String get termsService =>
localizedValues['TermsService'][locale.languageCode];
String get beforeUsing => localizedValues['Beforeusing'][locale.languageCode];
@ -791,7 +809,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get modes => localizedValues['modes'][locale.languageCode];
String get vibration => localizedValues['vibration'][locale.languageCode];
String get blindMode => localizedValues['blind-modes'][locale.languageCode];
String get invertTheme => localizedValues['invert-theme'][locale.languageCode];
String get invertTheme =>
localizedValues['invert-theme'][locale.languageCode];
String get offTheme => localizedValues['off-theme'][locale.languageCode];
String get dimTheme => localizedValues['dim-theme'][locale.languageCode];
String get bwTheme => localizedValues['bw-theme'][locale.languageCode];
@ -805,8 +824,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
localizedValues['accessibility'][locale.languageCode];
String get selectClinic =>
localizedValues['selectClinic'][locale.languageCode];
String get reviews =>
localizedValues['reviews'][locale.languageCode];
String get reviews => localizedValues['reviews'][locale.languageCode];
String get orderStatus => localizedValues['orderStatus'][locale.languageCode];
String get cancelOrder => localizedValues['CancelOrder'][locale.languageCode];
@ -814,9 +832,12 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get feedback => localizedValues['Feedback'][locale.languageCode];
String get liveChat => localizedValues['LiveChat'][locale.languageCode];
String get service => localizedValues['Service'][locale.languageCode];
String get hMGServiceLabel => localizedValues['HMGServiceLabel'][locale.languageCode];
String get healthWeatherIndicators => localizedValues['HealthWeatherIndicators'][locale.languageCode];
String get healthTipsBasedOnCurrentWeather => localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode];
String get hMGServiceLabel =>
localizedValues['HMGServiceLabel'][locale.languageCode];
String get healthWeatherIndicators =>
localizedValues['HealthWeatherIndicators'][locale.languageCode];
String get healthTipsBasedOnCurrentWeather =>
localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode];
String get moreDetails => localizedValues['MoreDetails'][locale.languageCode];
String get sendCopy => localizedValues['SendCopy'][locale.languageCode];
String get resendOrder => localizedValues['ResendOrder'][locale.languageCode];
@ -830,7 +851,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get mass => localizedValues['mass'][locale.languageCode];
String get tempC => localizedValues['temp-c'][locale.languageCode];
String get bpm => localizedValues['bpm'][locale.languageCode];
String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode];
String get respirationSigns =>
localizedValues['respiration-signs'][locale.languageCode];
String get sysDias => localizedValues['sys-dias'][locale.languageCode];
String get body => localizedValues['body'][locale.languageCode];
String get feedbackTitle => localizedValues['feedback'][locale.languageCode];
@ -839,29 +861,45 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get likeToHear => localizedValues['like-to-hear'][locale.languageCode];
String get subject => localizedValues['subject'][locale.languageCode];
String get message => localizedValues['message'][locale.languageCode];
String get emptySubject => localizedValues['empty-subject'][locale.languageCode];
String get emptyMessage => localizedValues['empty-message'][locale.languageCode];
String get selectAttachment => localizedValues['select-attachment'][locale.languageCode];
String get complainAppo => localizedValues['complain-appo'][locale.languageCode];
String get complainWithoutAppo => localizedValues['complain-without-appo'][locale.languageCode];
String get emptySubject =>
localizedValues['empty-subject'][locale.languageCode];
String get emptyMessage =>
localizedValues['empty-message'][locale.languageCode];
String get selectAttachment =>
localizedValues['select-attachment'][locale.languageCode];
String get complainAppo =>
localizedValues['complain-appo'][locale.languageCode];
String get complainWithoutAppo =>
localizedValues['complain-without-appo'][locale.languageCode];
String get question => localizedValues['question'][locale.languageCode];
String get messageType => localizedValues['message-type'][locale.languageCode];
String get messageType =>
localizedValues['message-type'][locale.languageCode];
String get compliment => localizedValues['compliment'][locale.languageCode];
String get suggestion => localizedValues['suggestion'][locale.languageCode];
String get yourFeedback => localizedValues['your-feedback'][locale.languageCode];
String get yourFeedback =>
localizedValues['your-feedback'][locale.languageCode];
String get selectPart => localizedValues['select-part'][locale.languageCode];
String get number => localizedValues['number'][locale.languageCode];
String get notClassified => localizedValues['not-classified'][locale.languageCode];
String get searchItemError => localizedValues['searchItemError'][locale.languageCode];
String get notClassified =>
localizedValues['not-classified'][locale.languageCode];
String get searchItemError =>
localizedValues['searchItemError'][locale.languageCode];
String get youCanFind => localizedValues['YouCanFind'][locale.languageCode];
String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode];
String get bloodDonation => localizedValues['blood-donation'][locale.languageCode];
String get bloodInstruction => localizedValues['blood-instruction'][locale.languageCode];
String get bloodTermsNcondition => localizedValues['view-terms'][locale.languageCode];
String get itemInSearch =>
localizedValues['ItemInSearch'][locale.languageCode];
String get bloodDonation =>
localizedValues['blood-donation'][locale.languageCode];
String get bloodInstruction =>
localizedValues['blood-instruction'][locale.languageCode];
String get bloodTermsNcondition =>
localizedValues['view-terms'][locale.languageCode];
String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode];
String get specialResult => localizedValues['SpecialResult'][locale.languageCode];
String get generalResult => localizedValues['GeneralResult'][locale.languageCode];
String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode];
String get specialResult =>
localizedValues['SpecialResult'][locale.languageCode];
String get generalResult =>
localizedValues['GeneralResult'][locale.languageCode];
String get showMoreBtn =>
localizedValues['show-more-btn'][locale.languageCode];
String get value => localizedValues['value'][locale.languageCode];
String get range => localizedValues['range'][locale.languageCode];
String get outpatient => localizedValues['out-patient'][locale.languageCode];
@ -870,7 +908,40 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get openRad => localizedValues['open-rad'][locale.languageCode];
String get sendCopyRad => localizedValues['send-copy'][locale.languageCode];
String get appoSurvey => localizedValues['appoSurvey'][locale.languageCode];
String get vaccination => localizedValues['vaccination'][locale.languageCode];
String get welcomeBackV =>
localizedValues['welcomeBack'][locale.languageCode];
String get instructions =>
localizedValues['instructions'][locale.languageCode];
String get updateEmail =>
localizedValues['update-email'][locale.languageCode];
String get updatedEmail =>
localizedValues['updated-email'][locale.languageCode];
String get viewListChildren =>
localizedValues['view-list-children'][locale.languageCode];
String get addChild => localizedValues['add-child'][locale.languageCode];
String get childName => localizedValues['child-name'][locale.languageCode];
String get childDob => localizedValues['childDob'][locale.languageCode];
String get delete => localizedValues['delete'][locale.languageCode];
String get deletedChildMes =>
localizedValues['deleted-child-mes'][locale.languageCode];
String get visit => localizedValues['visit'][locale.languageCode];
String get descriptionVaccination =>
localizedValues['description-vaccination'][locale.languageCode];
String get dueDate => localizedValues['due-date'][locale.languageCode];
String get validEmail => localizedValues['valid-email'][locale.languageCode];
String get confirmSend =>
localizedValues['confirm-send'][locale.languageCode];
String get emailSuccess =>
localizedValues['email-success'][locale.languageCode];
String get deletedChild =>
localizedValues['deleted-child'][locale.languageCode];
String get addInstructions =>
localizedValues['add-instructions'][locale.languageCode];
String get addedChild => localizedValues['added-child'][locale.languageCode];
String get appUpdate => localizedValues['appUpdate'][locale.languageCode];
String get ereferralSaveSuccess =>
localizedValues['ereferralSaveSuccess'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,4 +1,5 @@
import 'dart:convert';
import 'dart:core';
import 'dart:typed_data';
import 'package:connectivity/connectivity.dart';
@ -158,4 +159,22 @@ class Utils {
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
.hasMatch(email);
}
}
// extension function that use in iterations(list.. etc) to iterate items and get index and item it self
extension IndexedIterable<E> on Iterable<E> {
Iterable<T> mapIndexed<T>(T Function(E e, int i) f) {
var i = 0;
return map((e) => f(e, i++));
}
}
/*
userBoard.asMap().map((i, element) => MapEntry(i, Stack(
GestureDetector(onTap: () {
setState(() {
// print("element=${element.toString()}");
// print("element=${userBoard[i].toString()}");
});
}),
))).values.toList();
*/

@ -80,7 +80,8 @@ class BottomNavigationItem extends StatelessWidget {
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: Color(0xFF40ACC9).withOpacity(1.0),
badgeColor: Colors
.red[800].withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),

@ -15,7 +15,7 @@ class ImageOptions {
return _BottomSheet(
children: <Widget>[
_BottomSheetItem(
title: "Select file souse",
title: "Select file source",
),
_BottomSheetItem(
title: "Gallery",

@ -0,0 +1,70 @@
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
class GestureIconButton extends StatefulWidget {
GestureIconButton(
this.label,
this.icon, {
Key key,
this.onTap,
this.backgroundColor,
}) : super(key: key);
final String label;
final Widget icon;
final VoidCallback onTap;
final Color backgroundColor;
@override
_GestureIconButtonState createState() => _GestureIconButtonState();
}
class _GestureIconButtonState extends State<GestureIconButton> {
bool _buttonLongPress = false;
@override
Widget build(BuildContext context) {
return GestureDetector(
onLongPressStart: (_) =>
setState(() => _buttonLongPress = !_buttonLongPress),
onLongPressEnd: (_) =>
setState(() => _buttonLongPress = !_buttonLongPress),
child: Wrap(
children: [
Container(
decoration: BoxDecoration(
border: Border.all(
color: widget.backgroundColor != null
? widget.backgroundColor
: Colors.grey[200],
),
color: widget.backgroundColor != null
? widget.backgroundColor
: Colors.grey.shade200,
borderRadius: BorderRadius.all(Radius.circular(8))),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Expanded(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: widget.icon,
),
Texts(
widget.label,
color: _buttonLongPress ? Colors.white : Colors.black,
),
],
),
),
),
),
),
],
),
);
}
}

@ -0,0 +1,59 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:flutter/material.dart';
class BorderedButton extends StatelessWidget {
final String text;
final Function handler;
final Color color;
final bool hasBorder;
final Color borderColor;
final Color backgroundColor;
final double vPadding;
final double hPadding;
BorderedButton(
this.text, {
this.handler,
this.color,
this.hasBorder = false,
this.borderColor,
this.backgroundColor,
this.vPadding = 0,
this.hPadding = 0,
});
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 4),
child: ButtonTheme(
//adds padding inside the button
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
//limits the touch area to the button area
minWidth: 0,
//wraps child's width
height: 0,
//wraps child's height
child: RaisedButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: EdgeInsets.symmetric(horizontal: 12, vertical: vPadding),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
side: BorderSide(color: hasBorder ? borderColor : Colors.white, width: 0.8),),
color: backgroundColor ?? Colors.white,
textColor: color ?? Color(0xffc4aa54),
disabledTextColor: color ?? Colors.black,
disabledColor: backgroundColor ?? Colors.white,
onPressed: handler,
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.normal),
),
), //your original button
),
);
}
}

@ -0,0 +1,139 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class SelectLocationDialog extends StatefulWidget {
final List<AddressInfo> addresses;
final Function(AddressInfo) onValueSelected;
AddressInfo selectedAddress;
SelectLocationDialog(
{Key key, this.addresses, this.onValueSelected, this.selectedAddress});
@override
_SelectLocationDialogState createState() => _SelectLocationDialogState();
}
class _SelectLocationDialogState extends State<SelectLocationDialog> {
@override
void initState() {
super.initState();
widget.selectedAddress = widget.selectedAddress ?? widget.addresses[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
title: Texts("sdsdsd"),
children: [
Column(
children: [
Container(
height: 150,
child: SingleChildScrollView(
child: Column(
children: [
Divider(),
...List.generate(
widget.addresses.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedAddress = widget.addresses[index];
});
},
child: ListTile(
title: Text(widget.addresses[index].address1),
leading: Radio(
value: widget.addresses[index],
groupValue: widget.selectedAddress,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedAddress = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
],
),
),
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedAddress);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),
),
),
],
)
],
)
],
);
}
}

@ -47,7 +47,7 @@ class TextFields extends StatefulWidget {
this.autoFocus,
this.onChanged,
// this.initialValue,
this.initialValue,
this.minLines,
this.maxLines,
this.inputFormatters,
@ -79,7 +79,7 @@ class TextFields extends StatefulWidget {
final String hintText;
// final String initialValue;
final String initialValue;
final String type;
final bool autoFocus;
final IconData suffixIcon;
@ -230,7 +230,7 @@ class _TextFieldsState extends State<TextFields> {
minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced,
// initialValue: widget.initialValue,
initialValue: widget.initialValue,
onChanged: widget.onChanged,
focusNode: _focusNode,
maxLength: widget.maxLength ?? null,

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -40,6 +41,8 @@ class AppScaffold extends StatelessWidget {
final String image;
final bool isShowDecPage;
final List<String> infoList;
final Color backgroundColor;
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@ -55,6 +58,7 @@ class AppScaffold extends StatelessWidget {
this.title,
this.description,
this.isShowDecPage = true,
this.backgroundColor,
this.isBottomBar,
this.image,
this.infoList});
@ -64,7 +68,7 @@ class AppScaffold extends StatelessWidget {
AppGlobal.context = context;
return Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar
? AppBar(
elevation: 0,

@ -77,6 +77,9 @@ dependencies:
# charts
charts_flutter: ^0.9.0
#image banner slider
carousel_slider: ^2.3.1
google_maps_flutter: ^1.0.3
# Qr code Scanner
@ -94,9 +97,6 @@ dependencies:
# Location Helper
map_launcher: ^0.8.1
#carousel slider
carousel_slider: ^2.3.1
#Calendar Events
manage_calendar_events: ^1.0.2
@ -181,6 +181,7 @@ flutter:
- assets/images/svg/
- assets/tracker/
- assets/images/AlHabibMedicalService/
- assets/images/pharmacy_module/
fonts:

Loading…
Cancel
Save