# Conflicts:
#	lib/config/localized_values.dart
#	lib/core/service/client/base_app_client.dart
#	lib/uitl/translations_delegate_base.dart
merge-update-with-lab-changes
haroon amjad 5 years ago
commit 6846a8501a

@ -83,8 +83,11 @@ const GET_BABYINFORMATION_REQUEST =
const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID';
///userInformation ///userInformation
const GET_USERINFORMATION_REQUEST = const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New';
'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 ///addNewChild
const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby'; const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby';
@ -92,8 +95,8 @@ const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby';
///newUserId ///newUserId
const GET_NEW_USER_REQUEST = 'Services/Community.svc/REST/CreateNewUser_New'; const GET_NEW_USER_REQUEST = 'Services/Community.svc/REST/CreateNewUser_New';
///delteChild ///delete Child
const DELETE_CHILD_REQUEST = 'Services/Community.svc/REST/DeleteBaby'; const DELETE_CHILD_REQUEST = '/Services/Community.svc/REST/DeleteBaby';
///addNewTABLE ///addNewTABLE
const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable'; const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable';
@ -371,6 +374,16 @@ const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =
'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; '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 TIMER_MIN = 10;
const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"; const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw";

@ -720,6 +720,9 @@ const Map localizedValues = {
"drag-point": { "drag-point": {
"en": "Drag point to change your age", "en": "Drag point to change your age",
"ar": "اسحب لتغيير عمرك" "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": "البريد الالكتروني"}, "email": {"en": "Email", "ar": "البريد الالكتروني"},
"Book": {"en": "Book", "ar": "احجز"}, "Book": {"en": "Book", "ar": "احجز"},
@ -1112,10 +1115,14 @@ const Map localizedValues = {
"en": "Delete", "en": "Delete",
"ar": "حذف" "ar": "حذف"
}, },
"deleted-child": { "deleted-child-mes": {
"en": "The request was successful. The children have removed from the vaccination schedule subscription service.", "en": "The request was successful. The children have removed from the vaccination schedule subscription service.",
"ar": "تم حذف الطفل بنجاح" "ar": "تم حذف الطفل بنجاح"
}, },
"deleted-child":{
"en":"Delete child",
"ar":"إالغاء الطفل"
},
"visit": { "visit": {
"en": "Visit", "en": "Visit",
"ar": "زيارة" "ar": "زيارة"
@ -1128,6 +1135,26 @@ const Map localizedValues = {
"en": "Due date", "en": "Due date",
"ar": "تاريخ الاستحقاق" "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": { "appUpdate": {
"en": "UPDATE THE APP", "en": "UPDATE THE APP",
"ar": "تحديث التطبيق" "ar": "تحديث التطبيق"

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

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

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

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart'; 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/add_newchild_model.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart';
@ -17,22 +18,13 @@ class DeleteBabyService extends BaseService{
List<DeleteBaby> deleteBabyModelList= List(); List<DeleteBaby> deleteBabyModelList= List();
Future getDeleteBabyOrder({DeleteBaby deleteChild,int babyID}) async { Future getDeleteBabyOrder({List_BabyInformationModel babyInfo}) async {
hasError = false; hasError = false;
await getUser(); await getUser();
Map<String, dynamic> body = Map.from(deleteChild.toJson()); Map<String, dynamic> body = Map();
// body['CreatedBy'] = 102;
body['EditedBy'] = 102; body['EditedBy'] = 102;
//body['BabyID'] = babyID;
//body['BabyID'] = createNewBabyModelList ;
// body['AlertBy'] = 2;
// body['EmailAddress'] = user.emailAddress;
body['IsLogin'] = true; body['IsLogin'] = true;
body['LogInTokenID'] = await sharedPref.getString(TOKEN); body['BabyID'] = babyInfo.babyID;
body['MobileNumber'] = user.mobileNumber;
body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(DELETE_CHILD_REQUEST, await baseAppClient.post(DELETE_CHILD_REQUEST,
@ -45,31 +37,6 @@ class DeleteBabyService extends BaseService{
}, body: body); }, 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'; import '../base_service.dart';
class UserInformationService extends BaseService { class UserInformationService extends BaseService {
List<List_UserInformationModel> userInformationModelList = List(); List_UserInformationModel userInformationModel = List_UserInformationModel();
Map<String, dynamic> body = Map();
Future getUserInformationOrders() async { Future getUserInformationOrders() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map();
await getUser(); await getUser();
body['CreatedBy'] = 102; body['CreatedBy'] = 102;
body['EditedBy'] = 102; body['EditedBy'] = 102;
@ -22,14 +22,44 @@ class UserInformationService extends BaseService {
await baseAppClient.post(GET_USERINFORMATION_REQUEST, await baseAppClient.post(GET_USERINFORMATION_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
userInformationModelList.clear();
response['List_UserInformationModel_New'].forEach((vital) { response['List_UserInformationModel_New'].forEach((vital) {
userInformationModelList.add(List_UserInformationModel.fromJson(vital)); userInformationModel = List_UserInformationModel.fromJson(vital);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, 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/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/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import '../base_service.dart'; import '../base_service.dart';
class VaccinationTableService extends BaseService { 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; hasError = false;
await getUser(); await getUser();
body['BabyName']="fffffffffff eeeeeeeeeeeeee"; body['BabyName']=babyInfo.babyName;
body['DOB'] = "/Date(1585774800000+0300)/"; body['DOB'] = DateUtil.convertDateToString(babyInfo.dOB);
body['EmailAddress'] = user.emailAddress; body['EmailAddress'] = informationModel.emailAddress;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SendEmail'] = false; body['SendEmail'] = isSendEmail;
body['IsLogin'] =true; body['IsLogin'] =true;
await baseAppClient.post(GET_TABLE_REQUEST, await baseAppClient.post(GET_TABLE_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
createVaccinationTableModelList.clear(); createVaccinationTableModelList.clear();

@ -33,74 +33,82 @@ class BaseAppClient {
{Map<String, dynamic> body, {Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
bool isAllowAny = false}) async { bool isAllowAny = false,
String url = BASE_URL + endPoint; bool isExternal = false}) async {
String url;
if (isExternal) {
url = endPoint;
} else {
url = BASE_URL + endPoint;
}
try { try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); if (!isExternal) {
var languageID = String token = await sharedPref.getString(TOKEN);
await sharedPref.getString(APP_LANGUAGE); var languageID = await sharedPref.getString(APP_LANGUAGE);
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
: SETUP_ID : SETUP_ID
: SETUP_ID; : SETUP_ID;
} }
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = body.containsKey('LanguageID') body['LanguageID'] = body.containsKey('LanguageID')
? body['LanguageID'] != null ? body['LanguageID'] != null
? body['LanguageID'] ? body['LanguageID']
: languageID == 'ar' : languageID == 'ar'
? 1 ? 1
: 2 : 2
: languageID == 'en' : languageID == 'en'
? 2 ? 2
: 1; : 1;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA') body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] != null
? body['PatientOutSA'] ? body['PatientOutSA']
: PATIENT_OUT_SA : PATIENT_OUT_SA
: PATIENT_OUT_SA; : PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend') body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] ? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = DeviceTypeID; body['DeviceTypeID'] = DeviceTypeID;
if (!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] != null
? body['PatientType'] ? body['PatientType']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE : PATIENT_TYPE
: PATIENT_TYPE; : PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
:user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] = body['PatientID'] != null
body['PatientID'] != null ? body['PatientID'] : user['PatientID']; ? body['PatientID']
body['PatientOutSA'] = user['OutSA']; : user['PatientID'];
body['SessionID'] = SESSION_ID; //getSessionId(token); body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSessionId(token);
}
} }
} }
@ -124,8 +132,9 @@ class BaseAppClient {
if (parsed['Response_Message'] != null) { if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if(parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); navigateToAppUpdate(
AppGlobal.context, parsed['ErrorEndUserMessage']);
} }
if (isAllowAny) { if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -178,8 +187,14 @@ class BaseAppClient {
get(String endPoint, get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess, {Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async { Map<String, String> queryParams,
String url = BASE_URL + endPoint; bool isExternal = false}) async {
String url;
if (isExternal) {
url = endPoint;
} else {
url = BASE_URL + endPoint;
}
if (queryParams != null) { if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query; String queryString = Uri(queryParameters: queryParams).query;
url += '?' + queryString; url += '?' + queryString;
@ -188,10 +203,13 @@ class BaseAppClient {
print("URL : $url"); print("URL : $url");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: { final response = await http.get(
'Content-Type': 'application/json', url.trim(),
'Accept': 'application/json' headers: {
},); 'Content-Type': 'application/json',
'Accept': 'application/json'
},
);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
@ -209,9 +227,10 @@ class BaseAppClient {
logout() async { logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(LOGIN_TOKEN_ID);
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false; Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
_vitalSignService.weightKg =""; false;
_vitalSignService.heightCm=""; _vitalSignService.weightKg = "";
_vitalSignService.heightCm = "";
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }

@ -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/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/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/cmc_service.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 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import 'add_new_address_Request_Model.dart';
class CMCViewModel extends BaseViewModel { class CMCViewModel extends BaseViewModel {
CMCService _cMCService = CMCService _cMCService =
locator<CMCService>(); locator<CMCService>();
CustomerAddressesService _customerAddressesService =
locator<CustomerAddressesService>();
List<AddressInfo> get addressesList =>
_customerAddressesService.addressesList;
List<GetCMCServicesResponseModel> get cmcAllServicesList => List<GetCMCServicesResponseModel> get cmcAllServicesList =>
_cMCService.cmcAllServicesList; _cMCService.cmcAllServicesList;
@ -94,7 +99,6 @@ class CMCViewModel extends BaseViewModel {
await _cMCService await _cMCService
.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); .getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel);
} }
//TODO check it in uat
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
order.createdBy = user.patientID; order.createdBy = user.patientID;
@ -107,4 +111,44 @@ class CMCViewModel extends BaseViewModel {
getCmcAllPresOrders(); 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/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/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/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/service/AlHabibMedicalService/home_health_care_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:intl/intl.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import 'add_new_address_Request_Model.dart';
class HomeHealthCareViewModel extends BaseViewModel { class HomeHealthCareViewModel extends BaseViewModel {
HomeHealthCareService _homeHealthCareService = HomeHealthCareService _homeHealthCareService =
locator<HomeHealthCareService>(); locator<HomeHealthCareService>();
CustomerAddressesService _customerAddressesService =
locator<CustomerAddressesService>();
List<HHCGetAllServicesResponseModel> get hhcAllServicesList => List<HHCGetAllServicesResponseModel> get hhcAllServicesList =>
_homeHealthCareService.hhcAllServicesList; _homeHealthCareService.hhcAllServicesList;
List<AddressInfo> get addressesList =>
_customerAddressesService.addressesList;
List<GetHHCAllPresOrdersResponseModel> get hhcAllPresOrders => List<GetHHCAllPresOrdersResponseModel> get hhcAllPresOrders =>
_homeHealthCareService.hhcAllPresOrdersList; _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);
}
}
} }

@ -13,7 +13,6 @@ class AddNewChildViewModel extends BaseViewModel {
CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>(); CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>();
ChildVaccinesService _childVaccinesService = locator<ChildVaccinesService>(); ChildVaccinesService _childVaccinesService = locator<ChildVaccinesService>();
// DeleteBabyService _deleteBabyService = locator<DeleteBabyService>();
bool isAdded = false; bool isAdded = false;
///create new baby ///create new baby
createNewBabyOrders({ CreateNewBaby newChild}) async { createNewBabyOrders({ CreateNewBaby newChild}) async {
@ -25,13 +24,7 @@ class AddNewChildViewModel extends BaseViewModel {
} else { } else {
isAdded = true; isAdded = true;
setState(ViewState.Idle); 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; List<List_BabyInformationModel> get babyInformationModelList=> _childVaccinesService.babyInformationModelList;
//===========
CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>(); CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>();
DeleteBabyService _deleteBabyService = locator<DeleteBabyService>(); DeleteBabyService _deleteBabyService = locator<DeleteBabyService>();
bool isAdded = false; bool isAdded = false;
bool isDeleted = false; bool isDeleted = false;
//============
getNewUserOrders() async { getNewUserOrders() async {
@ -48,25 +45,15 @@ class ChildVaccinesViewModel extends BaseViewModel{
///delete baby ///delete baby
deleteBabyOrders({ DeleteBaby newChild}) async { deleteBabyOrders({ List_BabyInformationModel babyInfo}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
//await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID); await _deleteBabyService.getDeleteBabyOrder(babyInfo: babyInfo);
await _deleteBabyService.getDeleteBabyOrder(deleteChild: newChild,babyID: newChild.babyID); if (_deleteBabyService.hasError) {
//getDeleteBabyOrder(deleteChild: newChild,); error = _deleteBabyService.error;
// getDeleteBabyOrder
if (_creteNewBabyService.hasError) {
error = _creteNewBabyService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
isDeleted = true; isDeleted = true;
setState(ViewState.Idle); getBabyInformatioRequestOrders();
await _childVaccinesService.getAllBabyInformationOrders();
if (_childVaccinesService.hasError) {
error = _childVaccinesService.error;
setState(ViewState.Error);
} else{
}
} }
} }

@ -8,8 +8,7 @@ class UserInformationViewModel extends BaseViewModel {
UserInformationService _userInformationService = UserInformationService _userInformationService =
locator<UserInformationService>(); locator<UserInformationService>();
List<List_UserInformationModel> get userInformationModelList => List_UserInformationModel get userInformationModelList => _userInformationService.userInformationModel;
_userInformationService.userInformationModelList;
getUserInformationRequestOrders() async { getUserInformationRequestOrders() async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -20,4 +19,15 @@ class UserInformationViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); 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/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/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 'package:diplomaticquarterapp/core/service/childvaccines/vaccination_table_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.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>(); getCreateVaccinationTable({List_BabyInformationModel babyInfo, List_UserInformationModel informationModel, bool isSendEmail =false}) async {
// String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent;
//String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent;
List<CreateVaccinationTable> get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList;
getCreateVaccinationTable() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders(); await _creteVaccinationTableService.getCreateVaccinationTableOrders(babyInfo: babyInfo,informationModel: informationModel,isSendEmail: isSendEmail);
if (_creteVaccinationTableService.hasError) {
if ( _creteVaccinationTableService.hasError) { error = _creteVaccinationTableService.error;
error = _creteVaccinationTableService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'core/service/AlHabibMedicalService/cmc_service.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/e_referral_service.dart';
import 'core/service/AlHabibMedicalService/home_health_care_service.dart'; import 'core/service/AlHabibMedicalService/home_health_care_service.dart';
import 'core/service/AuthenticatedUserObject.dart'; import 'core/service/AuthenticatedUserObject.dart';
@ -135,13 +136,11 @@ void setupLocator() {
locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => UserInformationService());
locator.registerLazySingleton(() => CreteNewBabyService()); locator.registerLazySingleton(() => CreteNewBabyService());
locator.registerLazySingleton(() => DeleteBabyService()); locator.registerLazySingleton(() => DeleteBabyService());
locator.registerLazySingleton(() => VaccinationTableService()); locator.registerLazySingleton(() => VaccinationTableService());
locator.registerLazySingleton(() => NotificationService()); locator.registerLazySingleton(() => NotificationService());
locator.registerLazySingleton(() => PharmacyModuleService()); locator.registerLazySingleton(() => PharmacyModuleService());
locator.registerLazySingleton(() => OrderPreviewService()); locator.registerLazySingleton(() => OrderPreviewService());
locator.registerLazySingleton(() => CustomerAddressesService());
/// View Model /// View Model

@ -63,7 +63,7 @@ class MyApp extends StatelessWidget {
const Locale('ar', ''), // Arabic const Locale('ar', ''), // Arabic
const Locale('en', ''), // English const Locale('en', ''), // English
], ],
//theme: themeNotifier.getTheme(), // theme: themeNotifier.getTheme(),
theme:ThemeData( theme:ThemeData(
fontFamily:projectProvider.isArabic ? 'Cairo' : 'WorkSans', fontFamily:projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
@ -76,6 +76,11 @@ class MyApp extends StatelessWidget {
}, },
), ),
hintColor: Colors.grey[400], hintColor: Colors.grey[400],
textTheme: TextTheme(
headline1: TextStyle(
color: Color(0xffB8382C),
),
),
disabledColor: Colors.grey[300], disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0), errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100], scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100],

@ -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>[ children: <Widget>[
widget.model.cmcAllOrderDetail.length != 0 widget.model.cmcAllOrderDetail.length != 0
? FractionallySizedBox( ? FractionallySizedBox(
heightFactor: 0.8, heightFactor: 0.9,
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(
width: double.infinity, 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_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_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/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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -199,26 +201,42 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
child: SecondaryButton( child: SecondaryButton(
label: "Next", label: "Next",
textColor: Theme.of(context).backgroundColor, textColor: Theme.of(context).backgroundColor,
onTap: () { color: Colors.grey[800],
if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) { onTap: () async {
if (widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList.length !=
0 ||
widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList ==
null) {
int index = widget.model.cmcAllServicesList.length; int index = widget.model.cmcAllServicesList.length;
PatientERCMCInsertServicesList PatientERCMCInsertServicesList
patientERCMCInsertServicesList = patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList( new PatientERCMCInsertServicesList(
price: widget.model.cmcAllServicesList[index-1].price, price: widget
serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(), .model.cmcAllServicesList[index - 1].price,
selectedServiceName: widget.model.cmcAllServicesList[index-1].description, serviceID: widget
selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description, .model.cmcAllServicesList[index - 1].serviceID
.toString(),
selectedServiceName: widget.model
.cmcAllServicesList[index - 1].description,
selectedServiceNameAR: widget.model
.cmcAllServicesList[index - 1].description,
recordID: 1, recordID: 1,
totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice, totalPrice: widget
.model.cmcAllServicesList[index - 1].totalPrice,
vAT: widget.model.cmcAllServicesList[index-1].vAT); vAT: widget.model.cmcAllServicesList[index-1].vAT);
widget.cMCInsertPresOrderRequestModel widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = [ .patientERCMCInsertServicesList = [
patientERCMCInsertServicesList patientERCMCInsertServicesList
]; ];
await widget.model.getCustomerInfo();
widget.changePageViewIndex(1); 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, width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton( child: SecondaryButton(
label: "Confirm", label: "Confirm",
color: Colors.grey[800],
onTap: () async { onTap: () async {
await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) { if (widget.model.state != ViewState.ErrorLocal) {

@ -1,19 +1,22 @@
import 'package:diplomaticquarterapp/config/config.dart'; 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/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/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/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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'cmc_location_page.dart';
class NewCMCStepTowPage extends StatefulWidget { class NewCMCStepTowPage extends StatefulWidget {
final Function(PickResult) onPick; final Function(PickResult) onPick;
final double latitude; final double latitude;
@ -41,12 +44,13 @@ class _NewCMCStepTowPageState
extends State<NewCMCStepTowPage> { extends State<NewCMCStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress;
@override @override
void initState() { void initState() {
if (widget.cmcInsertPresOrderRequestModel.latitude == null) { if (widget.cmcInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude; setLatitudeAndLongitude();
longitude = widget.longitude;
} else { } else {
latitude = widget.cmcInsertPresOrderRequestModel.latitude; latitude = widget.cmcInsertPresOrderRequestModel.latitude;
longitude = widget.cmcInsertPresOrderRequestModel.longitude; longitude = widget.cmcInsertPresOrderRequestModel.longitude;
@ -54,60 +58,152 @@ class _NewCMCStepTowPageState
super.initState(); 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: PlacePicker( body: Stack(
apiKey: GOOGLE_API_KEY, children: [
enableMyLocationButton: true, PlacePicker(
automaticallyImplyAppBarLeading: false, apiKey: GOOGLE_API_KEY,
autocompleteOnTrailingWhitespace: true, enableMyLocationButton: true,
selectInitialPosition: true, automaticallyImplyAppBarLeading: false,
autocompleteLanguage: projectViewModel.currentLanguage, autocompleteOnTrailingWhitespace: true,
enableMapTypeButton: true, selectInitialPosition: true,
onPlacePicked: (PickResult result) { autocompleteLanguage: projectViewModel.currentLanguage,
print(result.adrAddress); enableMapTypeButton: true,
widget.changePageViewIndex(3); searchForInitialValue: false,
},
selectedPlaceWidgetBuilder: onPlacePicked: (PickResult result) {
(_, selectedPlace, state, isSearchBarFocused) { print(result.adrAddress);
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); widget.changePageViewIndex(3);
return isSearchBarFocused },
? Container() selectedPlaceWidgetBuilder:
: FloatingCard( (_, selectedPlace, state, isSearchBarFocused) {
bottomPosition: 0.0, print("state: $state, isSearchBarFocused: $isSearchBarFocused");
leftPosition: 0.0, return isSearchBarFocused
rightPosition: 0.0, ? Container()
width: 500, : FloatingCard(
borderRadius: BorderRadius.circular(12.0), bottomPosition: 0.0,
child: state == SearchingState.Searching leftPosition: 0.0,
? Center(child: CircularProgressIndicator()) rightPosition: 0.0,
: Container( width: 500,
margin: EdgeInsets.all(12), borderRadius: BorderRadius.circular(12.0),
child: SecondaryButton( child: state == SearchingState.Searching
color: Colors.grey[800], ? Center(child: CircularProgressIndicator())
textColor: Colors.white, : Container(
onTap: () { margin: EdgeInsets.all(12),
setState(() { child: Column(
widget.cmcInsertPresOrderRequestModel children: [
.latitude = SecondaryButton(
selectedPlace.geometry.location.lat; color: Colors.grey[800],
widget.cmcInsertPresOrderRequestModel textColor: Colors.white,
.longitude = onTap: () {
selectedPlace.geometry.location.lng; Navigator.push(
}); context,
widget.changePageViewIndex(3); MaterialPageRoute(
}, builder: (BuildContext context) =>
label: TranslationBase.of(context).next, 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( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).homeHealthCare, description: TranslationBase.of(context).HHCNotAuthMsg,
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(

@ -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/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/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -138,9 +139,17 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
.widget .widget
.patientERInsertPresOrderRequestModel .patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList .patientERHHCInsertServicesList
.length == 0, .length == 0 || widget.model.state == ViewState.BusyLocal,
onTap: (){ color: Colors.grey[800],
widget.changePageViewIndex(1); 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), textColor: Theme.of(context).backgroundColor),
), ),

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

@ -1,17 +1,20 @@
import 'package:diplomaticquarterapp/config/config.dart'; 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/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/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_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/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/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'location_page.dart';
class NewHomeHealthCareStepTowPage extends StatefulWidget { class NewHomeHealthCareStepTowPage extends StatefulWidget {
final Function(PickResult) onPick; final Function(PickResult) onPick;
final double latitude; final double latitude;
@ -40,73 +43,163 @@ class _NewHomeHealthCareStepTowPageState
extends State<NewHomeHealthCareStepTowPage> { extends State<NewHomeHealthCareStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress;
@override @override
void initState() { void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude == null) { if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude; setLatitudeAndLongitude();
longitude = widget.longitude;
} else { } else {
latitude = widget.patientERInsertPresOrderRequestModel.latitude; latitude = widget.patientERInsertPresOrderRequestModel.latitude;
longitude = widget.patientERInsertPresOrderRequestModel.longitude; longitude = widget.patientERInsertPresOrderRequestModel.longitude;
} }
super.initState(); 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: PlacePicker( body: Stack(
apiKey: GOOGLE_API_KEY, children: [
enableMyLocationButton: true, PlacePicker(
automaticallyImplyAppBarLeading: false, apiKey: GOOGLE_API_KEY,
autocompleteOnTrailingWhitespace: true, enableMyLocationButton: true,
selectInitialPosition: true, automaticallyImplyAppBarLeading: false,
autocompleteLanguage: projectViewModel.currentLanguage, autocompleteOnTrailingWhitespace: true,
enableMapTypeButton: true, selectInitialPosition: true,
onPlacePicked: (PickResult result) { autocompleteLanguage: projectViewModel.currentLanguage,
print(result.adrAddress); enableMapTypeButton: true,
widget.changePageViewIndex(3); searchForInitialValue: false,
},
selectedPlaceWidgetBuilder: onPlacePicked: (PickResult result) {
(_, selectedPlace, state, isSearchBarFocused) { print(result.adrAddress);
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); widget.changePageViewIndex(3);
return isSearchBarFocused },
? Container() selectedPlaceWidgetBuilder:
: FloatingCard( (_, selectedPlace, state, isSearchBarFocused) {
bottomPosition: 0.0, print("state: $state, isSearchBarFocused: $isSearchBarFocused");
leftPosition: 0.0, return isSearchBarFocused
rightPosition: 0.0, ? Container()
width: 500, : FloatingCard(
borderRadius: BorderRadius.circular(12.0), bottomPosition: 0.0,
child: state == SearchingState.Searching leftPosition: 0.0,
? Center(child: CircularProgressIndicator()) rightPosition: 0.0,
: Container( width: 500,
margin: EdgeInsets.all(12), borderRadius: BorderRadius.circular(12.0),
child: SecondaryButton( child: state == SearchingState.Searching
color: Colors.grey[800], ? Center(child: CircularProgressIndicator())
textColor: Colors.white, : Container(
onTap: () { margin: EdgeInsets.all(12),
setState(() { child: Column(
widget.patientERInsertPresOrderRequestModel children: [
.latitude = SecondaryButton(
selectedPlace.geometry.location.lat; color: Colors.grey[800],
widget.patientERInsertPresOrderRequestModel textColor: Colors.white,
.longitude = onTap: () {
selectedPlace.geometry.location.lng; Navigator.push(
}); context,
widget.changePageViewIndex(3); MaterialPageRoute(
}, builder: (BuildContext context) =>
label: TranslationBase.of(context).next, 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( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
description: TranslationBase.of(context).HHCNotAuthMsg,
appBarTitle: TranslationBase.of(context).homeHealthCare, appBarTitle: TranslationBase.of(context).homeHealthCare,
// appBarTitle: TranslationBase.of(context).homeHealthCare,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; 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/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/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -9,99 +10,110 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
import 'dialogs/delete_child.dart';
class ChildDetailsWidget extends StatelessWidget { class ChildDetailsWidget extends StatelessWidget {
final ChildVaccinesViewModel model; final ChildVaccinesViewModel model;
final List_BabyInformationModel babyInfo; final List_BabyInformationModel babyInfo;
DeleteBaby deleteBaby = DeleteBaby(); final List_UserInformationModel informationModel;
final Function onTapDelete;
ChildDetailsWidget({this.model, this.babyInfo}); ChildDetailsWidget({this.model, this.babyInfo, this.informationModel, this.onTapDelete});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return InkWell(
margin: EdgeInsets.only(left: 5, right: 5, bottom: 10), onTap: (){
decoration: BoxDecoration( Navigator.push(
shape: BoxShape.rectangle, context,
border: Border.all(color: Colors.white, width: 0.5), FadePage(
borderRadius: BorderRadius.all(Radius.circular(5)), page: VaccinationTablePage(
color: Colors.white, babyInfo: babyInfo,
), informationModel: informationModel,
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, child: Container(
color: Colors.red, margin: EdgeInsets.only(left: 5, right: 5, bottom: 10),
), decoration: BoxDecoration(
tooltip: '', shape: BoxShape.rectangle,
onPressed: () { border: Border.all(color: Colors.white, width: 0.5),
Navigator.push( borderRadius: BorderRadius.all(Radius.circular(5)),
context, color: Colors.white,
FadePage( ),
page: VaccinationTablePage(babyInfo: babyInfo,), padding: EdgeInsets.all(12),
), width: 200,
); //double.infinity,
}, child: Column(
) children: [
]), Row(children: [
Row(children: [ Texts(TranslationBase.of(context).childName),
Texts(TranslationBase.of(context).childDob), ]),
]), Row(children: [
Row( Texts(babyInfo.babyName.trim()),
children: [ ]),
Row(children: [
IconButton( IconButton(
icon: new Image.asset( icon: Image.asset(babyInfo.gender == 1
'assets/images/new-design/calender-secondary.png'), ? 'assets/images/new-design/male.png'
: 'assets/images/new-design/female.png'),
tooltip: '', tooltip: '',
onPressed: () {
},
), ),
Texts( Texts(babyInfo.genderDescription),
DateUtil.yearMonthDay(babyInfo.dOB), 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),
), ]),
Row(children: [ SizedBox(
IconButton( height: 12,
icon: new Image.asset('assets/images/new-design/garbage.png'),
tooltip: '',
onPressed: () async {
await model.deleteBabyOrders(newChild: deleteBaby);
deleteBaby.babyID = babyInfo.babyID;
await model.deleteBabyOrders(newChild: deleteBaby);
if (model.isDeleted) {
AppToast.showSuccessToast(message: TranslationBase.of(context).deletedChild);
Navigator.pop(context, model.isDeleted);
} else {
//TODO handling error
}
},
), ),
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/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
enum Gender { Male, Female, NON } enum Gender { Male, Female, NON }
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
class AddNewChildPage extends StatefulWidget { class AddNewChildPage extends StatefulWidget {
final int frequency;
final int days;
final String itemDescription;
String dateAdd; 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 startDay;
DateTime endDay; DateTime endDay;
//AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key); AddNewChildPage() {
AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) {
startDay = DateTime.now(); startDay = DateTime.now();
endDay = endDay = DateTime.now();
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)));
}
} }
@override @override
@ -61,150 +39,140 @@ class AddNewChildPage extends StatefulWidget {
} }
class _AddNewChildPageState extends State<AddNewChildPage> { class _AddNewChildPageState extends State<AddNewChildPage> {
int tappedIndex;
int checkedValue; int checkedValue;
@override
void initState() {
super.initState();
tappedIndex = -1;
}
TextEditingController _firstTextController = TextEditingController(); TextEditingController _firstTextController = TextEditingController();
TextEditingController _secondTextController = TextEditingController(); TextEditingController _secondTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON;
Gender gender = Gender.Male; Gender gender = Gender.Male;
CreateNewUser_New newUserChild = CreateNewUser_New(); CreateNewUser_New newUserChild = CreateNewUser_New();
//ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel();
List_BabyInformationModel addvancedModel = List_BabyInformationModel();
CreateNewBaby newChild = CreateNewBaby(); CreateNewBaby newChild = CreateNewBaby();
List_UserInformationModel informationModel = List_UserInformationModel();
String firstName = "";
String secondName = "";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<AddNewChildViewModel>( return BaseView<AddNewChildViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: "Vaccintion", appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Column( child: Column(
// crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 50, height: 25,
),
Texts(
"Add the child's information below to recieve the schedule of vaccinations.",
//+model.user.firstName,
textAlign: TextAlign.center,
), ),
Texts(TranslationBase.of(context).addInstructions),
SizedBox( SizedBox(
height: 12, height: 20,
), ),
NewTextFields( NewTextFields(
hintText: "First Name", hintText: TranslationBase.of(context).firstName,
controller: _firstTextController, controller: _firstTextController,
onChanged: (value) {
setState(() {
firstName = value;
});
},
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( NewTextFields(
hintText: "Second Name", hintText: TranslationBase.of(context).lastName,
controller: _secondTextController, controller: _secondTextController,
onChanged: (value) {
secondName = value;
},
), ),
SizedBox( SizedBox(
height: 12, height: 20,
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Gender:", TranslationBase.of(context).gender + " :",
textAlign: TextAlign.end, textAlign: TextAlign.end,
), ),
], ],
), ),
SizedBox(
height: 15,
),
Container( Container(
height: MediaQuery.of(context).size.height * 0.12, height: 60,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Expanded(
height: MediaQuery.of(context).size.height * 0.12, child: AnimatedContainer(
width: 175, duration: Duration(milliseconds: 400),
color: Colors.white, height: 60,
child: SecondaryButton( color: Colors.white,
textColor: child: SecondaryButton(
checkedValue == 1 ? Colors.white : Colors.black, textColor:
color: checkedValue == 1 ? Colors.red : Colors.white, checkedValue == 1 ? Colors.white : Colors.black,
color:
label: "Male", checkedValue == 1 ? Colors.red : Colors.white,
// label: TranslationBase.of(context).male,
onTap: () { onTap: () {
setState(() {
setState(() { checkedValue = 1;
checkedValue = 1; });
print("checkedValue=" + checkedValue.toString()); },
}); ),
// bloodDetails.
},
), ),
), ),
Container( Expanded(
height: MediaQuery.of(context).size.height * 0.12, child: AnimatedContainer(
width: 175, duration: Duration(milliseconds: 400),
color: Colors.white, height: 60,
child: SecondaryButton( color: Colors.white,
textColor: child: SecondaryButton(
checkedValue == 2 ? Colors.white : Colors.black, textColor:
color: checkedValue == 2 ? Colors.red : Colors.white, checkedValue == 2 ? Colors.white : Colors.black,
label: "Female", color:
// checkedValue == 2 ? Colors.red : Colors.white,
onTap: () { label: TranslationBase.of(context).female,
setState(() { onTap: () {
checkedValue = 2; setState(() {
print("checkedValue=" + checkedValue.toString()); checkedValue = 2;
}); });
// bloodDetails.city=_selectedHospital.toString(); },
),
// bloodDetails.
},
), ),
) )
], ],
), ),
), ),
//==========
SizedBox( SizedBox(
height: 6, height: 20,
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Date Of Birth::", TranslationBase.of(context).dob + " :",
textAlign: TextAlign.end, textAlign: TextAlign.end,
), ),
], ],
), ),
SizedBox(
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showDatePicker( DatePicker.showDatePicker(
context, context,
showTitleActions: true, showTitleActions: true,
// minTime: DateTime(
// DateTime.now().year, DateTime.now().month - 1, 1),
minTime: DateTime(1, 1, 1), minTime: DateTime(1, 1, 1),
maxTime: DateTime.now(), maxTime: DateTime.now(),
onConfirm: (date) { onConfirm: (date) {
@ -213,7 +181,6 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
}); });
}, },
currentTime: widget.startDay, currentTime: widget.startDay,
// locale: projectViewModel.localeType
); );
}, },
child: Container( child: Container(
@ -224,99 +191,63 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(//getStartDay()
// DateUtil.yearMonthDay(DateTime.now())
getStartDay()),
Icon( Icon(
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Colors.black,
) ),
SizedBox(
width: 25,
),
Expanded(child: Texts(getStartDay())),
], ],
), ),
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 25,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * 0.12, height: 60,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue == false color: Colors.grey[800],
? Colors.white24 disabled: (checkedValue == null ||
: Color.fromRGBO( firstName.isEmpty ||
63, secondName.isEmpty),
72, label: TranslationBase.of(context).add,
74, onTap: () async {
1, newChild.babyName = _firstTextController.text +
), " " +
label: "Add", _secondTextController.text;
//
onTap: () async{
newChild.babyName = _firstTextController.text + " " + _secondTextController.text;
newChild.gender = checkedValue.toString(); newChild.gender = checkedValue.toString();
newChild.strDOB = getStartDay(); newChild.strDOB = widget.startDay.toIso8601String();
newChild.tempValue = true; newChild.tempValue = true;
newChild.isLogin = true; newChild.isLogin = true;
await model.createNewBabyOrders(newChild: newChild); await model.createNewBabyOrders(newChild: newChild);
if(model.isAdded){ if (model.isAdded) {
AppToast.showSuccessToast(message: "Record Added"); AppToast.showSuccessToast(
Navigator.pop(context,model.isAdded); message: TranslationBase.of(context).addedChild);
}else{ Navigator.pop(context, model.isAdded);
} else {
//TODO handling error AppToast.showSuccessToast(message: model.error);
} }
}, },
), ),
), ),
//=========
], ],
), ),
), ),
), ),
// bottomSheet: // bottomSheet:
), ),
); );
} }
String getStartDay() { String getStartDay() {
return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; return "${widget.startDay.day}-${widget.startDay.month}-${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;
});
},
),
);
} }
} }

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; 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/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/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart';
@ -13,15 +14,20 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
import 'ChidDetailsWidget.dart'; import 'ChidDetailsWidget.dart';
import 'dialogs/delete_child.dart'; import 'dialogs/delete_child.dart';
class ChildPage extends StatefulWidget { class ChildPage extends StatefulWidget {
final List_UserInformationModel informationModel;
const ChildPage({Key key, this.informationModel}) : super(key: key);
@override @override
_ChildPageState createState() => _ChildPageState(); _ChildPageState createState() => _ChildPageState();
} }
//TODO
class _ChildPageState extends State<ChildPage> class _ChildPageState extends State<ChildPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
DeleteBaby deleteBaby = DeleteBaby(); DeleteBaby deleteBaby = DeleteBaby();
@ -31,7 +37,7 @@ class _ChildPageState extends State<ChildPage>
var checkedValue = true; var checkedValue = true;
return BaseView<ChildVaccinesViewModel>( return BaseView<ChildVaccinesViewModel>(
onModelReady: (model) => model.getNewUserOrders(), onModelReady: (model) => model.getNewUserOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).vaccination, appBarTitle: TranslationBase.of(context).vaccination,
baseViewModel: model, baseViewModel: model,
@ -54,6 +60,23 @@ class _ChildPageState extends State<ChildPage>
return ChildDetailsWidget( return ChildDetailsWidget(
model: model, model: model,
babyInfo: model.babyInformationModelList[index], 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);
}
}),
);
},
); );
}, },
), ),
@ -87,7 +110,8 @@ class _ChildPageState extends State<ChildPage>
builder: (context) => AddNewChildPage(), builder: (context) => AddNewChildPage(),
), ),
).then((value) { ).then((value) {
if (value) model.getNewUserOrders(); if (value!=null)
model.getNewUserOrders();
}); });
}, },
), ),

@ -23,6 +23,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
TextEditingController titleController = TextEditingController(); TextEditingController titleController = TextEditingController();
var checkedValue = false; var checkedValue = false;
String addEmail = ""; String addEmail = "";
final updateEmailFormKey = GlobalKey<FormState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -72,30 +73,31 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
indent: 10, indent: 10,
endIndent: 10, endIndent: 10,
), ),
Padding( Form(
padding: const EdgeInsets.all(10.0), key: updateEmailFormKey,
child: Container( child: Padding(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), padding: const EdgeInsets.all(10.0),
child: TextFields( child: Container(
fillColor: Colors.red, margin: EdgeInsets.only(left: 10, right: 10, top: 15),
hintText: model.user.emailAddress, child: TextFields(
controller: titleController, fillColor: Colors.red,
fontSize: 20, initialValue: model.userInformationModelList.emailAddress,
hintColor: Colors.black, fontSize: 20,
fontWeight: FontWeight.w600, hintColor: Colors.black,
onChanged: (text) { fontWeight: FontWeight.w600,
addEmail = text; onChanged: (text) {
model.user.emailAddress == addEmail setState(() {
? checkedValue = false addEmail = text;
: checkedValue = true; });
}, },
validator: (value) { validator: (value) {
if (value == null) { if (value.isEmpty)
return model.user.emailAddress; return TranslationBase.of(context).enterEmail;
} else { else if (!RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(value))
return model.user.emailAddress; return TranslationBase.of(context).validEmail;
} return null;
}, },
),
), ),
), ),
), ),
@ -105,23 +107,17 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue == false color: model.userInformationModelList.emailAddress == addEmail ? Colors.white24 : Color.fromRGBO(63, 72, 74, 1,),
? Colors.white24 disabled: addEmail.isEmpty,
: Color.fromRGBO(
63,
72,
74,
1,
),
label: TranslationBase.of(context).updateEmail, label: TranslationBase.of(context).updateEmail,
// onTap: () async{
onTap: () { final form = updateEmailFormKey.currentState;
model.user.emailAddress = addEmail.toString(); if (form.validate()) {
AppToast.showSuccessToast( form.save();
message: TranslationBase.of(context).updatedEmail); await model.updateEmail(addEmail);
// bloodDetails.city=_selectedHospital.toString(); AppToast.showSuccessToast(message: TranslationBase.of(context).updatedEmail);
}
// bloodDetails.
}, },
), ),
), ),
@ -138,11 +134,10 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
1, 1,
), ),
label: TranslationBase.of(context).viewListChildren, label: TranslationBase.of(context).viewListChildren,
//
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(
page: ChildPage(), page: ChildPage(informationModel: model.userInformationModelList,),
), ),
), ),
), ),

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

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

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; 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/child_vaccines/vaccination_table_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_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/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -9,19 +11,23 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'dialogs/SelectGenderDialog.dart'; import 'dialogs/ConfirmSendEmailDialog.dart';
class VaccinationTablePage extends StatelessWidget { class VaccinationTablePage extends StatelessWidget {
final List_BabyInformationModel babyInfo; final List_BabyInformationModel babyInfo;
final List_UserInformationModel informationModel;
const VaccinationTablePage({Key key, this.babyInfo, this.informationModel})
: super(key: key);
const VaccinationTablePage({Key key, this.babyInfo}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var checkedValue; var checkedValue;
return BaseView<VaccinationTableViewModel>( return BaseView<VaccinationTableViewModel>(
onModelReady: (model) => model.getCreateVaccinationTable(), onModelReady: (model) => model.getCreateVaccinationTable(babyInfo: babyInfo, informationModel: informationModel),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
@ -37,22 +43,30 @@ class VaccinationTablePage extends StatelessWidget {
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Texts(TranslationBase.of(context).childName), Texts(TranslationBase.of(context).childName),
Texts(babyInfo.babyName??'',fontWeight: FontWeight.w600,), Texts(
babyInfo.babyName ?? '',
fontWeight: FontWeight.w600,
),
], ],
), ),
), ),
Expanded( Expanded(
child: Column(children: [ child: Column(
children: [
Texts(TranslationBase.of(context).childDob), Texts(TranslationBase.of(context).childDob),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Icon(FontAwesomeIcons.calendarCheck,color: Colors.red,), Icon(
SizedBox(width: 15,), FontAwesomeIcons.calendarCheck,
Texts(DateUtil.yearMonthDay(babyInfo.dOB)??''), color: Colors.red,
),
SizedBox(
width: 15,
),
Texts(DateUtil.yearMonthDay(babyInfo.dOB) ?? ''),
], ],
), ),
], ],
@ -60,7 +74,9 @@ class VaccinationTablePage extends StatelessWidget {
), ),
], ],
), ),
SizedBox(height: 15,), SizedBox(
height: 15,
),
Divider(), Divider(),
Column( Column(
children: [ children: [
@ -75,25 +91,19 @@ class VaccinationTablePage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Texts(TranslationBase.of(context).descriptionVaccination), Texts(TranslationBase.of(context)
.descriptionVaccination),
], ],
), ),
), ),
Texts(TranslationBase.of(context).dueDate), Texts(TranslationBase.of(context).dueDate),
], ],
), ),
], ],
), ),
...List.generate( ...List.generate(
model.creteVaccinationTableModelList.length, model.creteVaccinationTableModelList.length,
(index) => Container( (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,
// ),
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
child: Column( child: Column(
@ -111,16 +121,21 @@ class VaccinationTablePage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Html( Html(
data: model.creteVaccinationTableModelList[index].vaccinesDescription, data: model
.creteVaccinationTableModelList[index]
.vaccinesDescription,
), ),
], ],
), ),
), ),
Texts(model.creteVaccinationTableModelList[index].givenAt), Texts(model
.creteVaccinationTableModelList[index].givenAt),
], ],
), ),
Divider( Divider(
color: Colors.white,height: 3,thickness: 1.0, color: Colors.white,
height: 3,
thickness: 1.0,
), ),
], ],
), ),
@ -140,12 +155,24 @@ class VaccinationTablePage extends StatelessWidget {
textColor: Colors.white, textColor: Colors.white,
color: checkedValue == false color: checkedValue == false
? Colors.white24 ? Colors.white24
: Color.fromRGBO(63, 72, 74, 1,), : Color.fromRGBO(
63,
72,
74,
1,
),
label: TranslationBase.of(context).sendEmail, label: TranslationBase.of(context).sendEmail,
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
child: SelectGenderDialog(), 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);
},
),
); );
}, },
), ),

@ -1,8 +1,8 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
@ -445,7 +445,7 @@ class _HomePageState extends State<HomePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: HomeHealthCareIndexPage(), page: HomeHealthCarePage(),
), ),
); );
}, },
@ -513,7 +513,7 @@ class _HomePageState extends State<HomePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: CMCIndexPage(), page: CMCPage(),
), ),
); );
}, },

@ -21,7 +21,7 @@ class DateUtil {
static String convertDateToString(DateTime date) { static String convertDateToString(DateTime date) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)/";
int milliseconds = date.millisecondsSinceEpoch; int milliseconds = date.millisecondsSinceEpoch;
return start + "$milliseconds" + end; return start + "$milliseconds" + end;

@ -1,7 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:diplomaticquarterapp/config/localized_values.dart'; 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/foundation.dart' show SynchronousFuture;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -697,6 +696,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
localizedValues['ServiceInformation'][locale.languageCode]; localizedValues['ServiceInformation'][locale.languageCode];
String get homeHealthCare => String get homeHealthCare =>
localizedValues['HomeHealthCare'][locale.languageCode]; localizedValues['HomeHealthCare'][locale.languageCode];
String get HHCNotAuthMsg =>
localizedValues['HHCNotAuthMsg'][locale.languageCode];
String get homeHealthCareText => String get homeHealthCareText =>
localizedValues['HomeHealthCareText'][locale.languageCode]; localizedValues['HomeHealthCareText'][locale.languageCode];
String get loginRegister => String get loginRegister =>
@ -885,10 +886,16 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get childName => localizedValues['child-name'][locale.languageCode]; String get childName => localizedValues['child-name'][locale.languageCode];
String get childDob => localizedValues['childDob'][locale.languageCode]; String get childDob => localizedValues['childDob'][locale.languageCode];
String get delete => localizedValues['delete'][locale.languageCode]; String get delete => localizedValues['delete'][locale.languageCode];
String get deletedChild => localizedValues['deleted-child'][locale.languageCode]; String get deletedChildMes => localizedValues['deleted-child-mes'][locale.languageCode];
String get visit => localizedValues['visit'][locale.languageCode]; String get visit => localizedValues['visit'][locale.languageCode];
String get descriptionVaccination => localizedValues['description-vaccination'][locale.languageCode]; String get descriptionVaccination => localizedValues['description-vaccination'][locale.languageCode];
String get dueDate => localizedValues['due-date'][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 appUpdate => localizedValues['appUpdate'][locale.languageCode];
String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode]; String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode];

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

Loading…
Cancel
Save