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

 Conflicts:
	lib/config/config.dart
	lib/locator.dart
	lib/pages/landing/home_page.dart
	lib/widgets/others/app_scaffold_widget.dart
merge-update-with-lab-changes
hussam al-habibeh 5 years ago
commit 7815005e21

@ -1,36 +1,11 @@
package com.cloud.diplomaticquarterapp
import android.content.ContentResolver
import android.content.Context
import android.media.RingtoneManager
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugins.GeneratedPluginRegistrant
import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity : FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
MethodChannel(flutterEngine.dartExecutor, "crossingthestreams.io/resourceResolver").setMethodCallHandler { call: MethodCall, result: MethodChannel.Result ->
if ("drawableToUri" == call.method) {
val resourceId = this@MainActivity.resources.getIdentifier(call.arguments as String, "drawable", this@MainActivity.packageName)
result.success(resourceToUriString(this@MainActivity.applicationContext, resourceId))
}
if ("getAlarmUri" == call.method) {
result.success(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM).toString())
}
}
}
companion object {
private fun resourceToUriString(context: Context, resId: Int): String {
return (ContentResolver.SCHEME_ANDROID_RESOURCE
+ "://"
+ context.resources.getResourcePackageName(resId)
+ "/"
+ context.resources.getResourceTypeName(resId)
+ "/"
+ context.resources.getResourceEntryName(resId))
}
}
class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -6,8 +6,7 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660;
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com//';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
@ -280,6 +279,10 @@ const GET_COVID_DRIVETHRU_PAYMENT_INFO =
const GET_COVID_DRIVETHRU_FREE_SLOTS =
'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
///Smartwatch Integration Services
const GET_PATIENT_LAST_RECORD =
'Services/Patients.svc/REST/Med_GetPatientLastRecord';
///My Trackers
const GET_DIABETIC_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
@ -336,6 +339,8 @@ const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer";
const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
// Home Health Care
const HHC_GET_ALL_SERVICES =

@ -547,18 +547,18 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "Please enter the verification code send to",
"ar": "الرجاء إدخال رمز التحقق المرسل إلى"
},
"EyeMeasurements":{"en":"Eye Measurements","ar":"قياسات النظر"},
"Measurements":{"en":"Measurements","ar":"قياسات"},
"Classes":{"en":"Classes","ar":"نظارات"},
"ContactLens":{"en":"Contact Lens","ar":"العدسات اللاصقة"},
"RightEye":{"en":"Right Eye","ar":"العين اليمين"},
"Sphere":{"en":"Sphere","ar":"القوة"},
"Cylinder":{"en":"Cylinder","ar":"الدائرية"},
"Axis":{"en":"Axis","ar":"المحاور"},
"Prism":{"en":"Prism","ar":"موشور"},
"VA":{"en":"Prism","ar":"المحاور"},
"LeftEye":{"en":"Left Eye","ar":"العين اليسرى"},
"Brand":{"en":"Brand","ar":"النوع"},
"EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"},
"Measurements": {"en": "Measurements", "ar": "قياسات"},
"Classes": {"en": "Classes", "ar": "نظارات"},
"ContactLens": {"en": "Contact Lens", "ar": "العدسات اللاصقة"},
"RightEye": {"en": "Right Eye", "ar": "العين اليمين"},
"Sphere": {"en": "Sphere", "ar": "القوة"},
"Cylinder": {"en": "Cylinder", "ar": "الدائرية"},
"Axis": {"en": "Axis", "ar": "المحاور"},
"Prism": {"en": "Prism", "ar": "موشور"},
"VA": {"en": "Prism", "ar": "المحاور"},
"LeftEye": {"en": "Left Eye", "ar": "العين اليسرى"},
"Brand": {"en": "Brand", "ar": "النوع"},
"Power": {"en": "Power", "ar": "القوة"},
"Diameter": {"en": "Diameter", "ar": "القطر"},
"Remarks": {"en": "Remarks", "ar": "ملاحضات"},
@ -590,6 +590,11 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "View Doctor Responses",
"ar": "الاطلاع على ردود الأطباء"
},
"ServiceInformationButton": {"en": "LOGIN / REGISTER", "ar": "دخول / تسجيل"},
"ServiceInformationTitle": {
"en": "Service Information",
"ar": "معلومات الخدمة"
},
"ServiceInformation": {"en": "Service Information", "ar": "معلومات الخدمة"},
"HomeHealthCare": {
"en": "Home Health Care",
@ -601,25 +606,58 @@ const Map<String, Map<String, String>> localizedValues = {
"ar":
"توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية الاشعة التطعيمات العلاج الطبيعي)... "
},
"LoginRegister": {
"en": "Login/Register",
"ar": "دخول / تسجيل"
"LoginRegister": {"en": "Login/Register", "ar": "دخول / تسجيل"},
"OrderLog": {"en": "Order Log", "ar": " سجل الطلبات"},
"info-lab": {
"en":
"This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.",
"ar":
"خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية."
},
"OrderLog": {
"en": "Order Log",
"ar": " سجل الطلبات"
"info-radiology": {
"en":
"This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.",
"ar":
"خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل."
},
"ServiceInformationButton":{"en":"LOGIN / REGISTER","ar":"دخول / تسجيل"},
"ServiceInformationTitle":{"en":"Service Information","ar":"معلومات الخدمة"},
"info-lab": {
"en": "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.",
"ar": "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية."
"TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"},
"Beforeusing": {
"en": "Before using the checkup, please read Terms of Service.",
"ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة"
},
"info-radiology": {
"en": "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.",
"ar": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل."
"accept": {
"en": "I read and accept Terms of Service and Privacy Policy",
"ar": "قرأت ووافقت على شروط الخدمة وسياسة الخصوصية"
},
"data-safe-info": {
"en":
"Information that you provide is anonymous and not shared with anyone.",
"ar": "المعلومات التي تقدمها لا تتم مشاركتها مع أي شخص"
},
"data-safe": {"en": " Your data is safe.", "ar": "بياناتك آمنة"},
"informational": {
"en":
"Checkup is for informational purposes and is not a qualified medical opinion",
"ar": "الفحص هو لأغراض معلوماتية وليس رأي طبي مؤهل"
},
"not-use-in-emerbency": {
"en": "Do not use in emergencies.",
"ar": "لا تستخدم في حالات الطوارئ"
},
"not-use-in-emerbency-details": {
"en": "In case of health emergency, ",
"ar": "في حالة الطوارئ اتصل بأقرب رقم للطوارئ على الفور"
},
"not-use-in-emerbency-details-call": {
"en": "call the nearest emergency number immediately",
"ar": " اتصل بأقرب رقم للطوارئ على الفور"
},
"check-diagnosis": {
"en": "Checkup is not a diagnosis.",
"ar": "الفحص ليس تشخيص."
},
"remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"},
// pharmacy module
"medicationRefill": {
@ -650,4 +688,17 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "Best Sellers",
"ar": "أفضل البائعين"
},
"deleteAllItems": {
"en": "Delete All Items",
"ar": "حذف كافة العناصر"
},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {
"en": "Drag point to change your age",
"ar": "اسحب لتغيير عمرك"
},
};

@ -16,3 +16,4 @@ const USER_LONG = 'user-long';
const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING';
const IS_SEARCH_APPO = 'is-search-appo';
const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment';
const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited';

@ -1,4 +1,4 @@
enum OrderService { AMBULANCE }
enum OrderService { AMBULANCE,HOME_HEALTH_CARE,Comprehensive_Medical_Checkup }
extension SelectedOrderService on OrderService {
int getIdOrderService() {
@ -6,6 +6,13 @@ extension SelectedOrderService on OrderService {
case OrderService.AMBULANCE:
return 4;
break;
case OrderService.Comprehensive_Medical_Checkup:
return 3;
break;
case OrderService.HOME_HEALTH_CARE:
return 2;
break;
}
return 4;
}
@ -15,6 +22,12 @@ extension SelectedOrderService on OrderService {
case 4:
return OrderService.AMBULANCE;
break;
case 2:
return OrderService.HOME_HEALTH_CARE;
break;
case 3:
return OrderService.Comprehensive_Medical_Checkup;
break;
}
return OrderService.AMBULANCE;

@ -18,7 +18,7 @@ class PatientERInsertPresOrderRequestModel {
double longitude;
int createdBy;
int orderServiceID;
List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =List();
List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = List();
PatientERInsertPresOrderRequestModel(
{this.versionID,
@ -38,6 +38,7 @@ class PatientERInsertPresOrderRequestModel {
this.longitude,
this.createdBy,
this.orderServiceID,
this.patientERHHCInsertServicesList
});
PatientERInsertPresOrderRequestModel.fromJson(Map<String, dynamic> json) {

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

@ -1,4 +1,4 @@
import 'Customer.dart';
import '../pharmacies/Customer.dart';
class Reviews {
int id;

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart';
@ -99,4 +100,16 @@ class CMCService extends BaseService {
super.error = error;
}, body: updatePresOrderRequestModel.toJson());
}
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
hasError = false;
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: order.toJson());
}
}

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
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 '../base_service.dart';
@ -68,8 +69,7 @@ class HomeHealthCareService extends BaseService {
}, body: body);
}
Future updateHHCPresOrder(
UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false;
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
@ -79,4 +79,15 @@ class HomeHealthCareService extends BaseService {
super.error = error;
}, body: updatePresOrderRequestModel.toJson());
}
Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async {
hasError = false;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: order.toJson());
}
}

@ -142,7 +142,6 @@ class BaseAppClient {
get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
Map<String, String> queryParams}) async {
String url = BASE_URL + endPoint;
if (queryParams != null) {
@ -156,7 +155,7 @@ class BaseAppClient {
final response = await http.get(url.trim(), headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
});
},);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");

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

@ -1,7 +1,8 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy_module/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy_module/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy_module/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PharmacyModuleService extends BaseService {
@ -12,6 +13,7 @@ class PharmacyModuleService extends BaseService {
List<PharmacyImageObject> bannerItems = List();
List<Manufacturer> manufacturerList = List();
List<PharmacyProduct> bestSellerProducts = List();
List<PharmacyProduct> lastVisitedProducts = List();
Future getBannerListList() async {
hasError = false;
@ -69,4 +71,27 @@ class PharmacyModuleService extends BaseService {
throw error;
}
}
Future getLastVisitedProducts() async {
String lastVisited = "";
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
null) {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try {
await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
lastVisitedProducts.clear();
response['products'].forEach((item) {
lastVisitedProducts.add(PharmacyProduct.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
} catch (error) {
throw error;
}
}
}
}

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
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_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_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';
@ -34,7 +36,7 @@ class CMCViewModel extends BaseViewModel {
.getCMCAllServices();
CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD);
await getCheckupItems(cMCGetItemsRequestModel);
await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel,isFirst: true);
if (_cMCService.hasError) {
error = _cMCService.error;
setState(ViewState.Error);
@ -42,13 +44,16 @@ class CMCViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future getCheckupItems(CMCGetItemsRequestModel cMCGetItemsRequestModel) async {
await _cMCService
.getCheckupItems(cMCGetItemsRequestModel);
Future getCheckupItems({CMCGetItemsRequestModel cMCGetItemsRequestModel, bool isFirst = false}) async {
if(!isFirst)
setState(ViewState.Busy);
await _cMCService.getCheckupItems(cMCGetItemsRequestModel);
if (_cMCService.hasError) {
error = _cMCService.error;
setState(ViewState.Error);
}
if(!isFirst)
setState(ViewState.Idle);
}
Future getCmcAllPresOrders() async {
@ -89,4 +94,17 @@ class CMCViewModel extends BaseViewModel {
await _cMCService
.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel);
}
//TODO check it in uat
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
setState(ViewState.Busy);
order.createdBy = user.patientID;
order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService();
await _cMCService.insertPresPresOrder(order: order);
if (_cMCService.hasError) {
error = _cMCService.error;
setState(ViewState.ErrorLocal);
} else {
getCmcAllPresOrders();
}
}
}

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.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';
@ -5,6 +6,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
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/service/AlHabibMedicalService/home_health_care_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
@ -65,8 +67,7 @@ class HomeHealthCareViewModel extends BaseViewModel {
}
}
Future updateHHCPresOrder(
UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
setState(ViewState.Busy);
await _homeHealthCareService.updateHHCPresOrder(
updatePresOrderRequestModel);
@ -78,6 +79,19 @@ class HomeHealthCareViewModel extends BaseViewModel {
}
}
Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async {
setState(ViewState.Busy);
order.createdBy = user.patientID;
order.orderServiceID = OrderService.HOME_HEALTH_CARE.getIdOrderService();
await _homeHealthCareService.insertPresPresOrder(order: order);
if (_homeHealthCareService.hasError) {
error = _homeHealthCareService.error;
setState(ViewState.ErrorLocal);
} else {
getHHCAllPresOrders();
}
}
}

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

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy_module/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy_module/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy_module/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
@ -14,7 +14,11 @@ class PharmacyModuleViewModel extends BaseViewModel {
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
List<PharmacyProduct> get bestSellerProduct => _pharmacyService.bestSellerProducts;
List<PharmacyProduct> get bestSellerProduct =>
_pharmacyService.bestSellerProducts;
List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts;
Future getPharmacyHomeData() async {
setState(ViewState.Busy);
@ -49,6 +53,16 @@ class PharmacyModuleViewModel extends BaseViewModel {
_getBestSellerProducts() async {
await _pharmacyService.getBestSellerProducts();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
_getLastVisitedProducts();
}
}
_getLastVisitedProducts() async {
await _pharmacyService.getLastVisitedProducts();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);

@ -42,6 +42,7 @@ import 'core/service/medical/prescriptions_service.dart';
import 'core/service/medical/radiology_service.dart';
import 'core/service/medical/reports_monthly_service.dart';
import 'core/service/medical/vital_sign_service.dart';
import 'core/service/parmacyModule/order-preview-service.dart';
import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'core/service/parmacyModule/parmacy_module_service.dart';
@ -83,6 +84,7 @@ import 'core/viewModels/pharmacies_view_model.dart';
import 'core/service/pharmacies_service.dart';
import 'core/service/insurance_service.dart';
import 'core/viewModels/insurance_card_View_model.dart';
import 'core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'core/viewModels/pharmacy_categorise_view_model.dart';
import 'core/viewModels/qr_view_model.dart';
@ -118,6 +120,7 @@ void setupLocator() {
locator.registerLazySingleton(() => HomeHealthCareService());
locator.registerLazySingleton(() => CMCService());
locator.registerLazySingleton(() => PatientSickLeaveService());
locator.registerLazySingleton(() => MyBalanceService());
locator.registerLazySingleton(() => BloodSugarService());
@ -145,6 +148,8 @@ void setupLocator() {
locator.registerLazySingleton(() => OffersCategoriseService());
locator.registerLazySingleton(() => PharmacyModuleService());
locator.registerLazySingleton(() => OrderPreviewService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -176,6 +181,8 @@ void setupLocator() {
locator.registerFactory(() => UserInformationViewModel());
locator.registerFactory(() => VaccinationTableViewModel());
locator.registerFactory(() => AddNewChildViewModel());
locator.registerFactory(() => H2OViewModel());
locator.registerFactory(() => BloodSugarViewMode());
@ -189,7 +196,11 @@ void setupLocator() {
locator.registerFactory(() => HomeHealthCareViewModel());
locator.registerFactory(() => CMCViewModel());
locator.registerFactory(() => PharmacyModuleViewModel());
locator.registerFactory(() => OrderPreviewViewModel());
//pharmacy
locator.registerFactory(() => PharmacyCategoriseViewModel());

@ -54,6 +54,7 @@ class MyApp extends StatelessWidget {
const Locale('en', ''), // English
],
theme: ThemeData(
fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
@ -66,8 +67,7 @@ class MyApp extends StatelessWidget {
hintColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor:
HexColor('#E9E9E9'), // Colors.grey[100],
scaffoldBackgroundColor: HexColor('#E9E9E9'), // Colors.grey[100],
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,

@ -4,14 +4,18 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'new_cmc_step_one_page.dart';
import 'new_cmc_step_three_page.dart';
import 'new_cmc_step_tow_page.dart';
class NewCMCPage extends StatefulWidget {
NewCMCPage({this.model});
@ -27,7 +31,9 @@ class _NewCMCPageState extends State<NewCMCPage>
with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 1;
int pageSelected = 2;
double _latitude;
double _longitude;
CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
@ -54,6 +60,18 @@ class _NewCMCPageState extends State<NewCMCPage>
: []);
_controller = new PageController();
_getCurrentLocation();
}
_getCurrentLocation() async {
await getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
}
@override
@ -94,216 +112,230 @@ class _NewCMCPageState extends State<NewCMCPage>
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.8,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
widget.model.cmcAllOrderDetail.length != 0
? FractionallySizedBox(
heightFactor: 0.8,
widthFactor: 0.9,
child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border:
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
child: Column(
children: [
Container(
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
),
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
widget.model.cmcAllOrderDetail.length != 0
? FractionallySizedBox(
heightFactor: 0.8,
widthFactor: 0.9,
child: Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
border:
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"Request ID",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.cmcAllOrderDetail[0].iD.toString(),
fontSize: 22,
height: 12,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Request ID",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.cmcAllOrderDetail[0].iD.toString(),
fontSize: 22,
),
],
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Status",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
"Pending",
fontSize: 22,
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Status",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
"Pending",
fontSize: 22,
),
],
),
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Pickup Date",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
widget.model.cmcAllOrderDetail[0]
.createdOn)),
fontSize: 22,
),
],
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Pickup Date",
bold: false,
fontSize: 13,
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Service Name",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.cmcAllOrderDetail[0].description
.toString() ??
widget.model.cmcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
),
],
),
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
widget.model.cmcAllOrderDetail[0]
.createdOn)),
fontSize: 22,
height: 12,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: "Cancel".toUpperCase(),
onTap: () {
showConfirmMessage(widget.model,
widget.model.cmcAllOrderDetail[0]);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Service Name",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.cmcAllOrderDetail[0].description
.toString() ??
widget.model.cmcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
height: 12,
),
],
),
),
SizedBox(
height: 12,
),
Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: "Cancel".toUpperCase(),
onTap: () {
showConfirmMessage(widget.model,
widget.model.cmcAllOrderDetail[0]);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
),
),
SizedBox(
height: 12,
),
],
),
)
: NewCMCStepOnePage(
changePageViewIndex: changePageViewIndex,
cMCInsertPresOrderRequestModel:
cMCInsertPresOrderRequestModel,
model: widget.model,
),
NewCMCStepTowPage(
longitude: _longitude,
latitude: _latitude,
changePageViewIndex: changePageViewIndex,
cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel,
model: widget.model,
), NewCMCStepThreePage(
changePageViewIndex: changePageViewIndex,
cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel,
model: widget.model,
),
],
),
)
: NewCMCStepOnePage(
changePageViewIndex: changePageViewIndex,
cMCInsertPresOrderRequestModel:
cMCInsertPresOrderRequestModel,
model: widget.model,
),
// NewEReferralStepTowPage(
// changePageViewIndex: changePageViewIndex,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
//
// ),
// NewEReferralStepThreePage(
// changePageViewIndex: changePageViewIndex,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
//
// ),
],
),
),

@ -20,12 +20,10 @@ class NewCMCStepOnePage extends StatefulWidget {
: super(key: key);
@override
_NewCMCStepOnePageState createState() =>
_NewCMCStepOnePageState();
_NewCMCStepOnePageState createState() => _NewCMCStepOnePageState();
}
class _NewCMCStepOnePageState
extends State<NewCMCStepOnePage> {
class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
@override
void initState() {
super.initState();
@ -34,176 +32,200 @@ class _NewCMCStepOnePageState
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.all(12),
child: Center(
child: Column(
children: [
FractionallySizedBox(
widthFactor: 0.94,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
),
Texts(
// TranslationBase.of(context).advancePaymentLabel,
"Select Home Health Care Services",
textAlign: TextAlign.center,
),
Column(
children: widget.model.cmcAllServicesList.map((
service) {
return Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border:
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
Row(
children: [
Radio(
isShowAppBar: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.all(12),
child: Center(
child: Column(
children: [
FractionallySizedBox(
widthFactor: 0.94,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
),
Texts(
"Select Home Health Care Services",
textAlign: TextAlign.center,
),
Column(
children:
widget.model.cmcAllServicesList.map((service) {
return Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border:
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
Row(
children: [
Radio(
value: service.serviceID,
activeColor: Colors.red[800],
onChanged: (newValue) async {
PatientERCMCInsertServicesList patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList(
price: service.price,
serviceID: service.serviceID
.toString(),
selectedServiceName: service
.description,
selectedServiceNameAR:
service.description,
recordID: 1,
totalPrice: service.totalPrice,
vAT: service.vAT);
PatientERCMCInsertServicesList
patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList(
price: service.price,
serviceID: service.serviceID
.toString(),
selectedServiceName:
service.description,
selectedServiceNameAR:
service.description,
recordID: 1,
totalPrice:
service.totalPrice,
vAT: service.vAT);
setState(() {
widget
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList =
[patientERCMCInsertServicesList];
.patientERCMCInsertServicesList = [
patientERCMCInsertServicesList
];
});
CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel (checkupType:newValue );
await widget.model.getCheckupItems(cMCGetItemsRequestModel);
CMCGetItemsRequestModel
cMCGetItemsRequestModel =
new CMCGetItemsRequestModel(
checkupType: newValue);
await widget.model.getCheckupItems(
cMCGetItemsRequestModel:
cMCGetItemsRequestModel);
},
groupValue: widget
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList.length >0?int.parse(widget
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList[0]
.serviceID):1),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
service.description,
fontSize: 15,
),
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList
.length >
0
? int.parse(widget
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList[
0]
.serviceID)
: 1),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
service.description,
fontSize: 15,
),
),
],
),
],
),
);
}).toList(),
),
],
),
),
SizedBox(height: 30,),
Container(
color: Colors.white,
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.model.checkupItems.map((item) {
return Center(
child: FractionallySizedBox(
widthFactor: 0.8,
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border:
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 5, top: 5),
decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
item.itemName,
fontSize: 15,
),
],
),
),
SizedBox(
height: 12,
),
],
),
),
],
),
);
}).toList()),
)
],
),
}).toList(),
),
],
),
),
SizedBox(
height: 30,
),
Container(
color: Colors.white,
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.model.checkupItems.map((item) {
return Center(
child: FractionallySizedBox(
widthFactor: 1,
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 5, top: 5),
decoration: BoxDecoration(
border: BorderDirectional(
bottom: BorderSide(
style: BorderStyle.solid,
width: 0.5,
color: Colors.grey)),
//borderRadius: ,
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
item.itemName,
fontSize: 15,
),
],
),
),
SizedBox(
height: 12,
),
],
),
),
),
);
}).toList()),
)
],
),
),
),
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(
label: "Next",
// disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length ==0,
textColor: Theme
.of(context)
.backgroundColor),
),
],
),
));
}
),
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(
label: "Next",
textColor: Theme.of(context).backgroundColor,
onTap: () {
if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) {
int index = widget.model.cmcAllServicesList.length;
PatientERCMCInsertServicesList
patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList(
price: widget.model.cmcAllServicesList[index-1].price,
serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(),
selectedServiceName: widget.model.cmcAllServicesList[index-1].description,
selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description,
recordID: 1,
totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice,
vAT: widget.model.cmcAllServicesList[index-1].vAT);
widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = [
patientERCMCInsertServicesList
];
widget.changePageViewIndex(1);
}
},
),
),
],
),
),
);
}
}

@ -0,0 +1,165 @@
import 'dart:async';
import 'package:diplomaticquarterapp/core/enum/viewstate.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/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class NewCMCStepThreePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
final Function changePageViewIndex;
final CMCViewModel model;
NewCMCStepThreePage(
{Key key,
this.changePageViewIndex,
this.model,
this.cmcInsertPresOrderRequestModel});
@override
_NewCMCStepThreePageState createState() =>
_NewCMCStepThreePageState();
}
class _NewCMCStepThreePageState
extends State<NewCMCStepThreePage> {
Completer<GoogleMapController> _controller = Completer();
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
final Set<Marker> markers = new Set();
@override
void initState() {
if (widget.cmcInsertPresOrderRequestModel.latitude != null) {
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
widget.cmcInsertPresOrderRequestModel.latitude.hashCode
.toString(),
),
position: LatLng(
widget.cmcInsertPresOrderRequestModel.latitude,
widget.cmcInsertPresOrderRequestModel.longitude)),
);
_kGooglePlex = CameraPosition(
target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude,
widget.cmcInsertPresOrderRequestModel.longitude),
zoom: 14.4746,
);
}
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowDecPage: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
height: 400,
width: double.maxFinite,
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Order Details'),
SizedBox(
height: 12,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Location :'),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
height: 200,
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
),
),
SizedBox(
height: 12,
),
Texts('Selected Service :'),
...List.generate(
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Service Name :',
fontSize: 12,
),
SizedBox(
height: 5,
),
Texts(
widget
.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index]
.selectedServiceName,
fontSize: 15,
bold: true,
),
],
),
),
)
],
),
)
],
),
),
),
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(
label: "Confirm",
onTap: () async {
await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) {
widget.changePageViewIndex(0);
}
},
textColor: Theme.of(context).backgroundColor),
),
],
),
),
);
}
}

@ -0,0 +1,113 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
class NewCMCStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
final Function changePageViewIndex;
final CMCViewModel model;
const NewCMCStepTowPage(
{Key key,
this.onPick,
this.latitude,
this.longitude,
this.cmcInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model})
: super(key: key);
@override
_NewCMCStepTowPageState createState() =>
_NewCMCStepTowPageState();
}
class _NewCMCStepTowPageState
extends State<NewCMCStepTowPage> {
double latitude = 0;
double longitude = 0;
@override
void initState() {
if (widget.cmcInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude;
longitude = widget.longitude;
} else {
latitude = widget.cmcInsertPresOrderRequestModel.latitude;
longitude = widget.cmcInsertPresOrderRequestModel.longitude;
}
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.cmcInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.cmcInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).next,
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: true,
),
);
}
}

@ -1,5 +1,3 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart';
import 'package:flutter/material.dart';
@ -8,7 +6,6 @@ import 'new_e_referral_step_three_page.dart';
import 'new_e_referral_step_two_page.dart';
class StartIndexForNewEReferral extends StatefulWidget {
StartIndexForNewEReferral();
@override
@ -22,8 +19,8 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
int _currentIndex = 1;
int pageSelected = 2;
CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel();
CreateEReferralRequestModel createEReferralRequestModel =
new CreateEReferralRequestModel();
@override
void initState() {
@ -46,7 +43,7 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
body: SafeArea(
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height,
height: MediaQuery.of(context).size.height * 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
@ -64,12 +61,10 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
NewEReferralStepTowPage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepThreePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
],
),

@ -95,7 +95,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
margin: EdgeInsets.all(12),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.94,
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

@ -6,8 +6,11 @@ import 'package:diplomaticquarterapp/pages/base/base_view.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/pickupLocation/PickupLocationFromMap.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
class NewHomeHealthCareStepOnePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel
@ -27,135 +30,148 @@ class NewHomeHealthCareStepOnePage extends StatefulWidget {
_NewHomeHealthCareStepOnePageState();
}
class _NewHomeHealthCareStepOnePageState
extends State<NewHomeHealthCareStepOnePage> {
@override
void initState() {
if(widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList==null)
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = [];
class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOnePage> {
PickResult _result;
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null)
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = [];
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: Center(
child: FractionallySizedBox(
widthFactor: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Texts(
"Select Home Health Care Services",
textAlign: TextAlign.center,
),
Column(
children: widget.model.hhcAllServicesList.map((service) {
return Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
Row(
children: [
Checkbox(
value: isServiceSelected(
service.serviceID),
activeColor: Colors.black38,
onChanged: (bool newValue) {
setState(() {
if(!isServiceSelected(service.serviceID))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add( PatientERHHCInsertServicesList(
recordID:widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
serviceID: service.serviceID,
serviceName: service.description));
else
removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel
// isPatientInsured = newValue;
});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
service.description,
fontSize: 15,
),
isShowAppBar: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: Center(
child: FractionallySizedBox(
widthFactor: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Texts(
"Select Home Health Care Services",
textAlign: TextAlign.center,
),
Column(
children: widget.model.hhcAllServicesList.map((service) {
return Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
Row(
children: [
Checkbox(
value: isServiceSelected(service.serviceID),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
setState(() {
if (!isServiceSelected(
service.serviceID))
widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.add(PatientERHHCInsertServicesList(
recordID: widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length,
serviceID: service.serviceID,
serviceName:
service.description));
else
removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel
// isPatientInsured = newValue;
});
}),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
service.description,
fontSize: 15,
),
),
],
),
],
),
);
}).toList(),
)
],
),
),
],
),
],
),
);
}).toList(),
)
],
),
),
),
),
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(
label: "Next",
disabled: this
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length ==
0,
textColor: Theme.of(context).backgroundColor),
),
],
),
));
),
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(
label: "Next",
disabled: this
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length == 0,
onTap: (){
widget.changePageViewIndex(1);
},
textColor: Theme.of(context).backgroundColor),
),
],
),
),
);
}
isServiceSelected(int serviceId) {
Iterable <PatientERHHCInsertServicesList> patientERHHCInsertServicesList = widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
if(patientERHHCInsertServicesList.length > 0) {
return true;
}
return false;
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
if (patientERHHCInsertServicesList.length > 0) {
return true;
}
return false;
}
removeSelected(int serviceId){
Iterable <PatientERHHCInsertServicesList> patientERHHCInsertServicesList = widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
removeSelected(int serviceId) {
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
if(patientERHHCInsertServicesList.length > 0)
if (patientERHHCInsertServicesList.length > 0)
setState(() {
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.remove(patientERHHCInsertServicesList);
widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.remove(patientERHHCInsertServicesList.first);
});
}
}

@ -0,0 +1,172 @@
import 'dart:async';
import 'package:diplomaticquarterapp/core/enum/viewstate.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/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class NewHomeHealthCareStepThreePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel
patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final HomeHealthCareViewModel model;
NewHomeHealthCareStepThreePage(
{Key key,
this.patientERInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model});
@override
_NewHomeHealthCareStepThreePageState createState() =>
_NewHomeHealthCareStepThreePageState();
}
class _NewHomeHealthCareStepThreePageState
extends State<NewHomeHealthCareStepThreePage> {
Completer<GoogleMapController> _controller = Completer();
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
final Set<Marker> markers = new Set();
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude != null) {
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
widget.patientERInsertPresOrderRequestModel.latitude.hashCode
.toString(),
),
position: LatLng(
widget.patientERInsertPresOrderRequestModel.latitude,
widget.patientERInsertPresOrderRequestModel.longitude)),
);
_kGooglePlex = CameraPosition(
target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude,
widget.patientERInsertPresOrderRequestModel.longitude),
zoom: 14.4746,
);
}
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowDecPage: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
width: double.maxFinite,
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Order Details'),
SizedBox(
height: 12,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Location :'),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
height: 200,
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
),
),
SizedBox(
height: 12,
),
Texts('Selected Service :'),
...List.generate(
widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Service Name :',
fontSize: 12,
),
SizedBox(
height: 5,
),
Texts(
widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList[index]
.serviceName,
fontSize: 15,
bold: true,
),
],
),
),
)
],
),
),
SizedBox(
height: 57,
),
],
),
),
),
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(
label: "Confirm",
disabled: widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList.length ==
0,
onTap: () async {
await widget.model.insertPresPresOrder(
order: widget.patientERInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) {
widget.changePageViewIndex(0);
}
},
textColor: Theme.of(context).backgroundColor),
),
],
),
),
);
}
}

@ -0,0 +1,112 @@
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/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
class NewHomeHealthCareStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final PatientERInsertPresOrderRequestModel
patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final HomeHealthCareViewModel model;
const NewHomeHealthCareStepTowPage(
{Key key,
this.onPick,
this.latitude,
this.longitude,
this.patientERInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model})
: super(key: key);
@override
_NewHomeHealthCareStepTowPageState createState() =>
_NewHomeHealthCareStepTowPageState();
}
class _NewHomeHealthCareStepTowPageState
extends State<NewHomeHealthCareStepTowPage> {
double latitude = 0;
double longitude = 0;
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude;
longitude = widget.longitude;
} else {
latitude = widget.patientERInsertPresOrderRequestModel.latitude;
longitude = widget.patientERInsertPresOrderRequestModel.longitude;
}
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientERInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.patientERInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).next,
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: true,
),
);
}
}

@ -4,12 +4,15 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import '../StepsWidget.dart';
import 'new_Home_health_care_step_one_page.dart';
@ -18,7 +21,6 @@ class NewHomeHealthCarePage extends StatefulWidget {
NewHomeHealthCarePage({this.model});
final HomeHealthCareViewModel model;
@override
_NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState();
}
@ -27,7 +29,8 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 1;
int pageSelected = 2;
double _latitude;
double _longitude;
PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel =
new PatientERInsertPresOrderRequestModel();
@ -36,8 +39,19 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
void initState() {
super.initState();
_controller = new PageController();
_getCurrentLocation();
}
_getCurrentLocation() async {
await getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
}
@override
void dispose() {
super.dispose();
@ -285,6 +299,18 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model,
),
NewHomeHealthCareStepTowPage(
latitude: _latitude,
longitude: _longitude,
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model,
),
NewHomeHealthCareStepThreePage(
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model,
)
],
),

@ -13,7 +13,7 @@ class StepsWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return projectViewModel.isArabic? Stack(
return !projectViewModel.isArabic? Stack(
children: [
Container(
height: 50,

@ -1,35 +1,32 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart';
import 'package:diplomaticquarterapp/pages/Blood/advance_payment_page.dart';
import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.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:diplomaticquarterapp/widgets/data_display/services)contaniner.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'h2o/h2o_page.dart';
class AllHabibMedicalService extends StatefulWidget {
@override
@ -37,6 +34,17 @@ class AllHabibMedicalService extends StatefulWidget {
}
class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser = new AuthenticatedUser();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getAuthUser();
});
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -177,7 +185,10 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: EReferralIndexPage()),
FadePage(
page: authUser.patientID == null
? EReferralIndexPage()
: EReferralPage()),
),
imageLocation: 'assets/images/ereferral_service_icon.png',
title: 'E-Referral',
@ -214,8 +225,9 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
title: TranslationBase.of(context).todoList,
),
ServicesContainer(
onTap: () => Navigator.of(context).pushNamed(
SYMPTOM_CHECKER,
onTap: () => Navigator.push(
context,
FadePage(page: SymptomInfo()),
),
imageLocation: 'assets/images/new-design/body_icon.png',
title: 'Symptom Checker'),
@ -315,4 +327,15 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
),
);
}
getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
print(authUser.patientID);
}
}
}

@ -235,7 +235,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
return children;
},
),
onDaySelected: (date, events,holidays) {
onDaySelected: (date, events,format) {
_onDaySelected(date, events);
_animationController.forward(from: 0.0);
},
@ -385,8 +385,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.brown[300]
: Colors.blue[400],
? Colors.brown[300]
: Colors.blue[400],
),
width: 40.0,
height: 40.0,

@ -348,8 +348,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
return children;
},
),
onDaySelected: (date, events,holidays) {
_onDaySelected(date, events);
onDaySelected: (date, event,formats) {
_onDaySelected(date, event,);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,

@ -63,7 +63,6 @@ class _PickupLocationState extends State<PickupLocation> {
_longitude = 0;
_latitude = 0;
});
// currentLocation = LatLng(position.latitude, position.longitude);
}
@override
@ -364,7 +363,6 @@ class _PickupLocationState extends State<PickupLocation> {
),
],
),
//TODO show dialog projects
SizedBox(
height: 45,

@ -172,7 +172,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
physics: NeverScrollableScrollPhysics(),
children: [
AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton),
DocAvailableAppointments(doctor: getDoctorObject())
DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment)
],
controller: _tabController,
),

@ -139,7 +139,7 @@ class _ToDoState extends State<ToDo> {
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 20.0, left: 20.0, right: 20.0),
top: 10.0, left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,

@ -1,5 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
@ -69,7 +68,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
child: Container(
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("SADAD");
updateSelectedPaymentMethod("VISA");
},
child: Card(
elevation: 3.0,
@ -77,7 +76,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "SADAD"
side: selectedPaymentMethod == "VISA"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
@ -88,12 +87,41 @@ class _PaymentMethodState extends State<PaymentMethod> {
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/sadad.png"),
"assets/images/new-design/visa.png"),
),
),
),
),
),
// Expanded(
// child: Container(
// child: InkWell(
// onTap: () {
// updateSelectedPaymentMethod("SADAD");
// },
// child: Card(
// elevation: 3.0,
// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: selectedPaymentMethod == "SADAD"
// ? BorderSide(
// color: Colors.green, width: 5.0)
// : BorderSide(
// color: Colors.transparent, width: 0.0),
// ),
// child: Container(
// height: 120.0,
// padding: EdgeInsets.all(7.0),
// width: MediaQuery.of(context).size.width * 0.45,
// child: Image.asset(
// "assets/images/new-design/sadad.png"),
// ),
// ),
// ),
// ),
// ),
],
),
),
@ -102,35 +130,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("VISA");
},
child: Card(
elevation: 3.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "VISA"
? BorderSide(
color: Colors.green, width: 5.0)
: BorderSide(
color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(
"assets/images/new-design/visa.png"),
),
),
),
),
),
Expanded(
child: Container(
child: InkWell(
@ -160,14 +159,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
child: InkWell(
@ -200,6 +191,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
],
),
),
Container(
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[],
),
),
],
),
),

@ -24,7 +24,7 @@ class _PaymentDialogState extends State<PaymentDialog> {
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container(
height: MediaQuery.of(context).size.height * 0.67,
height: 510.0,
width: 450.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacyModule/pharmacy_module_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -103,10 +104,10 @@ class _HomePageState extends State<HomePage> {
top: 15.0,
left: 3.5,
right: 3.5),
// child: SvgPicture.asset(
// 'assets/images/new-design/covid-19-car.svg',
// width: 45.0,
// height: 45.0),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 45.0,
height: 45.0),
),
Container(
margin: EdgeInsets.only(
@ -180,11 +181,11 @@ class _HomePageState extends State<HomePage> {
.withOpacity(0.3),
borderRadius: BorderRadius.all(
Radius.circular(5))),
// child: SvgPicture.asset(
// projectViewModel.isArabic
// ? 'assets/images/new-design/livecare_arabic_logo.svg'
// : 'assets/images/new-design/liveCare_white_logo.svg',
// ),
child: SvgPicture.asset(
projectViewModel.isArabic
? 'assets/images/new-design/livecare_arabic_logo.svg'
: 'assets/images/new-design/liveCare_white_logo.svg',
),
),
),
),
@ -483,6 +484,8 @@ class _HomePageState extends State<HomePage> {
opacity: 0.5,
),
DashboardItem(
onTap: () => Navigator.push(context, FadePage(page: PharmacyPage())),
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
@ -515,7 +518,7 @@ class _HomePageState extends State<HomePage> {
),
),
DashboardItem(
onTap: () {
onTap: (){
Navigator.push(
context,
FadePage(
@ -829,10 +832,8 @@ class DashboardItem extends StatelessWidget {
? DecorationImage(
image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover,
colorFilter: hasColorFilter
? new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn)
: null,
colorFilter: hasColorFilter ? new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn) : null,
)
: null,
),

@ -123,7 +123,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
AppGlobal.context = context;
});
_requestIOSPermissions();
pageController = PageController(keepPage: true);
pageController = PageController(keepPage: true);
// _firebaseMessaging.setAutoInitEnabled(true);
//
// if (Platform.isIOS) {

@ -36,13 +36,13 @@ class _State extends State<ClinicCard> {
return Row(
children: <Widget>[
Card(
margin: EdgeInsets.fromLTRB(13.0, 10.0, 8.0, 8.0),
margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0),
color: widget.isSelected ? Colors.blue : Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
width: MediaQuery.of(context).size.width * 0.75,
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -17,8 +17,11 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -81,7 +84,13 @@ class _clinic_listState extends State<ClinicList> {
service
.getERAppointmentFees(selectedClinicID, context)
.then((res) {
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res);
if (res['HasAppointment'] == true) {
isError = true;
showLiveCareCancelDialog(res['ErrorEndUserMessage'], res);
} else {
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res);
isError = false;
}
})
.catchError((err) {
print(err);
@ -97,10 +106,57 @@ class _clinic_listState extends State<ClinicList> {
});
}
showLiveCareCancelDialog(String msg, res) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: msg,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () =>
{cancelAppointment(res)},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
cancelAppointment(res) {
AppoitmentAllHistoryResultList appo = AppoitmentAllHistoryResultList();
appo.clinicID = res['ClinicID'];
appo.doctorID = res['DoctorID'];
appo.endTime = res['EndTime'];
appo.projectID = res['ProjectID'];
appo.startTime = res['StrAppointmentDate'];
appo.appointmentNo = res['AppointmentID'];
appo.isLiveCareAppointment = true;
appo.originalClinicID = 0;
appo.originalProjectID = res['ProjectID'];
appo.appointmentDate = res['AppointmentDate'];
ConfirmDialog.closeAlertDialog(context);
DoctorsListService service = new DoctorsListService();
service
.cancelAppointment(appo, context)
.then((res) {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
startLiveCare();
});
}
getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) {
LiveCareService service = new LiveCareService();
service.getERAppointmentTime(selectedClinicID, context).then((res) {
print(res['WatingtimeInteger']);
print(res);
showLiveCarePaymentDialog(
getERAppointmentFeesList, res['WatingtimeInteger']);
}).catchError((err) {

@ -247,8 +247,8 @@ class ConfirmPaymentPage extends StatelessWidget {
DoctorsListService service = new DoctorsListService();
service
.checkPaymentStatus(
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
Utils.getAdvancePaymentTransID(
appo.projectID, authenticatedUser.patientID),
AppGlobal.context)
.then((res) {
print("Printing Payment Status Reponse!!!!");
@ -302,5 +302,4 @@ class ConfirmPaymentPage extends StatelessWidget {
Future navigateToHome(context) async {
Navigator.of(context).pushNamed(HOME);
}
}

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart';
import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart';
@ -407,10 +408,10 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
onTap: () {
Navigator.push(
context, FadePage(page: SmartWatchInstructions()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context)
.smartWatches,

@ -0,0 +1,145 @@
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class HealthDataList extends StatefulWidget {
@override
_HealthDataListState createState() => _HealthDataListState();
}
class _HealthDataListState extends State<HealthDataList> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "Smartwatches",
isShowAppBar: true,
body: Container(
height: MediaQuery.of(context).size.height,
margin: EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Heart Rate",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/sleep_data.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Sleep Data",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Steps",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Distance",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Energy",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
Divider(
color: Colors.grey[500],
),
],
),
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.1,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(
color: Colors.transparent,
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () {
// launch(model.radImageURL);
},
label: 'Sync Health Data',
backgroundColor: Colors.grey[800],
),
),
],
),
));
}
}

@ -0,0 +1,819 @@
import 'dart:io';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart';
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:url_launcher/url_launcher.dart';
class SmartWatchInstructions extends StatefulWidget {
@override
_SmartWatchInstructionsState createState() => _SmartWatchInstructionsState();
}
class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
CarouselController buttonCarouselController = CarouselController();
bool hasAlreadySynced = false;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getLastPatientRecord(context);
});
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "Sync Health Data",
isShowAppBar: true,
body: Container(
child: Platform.isIOS
? _getAppleWatchInstructions()
: _getGoogleWatchInstructions(),
));
}
_getAppleWatchInstructions() {
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(
enableInfiniteScroll: false,
viewportFraction: 0.95,
height: MediaQuery.of(context).size.height * 0.9),
items: [1, 2].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: i == 1
? Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("Supported Smartwatches",
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
fontFamily: "WorkSans")),
),
Container(
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-1.jpeg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 1",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-2.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 2",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-3.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 3",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-4.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 4",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/apple-watch-5.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 5",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/Apple-Watch-6.png",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Apple Watch Series 6",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/miBand3.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 3",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/miBand4.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 4",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.fromLTRB(
10.0, 30.0, 10.0, 10.0),
child: Text(
"It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"Before syncing data, please make sure that you have followed the instructions properly",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
buttonCarouselController.nextPage();
},
child: Text("CONTINUE",
style: TextStyle(fontSize: 18.0)),
),
),
),
],
)
: Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("Watch Instructions:",
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
fontFamily: "WorkSans")),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.fromLTRB(
10.0, 20.0, 10.0, 10.0),
child: Text(
"Before syncing data, please make sure that following instructions are met: ",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.fromLTRB(
10.0, 20.0, 10.0, 10.0),
child: Text(
"1. Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"2. Make sure that your Apple Watch is connected with the Watch & Health Apps.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"3. Make sure that data like heart rate, steps, distance etc. are being shown on your health app.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.fromLTRB(
15.0, 110.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
buttonCarouselController.nextPage();
},
child: Text("SYNC HEALTH DATA",
style: TextStyle(fontSize: 18.0)),
),
),
),
hasAlreadySynced ? Container(
margin: EdgeInsets.fromLTRB(
15.0, 0.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
_openHealthDataList();
},
child: Text("ALREADY SYNCED",
style: TextStyle(fontSize: 18.0)),
),
),
): Container(),
],
),
));
},
);
}).toList(),
),
)
],
),
);
}
_getGoogleWatchInstructions() {
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(
enableInfiniteScroll: false,
viewportFraction: 0.95,
height: MediaQuery.of(context).size.height * 0.9),
items: [1, 2].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: i == 1
? Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("Supported Smartwatches",
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
fontFamily: "WorkSans")),
),
Container(
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/huawei-watch-2.png",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Huawei Watch 2",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/ticwatche2.png",
width: 70.0,
height: 70.0),
Container(
child: Text(
"Mobovi TicWatch E2",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/huawei-watch-2-classic.png",
width: 70.0,
height: 70.0),
Container(
child: Text("Huawei Watch",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/ticwatche2.png",
width: 70.0,
height: 70.0),
Container(
child: Text("Fossil Sport",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/misfit-vapor-2.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"MisFit Vapor 2",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/lg-watch-sport.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text(
"LG Watch Sport",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/miBand3.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 3",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset(
"assets/images/SmartWatches/miBand4.jpg",
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 4",
style: TextStyle(
fontSize: 12.0)),
)
],
),
),
),
],
),
),
InkWell(
onTap: () {
launch(
"https://wearos.google.com/#find-your-watch");
},
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Text(
"More Supported Smartwatches...",
style: TextStyle(
fontSize: 17.0,
color: Colors.blue,
decoration:
TextDecoration.underline)),
),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"Before syncing data, please make sure that you have followed the instructions properly",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
buttonCarouselController.nextPage();
},
child: Text("CONTINUE",
style: TextStyle(fontSize: 18.0)),
),
),
),
],
)
: Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text("Watch Instructions:",
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
fontFamily: "WorkSans")),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"Before syncing data, please make sure that following instructions are met: ",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"2. Make sure that you have installed your watch related apps from Google PlayStore.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"4. Make sure that your smart watch apps are linked/associated with Google Fit App.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.fromLTRB(
15.0, 95.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
buttonCarouselController.nextPage();
},
child: Text("SYNC HEALTH DATA",
style: TextStyle(fontSize: 18.0)),
),
),
),
hasAlreadySynced ? Container(
margin: EdgeInsets.fromLTRB(
15.0, 0.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
_openHealthDataList();
},
child: Text("ALREADY SYNCED",
style: TextStyle(fontSize: 18.0)),
),
),
) : Container(),
],
),
));
},
);
}).toList(),
),
)
],
),
);
}
getLastPatientRecord(BuildContext context) {
SmartWatchIntegrationService service = new SmartWatchIntegrationService();
service.getLastPatientRecord(context).then((res) {
if (res['MessageStatus'] == 1) {
print(res['Med_GetPatientLastRecordList']);
setState(() {
if (res['Med_GetPatientLastRecordList'] != null)
hasAlreadySynced = true;
else
hasAlreadySynced = false;
});
} else {}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
_openHealthDataList() {
Navigator.push(
context, MaterialPageRoute(builder: (context) => HealthDataList()));
}
}

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

@ -2,13 +2,15 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacyModule/widgets/BannerPager.dart';
import 'package:diplomaticquarterapp/pages/pharmacyModule/widgets/ProductTileItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacyModule/widgets/borderedButton.dart';
import 'package:diplomaticquarterapp/pages/pharmacyModule/widgets/manufacturerItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/order-preview-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
class PharmacyPage extends StatelessWidget {
@ -82,7 +84,15 @@ class PharmacyPage extends StatelessWidget {
],
),
),
Container(),
Container(
height: model.lastVisitedProducts.length > 0 ? MediaQuery.of(context).size.height / 4 : 0,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ProductTileItem(model.lastVisitedProducts[i]),
scrollDirection: Axis.horizontal,
itemCount: model.lastVisitedProducts.length,
),
),
Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row(
@ -144,7 +154,9 @@ class GridViewButtons extends StatelessWidget {
child: GridViewCard(
TranslationBase.of(context).offersAndPromotions,
'assets/images/pharmacy_module/offer_icon.png',
() {}),
() {
Navigator.push(context, FadePage(page: OrderPreviewPage()));
}),
),
DashboardItem(
imageName: 'pharmacy_module/bg_2.png',
@ -210,7 +222,7 @@ class GridViewCard extends StatelessWidget {
Expanded(
child: BorderedButton(
TranslationBase.of(context).viewAll,
handler: () {},
handler: handler,
),
),
],

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

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

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

@ -1,4 +1,4 @@
import 'package:diplomaticquarterapp/core/model/pharmacy_module/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:flutter/material.dart';
class ManufacturerItem extends StatelessWidget {

@ -1,107 +0,0 @@
import 'package:diplomaticquarterapp/core/model/pharmacy_module/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class ProductTileItem extends StatelessWidget {
final PharmacyProduct item;
ProductTileItem(this.item);
@override
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return Card(
elevation: 2,
shape: Border(right: BorderSide(color: Colors.grey.shade300, width: 1)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 0),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center,
child: Image.network(
item.images[0].src,
fit: BoxFit.cover,
height: 80,
),
),
Container(
width: item.rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
item.rxMessage != null ? item.rxMessage : "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
)
],
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
projectProvider.isArabic ? item.name : item.namen,
regular: true,
fontSize: 12,
fontWeight: FontWeight.w400,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${item.price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: item.approvedTotalReviews > 0
? (item.approvedRatingSum.toDouble() /
item.approvedTotalReviews.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
"(${item.approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
),
],
),
)
],
),
),
);
}
}

@ -0,0 +1,131 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/routes.dart';
class SymptomInfo extends StatefulWidget {
@override
_SymptomInfo createState() => new _SymptomInfo();
}
class _SymptomInfo extends State<SymptomInfo> {
bool checkValue = false;
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).termsService,
isShowAppBar: true,
body: Padding(
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).beforeUsing,
fontWeight: FontWeight.bold,
fontSize: 14,
// textAlign: TextAlign.center,
),
Container(
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
),
padding: EdgeInsets.all(30),
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
AppText(TranslationBase.of(context).remeberthat,
fontSize: 16),
SizedBox(
height: 10,
),
AppText(
'1. ' + TranslationBase.of(context).checkDiagnosis,
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(TranslationBase.of(context).informational,
fontSize: 16),
SizedBox(
height: 10,
),
AppText(
'2. ' + TranslationBase.of(context).notUseInEmbergency,
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
TranslationBase.of(context).notUseInEmbergencyDetails,
fontSize: 16),
AppText(
TranslationBase.of(context).notUseInEmbergencyCall,
underline: true,
color: Colors.blue,
fontSize: 16),
SizedBox(
height: 10,
),
AppText(
'3.' + TranslationBase.of(context).dataSafe,
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(TranslationBase.of(context).dataSafeInfo,
fontSize: 16),
],
),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Padding(
padding: EdgeInsets.all(10),
child: CheckboxListTile(
title: AppText(TranslationBase.of(context).accept),
value: checkValue,
onChanged: (newValue) {
setState(() {
this.checkValue = newValue;
});
},
controlAffinity: ListTileControlAffinity
.leading, // <-- leading Checkbox
),
),
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).next,
() => {
if (checkValue == true)
{
Navigator.of(context).pushNamed(
SELECT_GENDER,
)
}
},
color: checkValue == true
? Colors.black
: Colors.grey,
textColor: Colors.white,
))
],
),
],
))
],
)));
}
}

@ -0,0 +1,124 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:flutter_xlider/flutter_xlider.dart';
class SelectGender extends StatefulWidget {
@override
_SelectGender createState() => new _SelectGender();
}
class _SelectGender extends State<SelectGender> {
double slider = 22;
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).gender,
isShowAppBar: true,
body: Padding(
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
//TranslationBase.of(context).beforeUsing,
TranslationBase.of(context).selectGender,
fontWeight: FontWeight.bold,
fontSize: 20,
// textAlign: TextAlign.center,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
AppText(TranslationBase.of(context).iAma, fontSize: 16),
SizedBox(
height: 10,
),
Row(
children: [
Expanded(
child: Container(
height: 200,
width: 150,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
shadowColor: Colors.red,
child: Image.asset(
'assets/images/female_face.png')))),
Expanded(
child: Container(
height: 200,
width: 150,
child: Card(
shadowColor: Colors.red,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
child: Image.asset(
'assets/images/male_face.png'))))
],
),
AppText(TranslationBase.of(context).selectAge,
fontSize: 25),
SizedBox(
height: 10,
),
AppText(
TranslationBase.of(context).iAm +
' ' +
slider.toString() +
' ' +
TranslationBase.of(context)
.yearOld, //TranslationBase.of(context).remeberthat,
fontSize: 16),
SizedBox(
height: 30,
),
FlutterSlider(
values: [slider],
max: 90,
min: 14,
onDragCompleted: (handlerIndex, lowerValue, upperValue) {
print(lowerValue);
print(upperValue);
setState(() {
slider = upperValue;
});
},
),
],
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).next,
() => {
Navigator.of(context).pushNamed(
SYMPTOM_CHECKER,
)
},
))
],
),
],
))
],
)));
}
}

File diff suppressed because one or more lines are too long

@ -10,6 +10,8 @@ import 'package:diplomaticquarterapp/pages/login/login.dart';
import 'package:diplomaticquarterapp/pages/login/register.dart';
import 'package:diplomaticquarterapp/pages/family/add-family_type.dart';
import 'package:diplomaticquarterapp/pages/family/add-family-member.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart';
const String INIT_ROUTE = '/';
@ -27,6 +29,8 @@ const String ADD_FAMILY_MEMBER_TYPE = 'add-family-member-type';
const String ADD_FAMILY_MEMBER = 'add-family-member';
const String LIVE_CARE = 'live-care';
const String SYMPTOM_CHECKER = 'symptom-checker';
const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info';
const String SELECT_GENDER = 'select-gender';
var routes = {
HOME: (_) => LandingPage(),
WELCOME_LOGIN: (_) => WelcomeLogin(),
@ -40,5 +44,7 @@ var routes = {
ADD_FAMILY_MEMBER_TYPE: (_) => AddFamilyMemberType(),
ADD_FAMILY_MEMBER: (_) => AddMember(),
LIVE_CARE: (_) => LiveCareHome(),
SYMPTOM_CHECKER: (_) => SymptomChecker()
SYMPTOM_CHECKER: (_) => SymptomChecker(),
SYMPTOM_CHECKER_INFO: (_) => SymptomInfo(),
SELECT_GENDER: (_) => SelectGender()
};

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save