Merge branch 'development_new_design_2.0' into zik_new_design_2.0

* development_new_design_2.0:
  LiveCare Schedule fixes
  improvements.
  live care design 3.0
  dialog ui changes in wallet & improvements.
  LiveCare Schedule API fix
  live care design 2.0
  Health converters UI done
  Health Calculators APIs updated
  Translation updates
  SessionID update
  live care design 1.0
  Updates & fixes
  blood sugar dialog improvement.

# Conflicts: Rseloved
#	lib/config/localized_values.dart
#	lib/core/service/client/base_app_client.dart
#	lib/uitl/translations_delegate_base.dart
merge-requests/467/head
Zohaib Iqbal Kambrani 4 years ago
commit 94a5cac27d

@ -0,0 +1,12 @@
<svg id="calendar" xmlns="http://www.w3.org/2000/svg" width="16.407" height="16.407" viewBox="0 0 16.407 16.407">
<g id="Group_8220" data-name="Group 8220">
<g id="Group_8219" data-name="Group 8219">
<path id="Path_4987" data-name="Path 4987" d="M14.767,1.641h-.82V.82a.82.82,0,1,0-1.641,0v.82H4.1V.82A.775.775,0,0,0,3.281,0a.775.775,0,0,0-.82.82v.82H.82a.822.822,0,0,0-.82.82V13.946a.822.822,0,0,0,.82.82h5A6.53,6.53,0,0,1,15.587,6.4V2.461A.882.882,0,0,0,14.767,1.641Z" fill="#2e303a"/>
</g>
</g>
<g id="Group_8222" data-name="Group 8222" transform="translate(6.563 6.563)">
<g id="Group_8221" data-name="Group 8221">
<path id="Path_4988" data-name="Path 4988" d="M209.722,204.8a4.922,4.922,0,1,0,4.922,4.922A4.937,4.937,0,0,0,209.722,204.8Zm1.641,5.743h-1.641a.775.775,0,0,1-.82-.82v-2.461a.82.82,0,0,1,1.641,0V208.9h.82a.82.82,0,1,1,0,1.641Z" transform="translate(-204.8 -204.8)" fill="#2e303a"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -298,8 +298,8 @@ const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoF
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
// const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_DWH"; const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_Async";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; // const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS";
@ -458,6 +458,11 @@ const ADD_RRT_ORDER_RC = "rc/api/rrt/add";
const GET_ALL_RRT_ORDERS_RC = "rc/api/rrt/list"; const GET_ALL_RRT_ORDERS_RC = "rc/api/rrt/list";
const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update'; const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update';
// PRESCRIPTION RC SERVICES
const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list";
const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update';
//Pharmacy wishlist //Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/"; const GET_WISHLIST = "shopping_cart_items/";

@ -396,8 +396,9 @@ const Map localizedValues = {
"PaymentOnline": {"en": "Service", "ar": "الالكتروني"}, "PaymentOnline": {"en": "Service", "ar": "الالكتروني"},
"OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"}, "OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"},
"MyBalances": {"en": "My Balances", "ar": "رصيدي"}, "MyBalances": {"en": "My Balances", "ar": "رصيدي"},
"MyWallet": {"en": "My Wallet", "ar": "محفظتى"},
"BalanceAmount": {"en": "Wallet Amount", "ar": "مبلغ المحفظة"}, "BalanceAmount": {"en": "Wallet Amount", "ar": "مبلغ المحفظة"},
"TotalBalance": {"en": "Total Amount", "ar": "المبلغ الإجمالي"}, "TotalBalance": {"en": "Total Balance", "ar": "إجمالي الرصيد"},
"CreateAdvancedPayment": {"en": "Recharge Wallet", "ar": "شحن المحفظة"}, "CreateAdvancedPayment": {"en": "Recharge Wallet", "ar": "شحن المحفظة"},
"AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"},
"AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for your account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"}, "AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for your account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"},
@ -1144,7 +1145,7 @@ const Map localizedValues = {
"ar": "تحويل مستوى السكر في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" "ar": "تحويل مستوى السكر في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس"
}, },
"convertCholesterolStatement": { "convertCholesterolStatement": {
"en": "Convert blood cholesterol from\n mmol/l to mg/dlt and vice versa.", "en": "Convert blood cholesterol from mmol/l to mg/dlt and vice versa.",
"ar": "تحويل مستوى الكولسترول في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" "ar": "تحويل مستوى الكولسترول في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس"
}, },
"triglyceridesConvertStatement": { "triglyceridesConvertStatement": {
@ -1494,7 +1495,7 @@ const Map localizedValues = {
"RRTRequestSuccess": {"en": "Request has been sent successfully, you will be contacted soon.", "ar": "تم إرسال الطلب بنجاح ، وسيتم الاتصال بك باسرع وقت ممكن"}, "RRTRequestSuccess": {"en": "Request has been sent successfully, you will be contacted soon.", "ar": "تم إرسال الطلب بنجاح ، وسيتم الاتصال بك باسرع وقت ممكن"},
"rateDoctorAppo": {"en": "Rate DR & Appointment", "ar": "تقييم الطبيب والموعد"}, "rateDoctorAppo": {"en": "Rate DR & Appointment", "ar": "تقييم الطبيب والموعد"},
"invoice": {"en": "Invoice", "ar": "الفاتورة"}, "invoice": {"en": "Invoice", "ar": "الفاتورة"},
"requestedDate": {"en": "Reqeusted Date", "ar": "التاريخ "}, "requestedDate": {"en": "Req Date", "ar": "التاريخ "},
"callDuration": {"en": "Call Duration", "ar": "مدة الاتصال"}, "callDuration": {"en": "Call Duration", "ar": "مدة الاتصال"},
"alreadyRated": {"en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً"}, "alreadyRated": {"en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً"},
"insuranceCompany": {"en": "Insurance Company", "ar": "شركة تأمين"}, "insuranceCompany": {"en": "Insurance Company", "ar": "شركة تأمين"},
@ -1596,7 +1597,7 @@ const Map localizedValues = {
"ios-instructions-2": { "en": "Make sure that your Apple Watch is connected with the Watch & Health Apps.", "ar": "تأكد من اتصال Apple Watch بتطبيقات Watch & Health." }, "ios-instructions-2": { "en": "Make sure that your Apple Watch is connected with the Watch & Health Apps.", "ar": "تأكد من اتصال Apple Watch بتطبيقات Watch & Health." },
"ios-instructions-3": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق صحتك." }, "ios-instructions-3": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق صحتك." },
"supportedWatches": { "en": "Supported SmartWatches", "ar": "الساعات الذكية المدعومة" }, "supportedWatches": { "en": "Supported SmartWatches", "ar": "الساعات الذكية المدعومة" },
"watchInstructions": { "en": "Watch Instructions:", "ar": "تعليمات الساعة:" }, "watchInstructions": { "en": "View watch instructions", "ar": "عرض تعليمات الساعة" },
"monthlyTab": {"en": "Monthly", "ar": "شهري"}, "monthlyTab": {"en": "Monthly", "ar": "شهري"},
"moreSupportedWatches": {"en": "More Supported Smartwatches...", "ar": "المزيد من الساعات الذكية المدعومة..."}, "moreSupportedWatches": {"en": "More Supported Smartwatches...", "ar": "المزيد من الساعات الذكية المدعومة..."},
"android-instructions-1": { "en": "Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", "ar": "تأكد من تثبيت تطبيقات 'WearOS' و 'Google Fit' من متجر Google PlayStore." }, "android-instructions-1": { "en": "Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", "ar": "تأكد من تثبيت تطبيقات 'WearOS' و 'Google Fit' من متجر Google PlayStore." },
@ -1604,4 +1605,9 @@ const Map localizedValues = {
"android-instructions-3": { "en": "Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", "ar": "تأكد من أن ساعتك الذكية متصلة بتطبيق WearOS وتطبيقات ساعتك." }, "android-instructions-3": { "en": "Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", "ar": "تأكد من أن ساعتك الذكية متصلة بتطبيق WearOS وتطبيقات ساعتك." },
"android-instructions-4": { "en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit." }, "android-instructions-5": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة." }, "android-instructions-4": { "en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit." }, "android-instructions-5": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة." },
"tamaraInstPlan" : { "en": "Select the tamara installment plan", "ar": "حدد خطة تقسيط تمارة" }, "tamaraInstPlan" : { "en": "Select the tamara installment plan", "ar": "حدد خطة تقسيط تمارة" },
"onlineTag": {"en": "Online", "ar": "متصل"},
"offlineTag": {"en": "Offline", "ar": "غير متصل"},
"viewDocList": {"en": "View List of Doctors", "ar": "عرض قائمة الأطباء"},
"bodyFatTitle": {"en": "Body Fat", "ar": " الدهون في الجسم"},
"cholesTitle": {"en": "Blood Cholesterol", "ar": " الكولسترول في الدم"},
}; };

@ -13,6 +13,9 @@ class BariatricsService extends BaseService {
List<GetDoctorListModel> doctorList = []; List<GetDoctorListModel> doctorList = [];
List<DoctorListByTimeModel> doctorListByTime = []; List<DoctorListByTimeModel> doctorListByTime = [];
double lat;
double long;
Future getClinicCategory() async { Future getClinicCategory() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -104,12 +107,20 @@ class BariatricsService extends BaseService {
} }
Future getCalculationDoctors({@required int calculationID}) async { Future getCalculationDoctors({@required int calculationID}) async {
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG);
}
hasError = false; hasError = false;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['CalculationID'] = calculationID; // hint: it is static depend on IONIC project body['CalculationID'] = calculationID; // hint: it is static depend on IONIC project
body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['Latitude'] = lat != null ? lat.toString() : 0;
body['Longitude'] = long != null ? long.toString() : 0;
dynamic localRes; dynamic localRes;

@ -2,13 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PrescriptionDeliveryService extends BaseService { class PrescriptionDeliveryService extends BaseService {
Future insertDeliveryOrder( Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async {
{int lineItemNo,
double latitude,
double longitude,
int appointmentNo,
int createdBy,
int dischargeID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['LineItemNo'] = lineItemNo; body['LineItemNo'] = lineItemNo;
@ -17,11 +11,26 @@ class PrescriptionDeliveryService extends BaseService {
body['AppointmentNo'] = appointmentNo; body['AppointmentNo'] = appointmentNo;
body['CreatedBy'] = createdBy; body['CreatedBy'] = createdBy;
body['DischargeID'] = dischargeID; body['DischargeID'] = dischargeID;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { var asd = "";
var asd=""; }, onFailure: (String error, int statusCode) {
}, hasError = true;
onFailure: (String error, int statusCode) { print(error);
super.error = error;
}, body: body);
}
Future insertDeliveryOrderRC({double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['latitude'] = latitude;
body['longitude'] = longitude;
body['AppointmentNo'] = appointmentNo;
body['CreatedBy'] = createdBy;
body['DischargeID'] = dischargeID;
await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {
var asd = "";
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
print(error); print(error);
super.error = error; super.error = error;

@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart'; import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -31,8 +30,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// onFailure: (String error, int statusCode) {}, /// onFailure: (String error, int statusCode) {},
/// body: Map(); /// body: Map();
/// ///
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
class BaseAppClient { class BaseAppClient {
@ -102,7 +100,7 @@ class BaseAppClient {
? body['PatientOutSA'] ? body['PatientOutSA']
: PATIENT_OUT_SA : PATIENT_OUT_SA
: PATIENT_OUT_SA; : PATIENT_OUT_SA;
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = getSessionId(body['TokenID']); //getSe
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -466,7 +464,8 @@ class BaseAppClient {
simplePost( simplePost(
String fullUrl, { String fullUrl, {
Map<dynamic, dynamic> body, Map<String, String> headers, Map<String, dynamic> body,
Map<String, String> headers,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
}) async { }) async {
@ -483,8 +482,7 @@ class BaseAppClient {
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if(await handleUnauthorized(statusCode, forUrl: fullUrl)) if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers);
simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers);
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
@ -496,7 +494,8 @@ class BaseAppClient {
} }
} }
simpleGet(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams, Map<String, String> headers}) async { simpleGet(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams, Map<String, String> headers}) async {
String url = fullUrl; String url = fullUrl;
print("URL Query String: $url"); print("URL Query String: $url");
@ -516,8 +515,7 @@ class BaseAppClient {
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if(await handleUnauthorized(statusCode, forUrl: fullUrl)) if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleGet(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, queryParams: queryParams);
simpleGet(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, queryParams: queryParams);
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
@ -543,8 +541,7 @@ class BaseAppClient {
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if(await handleUnauthorized(statusCode, forUrl: fullUrl)) if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePut(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, body: body);
simplePut(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, body: body);
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
@ -556,7 +553,8 @@ class BaseAppClient {
} }
} }
simpleDelete(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams, Map<String, String> headers}) async { simpleDelete(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams, Map<String, String> headers}) async {
String url = fullUrl; String url = fullUrl;
print("URL Query String: $url"); print("URL Query String: $url");
@ -576,8 +574,7 @@ class BaseAppClient {
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if(await handleUnauthorized(statusCode, forUrl: fullUrl)) if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleDelete(fullUrl, onFailure: onFailure, onSuccess: onSuccess, queryParams: queryParams, headers: headers);
simpleDelete(fullUrl, onFailure: onFailure, onSuccess: onSuccess, queryParams: queryParams, headers: headers);
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
@ -589,8 +586,8 @@ class BaseAppClient {
} }
} }
Future<bool> handleUnauthorized(int statusCode, {String forUrl}) async{ Future<bool> handleUnauthorized(int statusCode, {String forUrl}) async {
if(forUrl.startsWith(EXA_CART_API_BASE_URL) && statusCode == 401) { if (forUrl.startsWith(EXA_CART_API_BASE_URL) && statusCode == 401) {
final token = await generatePackagesToken(); final token = await generatePackagesToken();
packagesAuthHeader['Authorization'] = 'Bearer $token'; packagesAuthHeader['Authorization'] = 'Bearer $token';
return token != null && (token is String); return token != null && (token is String);
@ -726,7 +723,7 @@ class BaseAppClient {
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));
onFailure(parsed['error']['ErrorEndUserMsg'] ??'Error While Fetching data', statusCode); onFailure(parsed['error']['ErrorEndUserMsg'] ?? 'Error While Fetching data', statusCode);
} else { } else {
// var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));
@ -791,15 +788,10 @@ class BaseAppClient {
} }
} }
Future<String> generatePackagesToken() async { Future<String> generatePackagesToken() async {
var url = EXA_CART_API_BASE_URL + PACKAGES_TOKEN; var url = EXA_CART_API_BASE_URL + PACKAGES_TOKEN;
var body = { var body = {
"api_client": { "api_client": {"client_id": "a4ab6be4-424f-4836-b032-46caed88e184", "client_secret": "3c1a3e07-4a40-4510-9fb0-ee5f0a72752c"}
"client_id": "a4ab6be4-424f-4836-b032-46caed88e184",
"client_secret": "3c1a3e07-4a40-4510-9fb0-ee5f0a72752c"
}
}; };
String token; String token;
final completer = Completer(); final completer = Completer();

@ -7,15 +7,11 @@ import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart'; import '../../../locator.dart';
class PrescriptionDeliveryViewModel extends BaseViewModel { class PrescriptionDeliveryViewModel extends BaseViewModel {
CustomerAddressesService _customerAddressesService = CustomerAddressesService _customerAddressesService = locator<CustomerAddressesService>();
locator<CustomerAddressesService>(); PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>();
PharmacyModuleService _pharmacyModuleService = PrescriptionDeliveryService _prescriptionDeliveryService = locator<PrescriptionDeliveryService>();
locator<PharmacyModuleService>();
PrescriptionDeliveryService _prescriptionDeliveryService =
locator<PrescriptionDeliveryService>();
List<AddressInfo> get addressesList => List<AddressInfo> get addressesList => _customerAddressesService.addressesList;
_customerAddressesService.addressesList;
Future getCustomerInfo() async { Future getCustomerInfo() async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -27,28 +23,16 @@ class PrescriptionDeliveryViewModel extends BaseViewModel {
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
error = _customerAddressesService.error; error = _customerAddressesService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {}
}
await getCustomerAddresses(); await getCustomerAddresses();
} }
Future insertDeliveryOrder( Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async {
{int lineItemNo,
double latitude,
double longitude,
int appointmentNo,
int createdBy,
int dischargeID}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _prescriptionDeliveryService.insertDeliveryOrder( // await _prescriptionDeliveryService.insertDeliveryOrder(
lineItemNo: lineItemNo, // lineItemNo: lineItemNo, latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID);
latitude: latitude, await _prescriptionDeliveryService.insertDeliveryOrderRC(
longitude: longitude, latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID);
appointmentNo: appointmentNo,
createdBy: createdBy,
dischargeID: dischargeID
);
if (_prescriptionDeliveryService.hasError) { if (_prescriptionDeliveryService.hasError) {
error = _prescriptionDeliveryService.error; error = _prescriptionDeliveryService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -77,7 +77,6 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
getPrescriptionsOrders({bool showLoading = false}) async { getPrescriptionsOrders({bool showLoading = false}) async {
// print(showLoading);
setState(ViewState.Busy); setState(ViewState.Busy);
Future.delayed(new Duration(milliseconds: 300)).then((value) async { Future.delayed(new Duration(milliseconds: 300)).then((value) async {
await _prescriptionsService.getPrescriptionsOrders(); await _prescriptionsService.getPrescriptionsOrders();

@ -1,16 +1,12 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'package:diplomaticquarterapp/core/service/medical/prescriptions_service.dart';
//import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; //import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProduct_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProduct_service.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
@ -20,13 +16,11 @@ import '../../../locator.dart';
class PharmacyModuleViewModel extends BaseViewModel { class PharmacyModuleViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>(); PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
RecommendedProductService _recommendedProductService = RecommendedProductService _recommendedProductService = locator<RecommendedProductService>();
locator<RecommendedProductService>();
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems; List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
List<RecommendedProductModel> get recommendedProductList => List<RecommendedProductModel> get recommendedProductList => _recommendedProductService.recommendedList;
_recommendedProductService.recommendedList;
Future generatePharmacyToken() async { Future generatePharmacyToken() async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -40,8 +34,6 @@ class PharmacyModuleViewModel extends BaseViewModel {
} }
Future verifyCustomer() async { Future verifyCustomer() async {
// if (authenticatedUserObject.isLogin) await generatePharmacyToken();
var data = await sharedPref.getObject(USER_PROFILE); var data = await sharedPref.getObject(USER_PROFILE);
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
@ -70,11 +62,9 @@ class PharmacyModuleViewModel extends BaseViewModel {
Future getBannerList() async { Future getBannerList() async {
if (bannerList.isEmpty) { if (bannerList.isEmpty) {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
locator<NavigationService>().navigatorKey.currentContext);
await _pharmacyService.getBannerListList(); await _pharmacyService.getBannerListList();
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
locator<NavigationService>().navigatorKey.currentContext);
if (_pharmacyService.hasError) { if (_pharmacyService.hasError) {
error = _pharmacyService.error; error = _pharmacyService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -83,9 +73,15 @@ class PharmacyModuleViewModel extends BaseViewModel {
} }
} }
List<String> getBannerImagesUrl() { List<String> getBannerImagesUrl(ProjectViewModel projectViewModel) {
List<String> images = List(); List<String> images = List();
images.add('assets/images/pharmacy_module/pharmacy_logo_green.png'); images.add('assets/images/pharmacy_module/pharmacy_logo_green.png');
if (projectViewModel.isArabic)
images.add('assets/images/pharmacy_module/offers_banner_ar.png');
else
images.add('assets/images/pharmacy_module/offers_banner.png');
_pharmacyService.bannerItems.forEach((element) { _pharmacyService.bannerItems.forEach((element) {
images.add(element.src); images.add(element.src);
}); });

@ -4,6 +4,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
// todo 'sikander' remove this file when usage known
class SelectCountryDialog extends StatefulWidget { class SelectCountryDialog extends StatefulWidget {
final Function(dynamic) onValueSelected; final Function(dynamic) onValueSelected;
dynamic selectedCountry; dynamic selectedCountry;

@ -1,139 +0,0 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class SelectSearchCriteriaDialog extends StatefulWidget {
List<SearchCriteriaModel> searchCriteria = [
SearchCriteriaModel(name: "Identification Number",nameAr:"رقم الهوية",value: 1),
SearchCriteriaModel(name: "Referral Number",nameAr:"رقم الإحالة",value: 2),
];
final Function(SearchCriteriaModel) onValueSelected;
SearchCriteriaModel selectedCriteria;
ProjectViewModel projectViewModel;
SelectSearchCriteriaDialog(
{Key key, this.onValueSelected, this.selectedCriteria, this.projectViewModel});
@override
_SelectSearchCriteriaDialogState createState() => _SelectSearchCriteriaDialogState();
}
class _SelectSearchCriteriaDialogState extends State<SelectSearchCriteriaDialog> {
@override
void initState() {
super.initState();
widget.selectedCriteria = widget.selectedCriteria ?? widget.searchCriteria[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Text(TranslationBase.of(context).searchCriteria),
Divider(),
...List.generate(
widget.searchCriteria.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedCriteria = widget.searchCriteria[index];
});
},
child: ListTile(
title: Text(widget.projectViewModel.isArabic ? widget.searchCriteria[index].nameAr : widget.searchCriteria[index].name),
leading: Radio(
value: widget.searchCriteria[index],
groupValue: widget.selectedCriteria,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedCriteria = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedCriteria);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),
),
),
],
)
],
)
],
);
}
}

@ -4,17 +4,17 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/referral_details.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/referral_details.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -23,7 +23,6 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'dialogs/select_country_ingo_Dialog.dart'; import 'dialogs/select_country_ingo_Dialog.dart';
import 'dialogs/select_search_criteria_dialog.dart';
class SearchForReferralsPage extends StatefulWidget { class SearchForReferralsPage extends StatefulWidget {
SearchForReferralsPage({Key key}); SearchForReferralsPage({Key key});
@ -79,74 +78,31 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
// InkWell( CommonDropDownView(TranslationBase.of(context).selectSearchCriteria, getSearchCriteriaName(projectViewModel), () {
// onTap: () => selectSearchCriteriaDialog(), List<SearchCriteriaModel> searchCriteria = [
// child: Container( SearchCriteriaModel(name: "Identification Number", nameAr: "رقم الهوية", value: 1),
// padding: EdgeInsets.all(12), SearchCriteriaModel(name: "Referral Number", nameAr: "رقم الإحالة", value: 2),
// width: double.infinity, ];
// height: 65, List<RadioSelectionDialogModel> list = <RadioSelectionDialogModel>[];
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), for (int i = 0; i < searchCriteria.length; i++) {
// child: Row( list.add(RadioSelectionDialogModel(projectViewModel.isArabic ? searchCriteria[i].nameAr : searchCriteria[i].name, searchCriteria[i].value));
// mainAxisAlignment: MainAxisAlignment.spaceBetween, }
// children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)], showDialog(
// ), context: context,
// ), child: RadioSelectionDialog(
// ), listData: list,
Container( selectedIndex: selectedCriteria.value,
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), onValueSelected: (index) {
alignment: Alignment.center, selectedCriteria = searchCriteria[index - 1];
decoration: BoxDecoration( setState(() {});
borderRadius: BorderRadius.circular(15), },
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: () => selectSearchCriteriaDialog(projectViewModel),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectSearchCriteria,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getSearchCriteriaName(projectViewModel),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
],
),
),
),
SizedBox(
height: 12,
),
inputWidget(selectedCriteria.value == 1 ? TranslationBase.of(context).enterIdentificationNumber : TranslationBase.of(context).referralNumber, "", _searchTextController, isInputTypeNum: true),
SizedBox(
height: 12,
), ),
);
}).withBorderedContainer,
SizedBox(height: 12),
inputWidget(selectedCriteria.value == 1 ? TranslationBase.of(context).enterIdentificationNumber : TranslationBase.of(context).referralNumber, "", _searchTextController,
isInputTypeNum: true),
SizedBox(height: 12),
PhoneNumberSelectorWidget(onNumberChange: (value) { PhoneNumberSelectorWidget(onNumberChange: (value) {
setState(() { setState(() {
mobileNo = value; mobileNo = value;
@ -179,9 +135,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
// }, // },
// code: _selectedCountry == null ? "11" : _selectedCountry["code"], // code: _selectedCountry == null ? "11" : _selectedCountry["code"],
// ), // ),
SizedBox( SizedBox(height: 12),
height: 12,
),
if ((model.state == ViewState.Idle && model.allReferral.length == 0)) Center(child: Text(TranslationBase.of(context).noSearchResult)), if ((model.state == ViewState.Idle && model.allReferral.length == 0)) Center(child: Text(TranslationBase.of(context).noSearchResult)),
if ((model.state == ViewState.ErrorLocal)) AppEmbeddedError(error: model.error), if ((model.state == ViewState.ErrorLocal)) AppEmbeddedError(error: model.error),
model.allReferral.length > 0 model.allReferral.length > 0
@ -293,35 +247,9 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
return "Country"; return "Country";
} }
void selectSearchCriteriaDialog(ProjectViewModel projectViewModel) {
showDialog(
context: context,
child: SelectSearchCriteriaDialog(
selectedCriteria: selectedCriteria,
projectViewModel: projectViewModel,
onValueSelected: (value) {
setState(() {
selectedCriteria = value;
});
},
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
return Container( return InkWell(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null, onTap: hasSelection ? () {} : null,
child: Row( child: Row(
children: [ children: [
@ -377,8 +305,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
], ],
), ),
), ).withBorderedContainer;
);
} }
String getSearchCriteriaName(ProjectViewModel projectViewModel) { String getSearchCriteriaName(ProjectViewModel projectViewModel) {

@ -1,9 +1,15 @@
import 'dart:collection';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -61,9 +67,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
activeColor: Colors.blue.shade700, activeColor: Colors.blue.shade700,
value: item.diseasesID, value: item.diseasesID,
groupValue: _selectedDisease != null ? _selectedDisease.diseasesID : -1, groupValue: _selectedDisease != null ? _selectedDisease.diseasesID : -1,
selected: _selectedDisease != null selected: _selectedDisease != null ? item.diseasesID == _selectedDisease.diseasesID : false,
? item.diseasesID == _selectedDisease.diseasesID
: false,
onChanged: (val) { onChanged: (val) {
setState(() { setState(() {
_selectedDisease = item; _selectedDisease = item;
@ -95,10 +99,14 @@ class _BariatricsPageState extends State<BariatricsPage> {
radius: 8, radius: 8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
handler: () async { handler: () async {
Navigator.push( callDoctorsSearchAPI();
context, // Navigator.push(
FadePage(page: DoctorList(diseaseByClinic: _selectedDisease,)), // context,
); // FadePage(
// page: DoctorList(
// diseaseByClinic: _selectedDisease,
// )),
// );
}, },
), ),
), ),
@ -116,10 +124,11 @@ class _BariatricsPageState extends State<BariatricsPage> {
borderColor: Color(0x00000000), borderColor: Color(0x00000000),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
handler: () async { handler: () async {
Navigator.push( callDoctorsSearchAPI();
context, // Navigator.push(
FadePage(page: DoctorList()), // context,
); // FadePage(page: DoctorList()),
// );
}, },
), ),
), ),
@ -129,6 +138,65 @@ class _BariatricsPageState extends State<BariatricsPage> {
); );
} }
callDoctorsSearchAPI() {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
List<String> result;
int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(108, 0, false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {}
});
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
}
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))
.then((value) {
setState(() {
// dropdownValue = null;
});
// getProjectsList();
});
}
_getImageName(int gender, double obeseResult, bool isArabic) { _getImageName(int gender, double obeseResult, bool isArabic) {
String path = "assets/images/BMI/"; String path = "assets/images/BMI/";
double result = obeseResult; double result = obeseResult;

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -123,7 +124,9 @@ class _BmrCalculatorState extends State<BmrCalculator> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: 'Bmr Calculator', showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bmr,
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
appBarIcons: [ appBarIcons: [
Padding( Padding(

@ -1,4 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -9,13 +13,17 @@ import 'package:percent_indicator/circular_percent_indicator.dart';
class BmrResultPage extends StatelessWidget { class BmrResultPage extends StatelessWidget {
final double bmrResult; final double bmrResult;
final double calories; final double calories;
BmrResultPage({this.bmrResult, this.calories}); BmrResultPage({this.bmrResult, this.calories});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: 'BMR Calculator', showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bmr,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
@ -58,16 +66,66 @@ class BmrResultPage extends StatelessWidget {
Container( Container(
width: 350, width: 350,
child: Button( child: Button(
label: 'See List Of Doctors', label: TranslationBase.of(context).viewDocList,
onTap: () { onTap: () {
Navigator.push( getDoctorsList(context);
context,
FadePage(page: DoctorList()),
);
}), }),
), ),
], ],
), ),
); );
} }
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 3).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
} }

@ -1,5 +1,6 @@
import 'dart:math'; import 'dart:math';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -210,8 +211,10 @@ class _BodyFatState extends State<BodyFat> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Body Fat', isShowDecPage: false,
showHomeAppBarIcon: false, showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bodyFatTitle,
appBarIcons: [ appBarIcons: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0), padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),

@ -1,4 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -12,7 +16,9 @@ class FatResult extends StatelessWidget {
final String textResult; final String textResult;
FatResult({this.bodyFat, this.fat, this.textResult = ''}); FatResult({this.bodyFat, this.fat, this.textResult = ''});
Color inductorColor; Color inductorColor;
Color colorInductor() { Color colorInductor() {
if (bodyFat >= 17) { if (bodyFat >= 17) {
inductorColor = Color(0xffC70D00); inductorColor = Color(0xffC70D00);
@ -30,7 +36,10 @@ class FatResult extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Body Fat', isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bodyFatTitle,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
@ -69,12 +78,9 @@ class FatResult extends StatelessWidget {
Container( Container(
width: 350, width: 350,
child: Button( child: Button(
label: 'See List Of Doctors', label: TranslationBase.of(context).viewDocList,
onTap: () { onTap: () {
Navigator.push( getDoctorsList(context);
context,
FadePage(page: DoctorList()),
);
}, },
), ),
), ),
@ -82,4 +88,57 @@ class FatResult extends StatelessWidget {
), ),
); );
} }
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 5).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
} }

@ -1,4 +1,7 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -15,9 +18,11 @@ class CalorieResultPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowDecPage: false,
appBarTitle: "${TranslationBase.of(context).calories} ${TranslationBase.of(context).calculators}", appBarTitle: "${TranslationBase.of(context).calories} ${TranslationBase.of(context).calculators}",
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
@ -52,12 +57,9 @@ class CalorieResultPage extends StatelessWidget {
Container( Container(
width: 350, width: 350,
child: Button( child: Button(
label: 'See List Of Doctors', label: TranslationBase.of(context).viewDocList,
onTap: () { onTap: () {
Navigator.push( getDoctorsList(context);
context,
FadePage(page: DoctorList()),
);
}, },
), ),
), ),
@ -65,4 +67,57 @@ class CalorieResultPage extends StatelessWidget {
), ),
); );
} }
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 2).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -81,8 +82,10 @@ class _CarbsState extends State<Carbs> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Carb Protein Fat', isShowDecPage: false,
showHomeAppBarIcon: false, showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).carbohydrate,
appBarIcons: [ appBarIcons: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0), padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),

@ -1,5 +1,9 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -32,7 +36,10 @@ class CarbsResult extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Carb Protein Fat', isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).carbohydrate,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -156,27 +163,68 @@ class CarbsResult extends StatelessWidget {
Container( Container(
width: 350, width: 350,
child: Button( child: Button(
label: 'See List Of Doctors', label: TranslationBase.of(context).viewDocList,
onTap: () { onTap: () {
Navigator.push( getDoctorsList(context);
context,
FadePage(page: DoctorList()),
);
}, },
), ),
), ),
], ],
), ),
// Texts(pCal.ceil().toString()),
// Texts(cCal.ceil().toString()),
// Texts(fCal.ceil().toString()),
// Texts(pCalGram.ceil().toString()),
// Texts(cCalGram.ceil().toString()),
// Texts(fCalGram.ceil().toString()),
// Texts(pCalMeal.ceil().toString()),
// Texts(cCalMeal.ceil().toString()),
// Texts(fCalMeal.ceil().toString()),
); );
} }
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 11).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -100,7 +101,10 @@ class _IdealBodyState extends State<IdealBody> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Ideal Body Weight', isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).idealBody,
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
appBarIcons: [ appBarIcons: [
Padding( Padding(

@ -1,5 +1,8 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -14,11 +17,15 @@ class IdealBodyResult extends StatelessWidget {
final String textResult; final String textResult;
IdealBodyResult({this.idealBodyWeight, this.minRange, this.mixRange, this.overWeightBy, this.textResult}); IdealBodyResult({this.idealBodyWeight, this.minRange, this.mixRange, this.overWeightBy, this.textResult});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Ideal Body Weight', isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).idealBody,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -81,8 +88,7 @@ class IdealBodyResult extends StatelessWidget {
children: [ children: [
Texts('This means that the weight is a little bit more than ideal weight by'), Texts('This means that the weight is a little bit more than ideal weight by'),
Texts(overWeightBy.toStringAsFixed(1)), Texts(overWeightBy.toStringAsFixed(1)),
Texts( Texts('May wish to consult with the doctor for medical help. Click to view our list of Doctors'),
'May wish to consult with the doctor for medical help. Click to view our list of Doctors'),
], ],
) )
: overWeightBy >= 18 : overWeightBy >= 18
@ -104,8 +110,7 @@ class IdealBodyResult extends StatelessWidget {
SizedBox( SizedBox(
height: 25.0, height: 25.0,
), ),
Texts( Texts('May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
], ],
), ),
) )
@ -148,20 +153,16 @@ class IdealBodyResult extends StatelessWidget {
SizedBox( SizedBox(
height: 25.0, height: 25.0,
), ),
Texts( Texts('May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
], ],
), ),
), ),
Container( Container(
width: 350, width: 350,
child: Button( child: Button(
label: 'See List Of Doctors', label: TranslationBase.of(context).viewDocList,
onTap: () { onTap: () {
Navigator.push( getDoctorsList(context);
context,
FadePage(page: DoctorList()),
);
}, },
), ),
), ),
@ -169,4 +170,57 @@ class IdealBodyResult extends StatelessWidget {
), ),
); );
} }
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 4).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
} }

@ -26,12 +26,8 @@ class _HealthConverterState extends State<HealthConverter> {
appBarTitle: TranslationBase.of(context).converters, appBarTitle: TranslationBase.of(context).converters,
body: Column( body: Column(
children: [ children: [
Container(
width: double.infinity,
height: 30,
),
Padding( Padding(
padding: EdgeInsets.only(left: 12, right: 12), padding: EdgeInsets.only(left: 12, right: 12, top: 20.0),
child: GridView.builder( child: GridView.builder(
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,
@ -59,9 +55,9 @@ class _HealthConverterState extends State<HealthConverter> {
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).bloodSugar, title: TranslationBase.of(context).bloodSugar,
imagePath: 'assets/images/new-design/blood_sugar_icon.png', imagePath: 'sugar-blood-level.svg',
subTitle: TranslationBase.of(context).sugar, subTitle: TranslationBase.of(context).sugar,
isPngImage: true, isPngImage: false,
), ),
)); ));
@ -72,9 +68,9 @@ class _HealthConverterState extends State<HealthConverter> {
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).bloodCholesterol, title: TranslationBase.of(context).bloodCholesterol,
imagePath: 'assets/images/new-design/blood_cholesterol_icon.png', imagePath: 'cholesterol.svg',
subTitle: TranslationBase.of(context).cholesterol, subTitle: TranslationBase.of(context).cholesterol,
isPngImage: true, isPngImage: false,
), ),
)); ));
@ -85,9 +81,9 @@ class _HealthConverterState extends State<HealthConverter> {
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).triglycerides, title: TranslationBase.of(context).triglycerides,
imagePath: 'assets/images/new-design/triglycerides_blood_icon.png', imagePath: 'fat.svg',
subTitle: TranslationBase.of(context).fatInBlood, subTitle: TranslationBase.of(context).fatInBlood,
isPngImage: true, isPngImage: false,
), ),
)); ));
return medical; return medical;

@ -1,12 +1,13 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
const activeCardColor = Color(0xffD02127); const activeCardColor = CustomColors.green;
const inactiveCardColor = Color(0xffFAFAFd); const inactiveCardColor = CustomColors.white;
class BloodCholesterol extends StatefulWidget { class BloodCholesterol extends StatefulWidget {
@override @override
@ -18,7 +19,6 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
Color cardMMOLColor = inactiveCardColor; Color cardMMOLColor = inactiveCardColor;
void updateColor(int type) { void updateColor(int type) {
//MG/DLT card
if (type == 1) { if (type == 1) {
if (cardMGColor == inactiveCardColor) { if (cardMGColor == inactiveCardColor) {
cardMGColor = activeCardColor; cardMGColor = activeCardColor;
@ -51,124 +51,125 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
bool _visible = false; bool _visible = false;
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
TextEditingController resultTextController = new TextEditingController();
String finalValue; String finalValue;
double inputValue = 0.0; double inputValue = 0.0;
String unit; String unit;
double conversionConst = 38.67; double conversionConst = 38.67;
@override
void initState() {
updateColor(1);
unit = 'mmol/l';
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodCholesterol, appBarTitle: TranslationBase.of(context).cholesTitle,
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.7,
child: Column( child: Column(
//crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(child: Text(TranslationBase.of(context).cholesTitle, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))),
Container( Container(
width: 350.0, margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(TranslationBase.of(context).convertCholesterolStatement, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
TranslationBase.of(context).convertCholesterolStatement,
style: TextStyle(fontSize: 20.0),
),
), ),
SizedBox( SizedBox(
height: 15.0, height: 13.0,
), ),
Container( Container(
color: Colors.white,
height: 120.0,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0), padding: const EdgeInsets.only(top: 12.0),
child: Row( child: Text(TranslationBase.of(context).convertFrom, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 16.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
children: [
Texts(
TranslationBase.of(context).convertFrom,
),
],
),
), ),
SizedBox( SizedBox(
height: 9.0, height: 9.0,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
GestureDetector( Expanded(
child: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
updateColor(1); updateColor(1);
inputValue = inputValue = double.parse(textController.text);
double.parse(textController.text);
inputValue = inputValue / conversionConst; inputValue = inputValue / conversionConst;
unit = 'mmol/l'; unit = 'mmol/l';
}); });
}, },
child: Container( child: Container(
height: 65.0, clipBehavior: Clip.antiAlias,
width: 150.0,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0),
),
border: Border.all(width: 2, color: cardMGColor),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: Color(0xff000000).withOpacity(.05),
spreadRadius: 3, blurRadius: 27,
blurRadius: 7, offset: Offset(0, -3),
offset: Offset(
0, 3), // changes position of shadow
), ),
], ],
color: cardMGColor, color: Colors.white,
borderRadius: BorderRadius.circular(3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.all(8.0),
vertical: 0.0, horizontal: 18.0), child: Text('MG/DLt to MMOL/L',
child: Texts('MG/DLt TO \nMMOL/L'), textAlign: TextAlign.center, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 13.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
), ),
), ),
), ),
GestureDetector( ),
SizedBox(
width: 12.0,
),
Expanded(
child: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
updateColor(2); updateColor(2);
inputValue = inputValue = double.parse(textController.text);
double.parse(textController.text);
inputValue = inputValue * conversionConst; inputValue = inputValue * conversionConst;
unit = 'mg/dlt'; unit = 'mg/dlt';
}); });
}, },
child: Container( child: Container(
height: 65.0, clipBehavior: Clip.antiAlias,
width: 150.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: cardMMOLColor, borderRadius: BorderRadius.all(
borderRadius: BorderRadius.circular(3.0), Radius.circular(6.0),
),
border: Border.all(width: 2, color: cardMMOLColor),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: Color(0xff000000).withOpacity(.05),
spreadRadius: 3, blurRadius: 27,
blurRadius: 7, offset: Offset(0, -3),
offset: Offset(
0, 3), // changes position of shadow
), ),
], ],
color: Colors.white,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.all(8.0),
horizontal: 16.0), child: Text('MMOL/L to MG/DLt',
child: Texts('MG/DLt TO\n MMOL/L'), textAlign: TextAlign.center, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 13.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
),
), ),
), ),
), ),
@ -177,99 +178,119 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
], ],
), ),
), ),
SizedBox(
height: 12.0,
), ),
inputWidget(TranslationBase.of(context).enterReadingValue, '0.0', textController),
SizedBox( SizedBox(
height: 25.0, height: 12.0,
), ),
Container( Visibility(
height: 65.0, visible: _visible,
decoration: BoxDecoration( child: inputWidget(TranslationBase.of(context).result, inputValue.toStringAsFixed(2) + " " + unit.toString(), resultTextController, isEnable: false),
borderRadius: BorderRadius.circular(6.0), ),
color: Colors.white, SizedBox(
height: 15.0,
), ),
child: TextFormField(
controller: textController,
inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.digitsOnly
], ],
keyboardType: TextInputType.number,
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black45)),
labelText: TranslationBase.of(context).enterReadingValue,
labelStyle: TextStyle(
color: Colors.black87,
), ),
), ),
), ),
bottomSheet: Container(
color: CustomColors.white,
padding: EdgeInsets.fromLTRB(12.0, 1.0, 12.0, 25.0),
child: DefaultButton(
TranslationBase.of(context).calculate,
() {
setState(() {
_visible == false ? _visible = !_visible : _visible = _visible;
calculateBloodCholesterol();
});
},
color: CustomColors.green,
), ),
SizedBox(
height: 25.0,
), ),
Visibility( );
visible: _visible, }
child: Container(
height: 115.0, Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
width: 350.0, return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.black), color: isEnable ? Colors.white : CustomColors.grey2.withOpacity(0.4),
borderRadius: BorderRadius.circular(15.0), border: Border.all(
color: Color(0xffefefef),
width: 1,
), ),
child: Padding( ),
padding: const EdgeInsets.all(8.0), child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Texts(TranslationBase.of(context).result + ":"),
Row(
children: [ children: [
Text( Text(
inputValue.toStringAsFixed(3).toString(), _labelText,
style: TextStyle(fontSize: 35.0),
),
Padding(
padding: EdgeInsets.only(left: 4.0, top: 10.0),
child: Text(
unit.toString(),
style: TextStyle( style: TextStyle(
color: Color(0xffC5273A), fontSize: 11,
fontSize: 15.0, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w500, color: Color(0xff2B353E),
), letterSpacing: -0.44,
),
),
],
),
],
),
), ),
), ),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
SizedBox( decoration: InputDecoration(
height: 15.0, isDense: true,
hintText: _hintText,
fillColor: CustomColors.accentColor,
hintStyle: TextStyle(
fontSize: isEnable ? 14 : 24,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: isEnable ? Color(0xff575757) : CustomColors.black,
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
), ),
Flexible(
child: Container(
height: 60.0,
width: 150.0,
child: SecondaryButton(
label: TranslationBase.of(context).calculate,
onTap: () {
setState(() {
_visible == false
? _visible = !_visible
: _visible = _visible;
calculateBloodCholesterol();
});
},
), ),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
), ),
), ),
], ],
), ),
), ),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
), ),
), ),
); );

@ -1,15 +1,15 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
const activeCardColor = Color(0xffD02127); const activeCardColor = CustomColors.green;
const activeTextColor = Color(0xffFAFAFA); const activeTextColor = CustomColors.black;
const inactiveCardColor = Color(0xffFAFAFA); const inactiveCardColor = CustomColors.white;
const inactiveTextColor = Color(0xff60686B); const inactiveTextColor = CustomColors.black;
class BloodSugar extends StatefulWidget { class BloodSugar extends StatefulWidget {
@override @override
@ -25,7 +25,6 @@ class _BloodSugarState extends State<BloodSugar> {
Color textMMOLColor = inactiveTextColor; Color textMMOLColor = inactiveTextColor;
void updateColor(int type) { void updateColor(int type) {
//MG/DLT card
if (type == 1) { if (type == 1) {
if (cardMGColor == inactiveCardColor) { if (cardMGColor == inactiveCardColor) {
cardMGColor = activeCardColor; cardMGColor = activeCardColor;
@ -59,10 +58,12 @@ class _BloodSugarState extends State<BloodSugar> {
inputValue = inputValue * 18; inputValue = inputValue * 18;
unit = 'mg/dlt'; unit = 'mg/dlt';
} }
setState(() {});
} }
bool _visible = false; bool _visible = false;
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
TextEditingController resultTextController = new TextEditingController();
String finalValue; String finalValue;
double inputValue = 0; double inputValue = 0;
@ -90,32 +91,24 @@ class _BloodSugarState extends State<BloodSugar> {
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(child: Text(TranslationBase.of(context).bloodSugar, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 8), margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(TranslationBase.of(context).convertBloodSugarStatement,
TranslationBase.of(context).convertBloodSugarStatement, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
style: TextStyle(fontSize: 20.0),
),
), ),
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
Container( Container(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 8),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.only(top: 12.0),
child: Row( child: Text(TranslationBase.of(context).convertFrom, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 16.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
children: [
Texts(
TranslationBase.of(context).convertFrom,
)
],
),
), ),
SizedBox( SizedBox(
height: 8.0, height: 8.0,
@ -124,9 +117,6 @@ class _BloodSugarState extends State<BloodSugar> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox(
width: 16.0,
),
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
@ -136,24 +126,27 @@ class _BloodSugarState extends State<BloodSugar> {
}); });
}, },
child: Container( child: Container(
height: 65.0, clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0),
),
border: Border.all(width: 2, color: cardMGColor),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: Color(0xff000000).withOpacity(.05),
spreadRadius: 1, blurRadius: 27,
blurRadius: 7, offset: Offset(0, -3),
offset: Offset(0, 3), // changes position of shadow
), ),
], ],
color: cardMGColor, color: Colors.white,
borderRadius: BorderRadius.circular(3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Text(
'MG/DLt TO \nMMOL/L', 'MG/DLt to MMOL/L',
color: textMGColor, textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 13.0, letterSpacing: -0.64, color: CustomColors.darkGrey),
), ),
), ),
), ),
@ -171,129 +164,149 @@ class _BloodSugarState extends State<BloodSugar> {
}); });
}, },
child: Container( child: Container(
height: 65.0, clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( decoration: BoxDecoration(
color: cardMMOLColor, borderRadius: BorderRadius.all(
borderRadius: BorderRadius.circular(3.0), Radius.circular(6.0),
),
border: Border.all(width: 2, color: cardMMOLColor),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: Color(0xff000000).withOpacity(.05),
spreadRadius: 3, blurRadius: 27,
blurRadius: 7, offset: Offset(0, -3),
offset: Offset(0, 3), // changes position of shadow
), ),
], ],
color: Colors.white,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Text(
'MMOL/L TO MG/DLt ', 'MMOL/L to MG/DLt',
color: textMMOLColor, textAlign: TextAlign.center,
), style: TextStyle(fontWeight: FontWeight.w600, fontSize: 13.0, letterSpacing: -0.64, color: CustomColors.darkGrey),
), ),
), ),
), ),
), ),
SizedBox(
width: 16.0,
), ),
], ],
), ),
], ],
), ),
), ),
SizedBox(
height: 12.0,
), ),
inputWidget(TranslationBase.of(context).enterReadingValue, '0.0', textController),
SizedBox( SizedBox(
height: 24.0, height: 12.0,
), ),
Container( Visibility(
height: 65.0, visible: _visible,
padding: EdgeInsets.symmetric(horizontal: 8), child: inputWidget(TranslationBase.of(context).result, inputValue.toStringAsFixed(2) + " " + unit.toString(), resultTextController, isEnable: false),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Colors.white,
), ),
child: TextFormField(
controller: textController,
inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.digitsOnly
], ],
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: TranslationBase.of(context).enterReadingValue,
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white),
),
disabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white),
), ),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.white),
), ),
border: UnderlineInputBorder(borderSide: BorderSide(color: Colors.white)),
labelStyle: TextStyle(
color: Colors.black87,
), ),
],
), ),
), ),
bottomSheet: Container(
color: CustomColors.white,
padding: EdgeInsets.fromLTRB(12.0, 1.0, 12.0, 25.0),
child: DefaultButton(
TranslationBase.of(context).calculate,
() {
setState(() {
_visible == false ? _visible = !_visible : _visible = _visible;
calculateBloodSugar();
});
},
color: CustomColors.green,
), ),
SizedBox(
height: 24.0,
), ),
Visibility( );
visible: _visible, }
child: Container(
height: 115.0, Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
width: 350.0, return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.black), color: isEnable ? Colors.white : CustomColors.grey2.withOpacity(0.4),
borderRadius: BorderRadius.circular(15.0), border: Border.all(
color: Color(0xffefefef),
width: 1,
), ),
child: Padding( ),
padding: const EdgeInsets.all(8.0), child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Texts(TranslationBase.of(context).result + ": "),
Row(
children: [ children: [
Text( Text(
inputValue.toStringAsFixed(2), _labelText,
style: TextStyle(fontSize: 35.0),
),
Padding(
padding: EdgeInsets.only(left: 4.0, top: 10.0),
child: Text(
unit.toString(),
style: TextStyle( style: TextStyle(
color: Color(0xffC5273A), fontSize: 11,
fontSize: 15.0, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w500, color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
), ),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
], decoration: InputDecoration(
), isDense: true,
], hintText: _hintText,
fillColor: CustomColors.accentColor,
hintStyle: TextStyle(
fontSize: isEnable ? 14 : 24,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: isEnable ? Color(0xff575757) : CustomColors.black,
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
), ),
), ),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
), ),
), ),
], ],
), ),
), ),
), if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
Container(
margin: EdgeInsets.symmetric(horizontal: 16),
child: DefaultButton(TranslationBase.of(context).calculate, () {
setState(() {
_visible == false ? _visible = !_visible : _visible = _visible;
calculateBloodSugar();
});
}),
),
], ],
), ),
), ),

@ -1,13 +1,13 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
const activeCardColor = Color(0xff70777A); const activeCardColor = CustomColors.green;
const inactiveCardColor = Color(0xffFAFAFd); const inactiveCardColor = CustomColors.white;
class Triglycerides extends StatefulWidget { class Triglycerides extends StatefulWidget {
@override @override
@ -18,6 +18,7 @@ class _TriglyceridesState extends State<Triglycerides> {
Color cardMGColor = inactiveCardColor; Color cardMGColor = inactiveCardColor;
Color cardMMOLColor = inactiveCardColor; Color cardMMOLColor = inactiveCardColor;
int type; int type;
void updateColor(type) { void updateColor(type) {
//MG/DLT card //MG/DLT card
if (type == 1) { if (type == 1) {
@ -52,12 +53,20 @@ class _TriglyceridesState extends State<Triglycerides> {
bool _visible = false; bool _visible = false;
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
TextEditingController resultTextController = new TextEditingController();
String finalValue; String finalValue;
double inputValue = 0.0; double inputValue = 0.0;
String unit; String unit;
double conversionConst = 88.57; double conversionConst = 88.57;
@override
void initState() {
updateColor(1);
unit = 'mmol/l';
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -68,108 +77,108 @@ class _TriglyceridesState extends State<Triglycerides> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.7,
child: Column( child: Column(
//crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(child: Text(TranslationBase.of(context).triglycerides, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))),
Container( Container(
width: 350.0, margin: EdgeInsets.only(top: 10.0),
child: Text( child:
TranslationBase.of(context).triglyceridesConvertStatement, Text(TranslationBase.of(context).triglyceridesConvertStatement, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
//textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
),
), ),
SizedBox( SizedBox(
height: 15.0, height: 12.0,
), ),
Container( Container(
color: Colors.white,
height: 120.0,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
//crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0), padding: const EdgeInsets.only(top: 12.0),
child: Row( child: Text(TranslationBase.of(context).convertFrom, style: TextStyle(fontWeight: FontWeight.w600, fontSize: 16.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
children: [
Texts(TranslationBase.of(context).convertFrom)
],
),
), ),
SizedBox( SizedBox(
height: 9.0, height: 9.0,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
GestureDetector( Expanded(
child: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
updateColor(1); updateColor(1);
inputValue = inputValue = double.parse(textController.text);
double.parse(textController.text);
inputValue = inputValue / conversionConst; inputValue = inputValue / conversionConst;
unit = 'mmol/l'; unit = 'mmol/l';
}); });
}, },
child: Container( child: Container(
height: 65.0, clipBehavior: Clip.antiAlias,
width: 150.0,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0),
),
border: Border.all(width: 2, color: cardMGColor),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: Color(0xff000000).withOpacity(.05),
spreadRadius: 3, blurRadius: 27,
blurRadius: 7, offset: Offset(0, -3),
offset: Offset(
0, 3), // changes position of shadow
), ),
], ],
color: cardMGColor, color: Colors.white,
borderRadius: BorderRadius.circular(3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.all(8.0),
vertical: 0.0, horizontal: 18.0), child: Text(
child: Texts('MG/DLt TO \nMMOL/L'), 'MG/DLt to MMOL/L',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 13.0, letterSpacing: -0.64, color: CustomColors.darkGrey),
), ),
), ),
), ),
GestureDetector( ),
),
SizedBox(
width: 12.0,
),
Expanded(
child: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
updateColor(2); updateColor(2);
inputValue = inputValue = double.parse(textController.text);
double.parse(textController.text);
inputValue = inputValue * conversionConst; inputValue = inputValue * conversionConst;
unit = 'mg/dlt'; unit = 'mg/dlt';
}); });
}, },
child: Container( child: Container(
height: 65.0, clipBehavior: Clip.antiAlias,
width: 150.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: cardMMOLColor, borderRadius: BorderRadius.all(
borderRadius: BorderRadius.circular(3.0), Radius.circular(6.0),
),
border: Border.all(width: 2, color: cardMMOLColor),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: Color(0xff000000).withOpacity(.05),
spreadRadius: 3, blurRadius: 27,
blurRadius: 7, offset: Offset(0, -3),
offset: Offset(
0, 3), // changes position of shadow
), ),
], ],
color: Colors.white,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.all(8.0),
horizontal: 16.0), child: Text(
child: Texts('MG/DLt TO\n MMOL/L'), 'MMOL/L to MG/DLt',
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 13.0, letterSpacing: -0.64, color: CustomColors.darkGrey),
),
),
), ),
), ),
), ),
@ -178,100 +187,116 @@ class _TriglyceridesState extends State<Triglycerides> {
], ],
), ),
), ),
SizedBox(
height: 12.0,
), ),
inputWidget(TranslationBase.of(context).enterReadingValue, "0.0", textController),
SizedBox( SizedBox(
height: 25.0, height: 12.0,
), ),
Container( Visibility(
height: 65.0, visible: _visible,
decoration: BoxDecoration( child: inputWidget(TranslationBase.of(context).result, inputValue.toStringAsFixed(2) + " " + unit.toString(), resultTextController, isEnable: false),
borderRadius: BorderRadius.circular(6.0),
color: Colors.white,
), ),
child: TextFormField(
controller: textController,
inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.digitsOnly
], ],
keyboardType: TextInputType.number,
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black45)),
labelText: TranslationBase.of(context).enterReadingValue,
labelStyle: TextStyle(
color: Colors.black87,
), ),
), ),
), ),
bottomSheet: Container(
color: CustomColors.white,
padding: EdgeInsets.fromLTRB(12.0, 1.0, 12.0, 25.0),
child: DefaultButton(
TranslationBase.of(context).calculate.toUpperCase(),
() {
setState(() {
_visible == false ? _visible = !_visible : _visible = _visible;
calculateTriglycerides();
});
},
color: CustomColors.green,
), ),
SizedBox(
height: 25.0,
), ),
Visibility( );
visible: _visible, }
child: Container(
height: 115.0, Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
width: 350.0, return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.black), color: isEnable ? Colors.white : CustomColors.grey2.withOpacity(0.4),
borderRadius: BorderRadius.circular(15.0), border: Border.all(
color: Color(0xffefefef),
width: 1,
), ),
child: Padding( ),
padding: const EdgeInsets.all(8.0), child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Texts(TranslationBase.of(context).result + ":"),
Row(
children: [ children: [
Text( Text(
inputValue.toStringAsFixed(2), _labelText,
style: TextStyle(fontSize: 35.0),
),
Padding(
padding: EdgeInsets.only(left: 4.0, top: 10.0),
child: Text(
unit.toString(),
style: TextStyle( style: TextStyle(
color: Color(0xffC5273A), fontSize: 11,
fontSize: 15.0, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w500, color: Color(0xff2B353E),
), letterSpacing: -0.44,
),
),
],
),
],
),
), ),
), ),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
SizedBox( decoration: InputDecoration(
height: 10.0, isDense: true,
hintText: _hintText,
fillColor: CustomColors.accentColor,
hintStyle: TextStyle(
fontSize: isEnable ? 14 : 24,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: isEnable ? Color(0xff575757) : CustomColors.black,
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
), ),
Flexible(
child: Container(
height: 60.0,
width: 250.0,
child: SecondaryButton(
label:
TranslationBase.of(context).calculate.toUpperCase(),
onTap: () {
setState(() {
_visible == false
? _visible = !_visible
: _visible = _visible;
calculateTriglycerides();
});
},
), ),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
), ),
), ),
], ],
), ),
), ),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
), ),
), ),
); );

@ -88,11 +88,11 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
controller: _tabController, controller: _tabController,
children: [ children: [
Container( Container(
margin: EdgeInsets.all(20.0), // margin: EdgeInsets.all(20.0),
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(left: 12, right: 12), padding: EdgeInsets.only(left: 12, right: 12, top: 20.0),
child: GridView.builder( child: GridView.builder(
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,

@ -237,7 +237,8 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
buttonCancelText: Text(TranslationBase.of(context).cancel), buttonCancelText: Text(TranslationBase.of(context).cancel),
buttonCancelColor: Colors.grey, buttonCancelColor: Colors.grey,
onlyCancelButton: true, onlyCancelButton: true,
)); ),
);
}, },
child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white), child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white),
), ),

@ -1,328 +0,0 @@
import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SelectBloodDialog extends StatefulWidget {
final Blood bloodType;
final Function(Blood) onValueSelected;
SelectBloodDialog({Key key, this.bloodType, this.onValueSelected});
@override
_SelectBloodDialogState createState() => _SelectBloodDialogState(this.bloodType);
}
class _SelectBloodDialogState extends State<SelectBloodDialog> {
_SelectBloodDialogState(this.bloodType);
Blood bloodType;
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Container(
child: Column(
children: [
Divider(),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Oplus;
});
},
child: ListTile(
title: Text("O+"),
leading: Radio(
value: Blood.Oplus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Ominus;
});
},
child: ListTile(
title: Text("O-"),
leading: Radio(
value: Blood.Ominus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.ABminus;
});
},
child: ListTile(
title: Text("AB-"),
leading: Radio(
value: Blood.ABminus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.ABplus;
});
},
child: ListTile(
title: Text("AB+"),
leading: Radio(
value: Blood.ABplus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Aplus;
});
},
child: ListTile(
title: Text("A+"),
leading: Radio(
value: Blood.Aplus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Aminus;
});
},
child: ListTile(
title: Text("A-"),
leading: Radio(
value: Blood.Aminus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Bplus;
});
},
child: ListTile(
title: Text("B+"),
leading: Radio(
value: Blood.Bplus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
bloodType = Blood.Bminus;
});
},
child: ListTile(
title: Text("B-"),
leading: Radio(
value: Blood.Bminus,
groupValue: bloodType,
activeColor: Colors.red[800],
onChanged: (Blood value) {
setState(() {
bloodType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(bloodType);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
),
),
),
),
),
],
)
],
),
)
],
);
}
}

@ -46,17 +46,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
), ),
), ),
), ),
// Container(
// decoration: BoxDecoration(color: Colors.white),
// child: TextField(
// controller: doctorNameController,
// onChanged: (content) {
// _onDocTextChanged(content);
// },
// decoration: InputDecoration(labelText: TranslationBase.of(context).enterDocName, fillColor: Colors.white, prefixIcon: Icon(Icons.search), border: OutlineInputBorder())),
// ),
inputWidget(TranslationBase.of(context).enterDocName, '', doctorNameController), inputWidget(TranslationBase.of(context).enterDocName, '', doctorNameController),
], ],
), ),
), ),

@ -26,6 +26,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -666,14 +667,15 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
deleteFamily(family, context) { deleteFamily(family, context) {
ConfirmDialog dialog = new ConfirmDialog( showDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).removeFamilyMember, child: ConfirmWithMessageDialog(
okText: TranslationBase.of(context).confirm, message: TranslationBase.of(context).removeFamilyMember,
cancelText: TranslationBase.of(context).cancel_nocaps, onTap: () {
okFunction: () => {ConfirmDialog.closeAlertDialog(context), removeFamily(family, context)}, removeFamily(family, context);
cancelFunction: () => {}); },
dialog.showAlertDialog(context); ),
);
} }
removeFamily(GetAllSharedRecordsByStatusList family, context) { removeFamily(GetAllSharedRecordsByStatusList family, context) {

@ -0,0 +1,118 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class ClinicTimingsPage extends StatefulWidget {
final clinicName;
final List<PatientERGetClinicsServiceTimingsList> patientERGetClinicsServiceTimingsList;
ClinicTimingsPage({@required this.clinicName, @required this.patientERGetClinicsServiceTimingsList});
@override
_LiveCarePatmentPageState createState() => _LiveCarePatmentPageState();
}
class _LiveCarePatmentPageState extends State<ClinicTimingsPage> {
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).clinicSchedule,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
description: TranslationBase.of(context).erConsultation,
body: Container(
width: double.infinity,
height: double.infinity,
child: Column(
children: [
Expanded(
child: ListView.separated(
itemBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(top: index == 0 ? 12 : 0, bottom: (index == widget.patientERGetClinicsServiceTimingsList.length - 1) ? 12 : 0),
child: showItem(widget.patientERGetClinicsServiceTimingsList[index]),
);
},
separatorBuilder: (context, index) {
return mHeight(12);
},
itemCount: widget.patientERGetClinicsServiceTimingsList.length,
),
),
Container(
width: double.infinity,
padding: EdgeInsets.all(12),
color: Colors.white,
child: DefaultButton(
TranslationBase.of(context).back,
() {
Navigator.pop(context);
},
),
),
],
),
),
);
}
Widget showItem(PatientERGetClinicsServiceTimingsList item) {
return Container(
width: double.infinity,
padding: EdgeInsets.only(left: 12, right: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
item.dayOfWeekStr,
style: TextStyle(
fontSize: 13,
letterSpacing: -0.42,
fontWeight: FontWeight.w600,
),
),
),
Expanded(
flex: 3,
child: Container(
width: double.infinity,
decoration: cardRadius(12),
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
for (int i = 0; i < item.shiftTimings.length; i++)
Text(
TranslationBase.of(context).from + " " + item.shiftTimings[i].startTime + " " + TranslationBase.of(context).to + " " + item.shiftTimings[i].endTime,
style: TextStyle(
fontSize: 13,
letterSpacing: -0.42,
fontWeight: FontWeight.w600,
),
)
],
),
),
),
],
),
);
}
}

@ -0,0 +1,316 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class LiveCarePatmentPage extends StatefulWidget {
GetERAppointmentFeesList getERAppointmentFeesList;
int waitingTime;
String clinicName;
LiveCarePatmentPage({@required this.getERAppointmentFeesList, @required this.waitingTime, @required this.clinicName});
@override
_LiveCarePatmentPageState createState() => _LiveCarePatmentPageState();
}
class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
int _selected = 0;
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
final double itemWidth = size.width / 2;
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).livecare,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
description: TranslationBase.of(context).erConsultation,
body: Container(
width: double.infinity,
height: double.infinity,
child: Column(
children: [
Expanded(
child: Padding(
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text(
widget.clinicName,
style: TextStyle(
fontSize: 19.0,
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
),
),
mHeight(8),
Text(
TranslationBase.of(context).expectedWaiting,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.56,
color: CustomColors.textColor,
),
),
Text(
widget.waitingTime.toString() + " " + TranslationBase.of(context).minute,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: CustomColors.accentColor,
letterSpacing: -0.66,
),
),
mHeight(16),
Container(
decoration: cardRadius(12),
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).erConsultFee,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
),
mHeight(10),
Row(
children: [
Expanded(
child: Text(
TranslationBase.of(context).patientShareToDo,
style: TextStyle(
fontSize: 10,
letterSpacing: -0.4,
color: CustomColors.textColor,
fontWeight: FontWeight.w600,
),
),
),
Expanded(
child: Text(
widget.getERAppointmentFeesList.amount + " " + widget.getERAppointmentFeesList.currency,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
),
],
),
mHeight(4),
mDivider(CustomColors.lightGreyColor),
mHeight(4),
Row(
children: [
Expanded(
child: Text(
TranslationBase.of(context).patientTaxToDo,
style: TextStyle(
fontSize: 10,
letterSpacing: -0.4,
color: CustomColors.textColor,
fontWeight: FontWeight.w600,
),
),
),
Expanded(
child: Text(
widget.getERAppointmentFeesList.tax + " " + widget.getERAppointmentFeesList.currency,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
),
],
),
mHeight(4),
mDivider(CustomColors.lightGreyColor),
mHeight(4),
Row(
children: [
Expanded(
child: Text(
TranslationBase.of(context).patientShareTotalToDo,
style: TextStyle(
fontSize: 10,
letterSpacing: -0.4,
color: CustomColors.textColor,
fontWeight: FontWeight.w600,
),
),
),
Expanded(
child: Text(
widget.getERAppointmentFeesList.total + " " + widget.getERAppointmentFeesList.currency,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
),
],
),
],
),
),
mHeight(12),
Container(
padding: EdgeInsets.all(12),
decoration: cardRadius(12),
child: Row(
children: <Widget>[
SvgPicture.asset(
"assets/images/new/services/raise_comp.svg",
color: CustomColors.green,
width: 18,
height: 18,
),
mWidth(10),
Expanded(
child: Text(
TranslationBase.of(context).insuredPatient,
style: TextStyle(
fontSize: 10.0,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: <Widget>[
Radio(
value: 1,
groupValue: _selected,
onChanged: onRadioChanged,
),
Text(
TranslationBase.of(context).agreeTo,
style: new TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: CustomColors.textColor,
),
),
mWidth(4),
Text(
TranslationBase.of(context).termsConditoins,
style: new TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: CustomColors.accentColor,
),
),
],
),
),
mFlex(1),
Text(
TranslationBase.of(context).upComingPayOption,
style: new TextStyle(
fontSize: 12.0,
letterSpacing: -0.36,
fontWeight: FontWeight.w600,
),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: getPaymentMethods(),
),
],
),
),
),
Container(
padding: EdgeInsets.all(12),
color: Colors.white,
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).cancel,
() {
Navigator.pop(context, false);
},
),
),
mWidth(12),
Expanded(
child: DefaultButton(
TranslationBase.of(context).next,
() {
if (_selected == 0) {
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
} else {
Navigator.pop(context, true);
}
},
color: CustomColors.green,
),
),
],
),
),
],
),
),
);
}
void onRadioChanged(int value) {
setState(() {
_selected = value;
});
}
_getNormalText(text) {
return Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0),
child: Text(text, textAlign: TextAlign.start, style: TextStyle(fontSize: 14, letterSpacing: 0.5, color: Colors.black)),
);
}
_getMarginText(text) {
return Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0, bottom: 10.0),
child: Text(text, textAlign: TextAlign.start, style: TextStyle(fontSize: 14, letterSpacing: 0.5, fontWeight: FontWeight.bold, color: Colors.black)),
);
}
}

@ -1,15 +1,15 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class ScheduleClinicCard extends StatefulWidget { class ScheduleClinicCard extends StatefulWidget {
bool isSelected; bool isSelected;
final ClinicsHaveScheduleList clinicsHaveScheduleList; final ClinicsHaveScheduleList clinicsHaveScheduleList;
var languageID; var languageID;
ScheduleClinicCard( ScheduleClinicCard({this.isSelected, this.languageID, @required this.clinicsHaveScheduleList});
{this.isSelected,
this.languageID,
@required this.clinicsHaveScheduleList});
@override @override
_ScheduleClinicCardState createState() => _ScheduleClinicCardState(); _ScheduleClinicCardState createState() => _ScheduleClinicCardState();
@ -18,29 +18,68 @@ class ScheduleClinicCard extends StatefulWidget {
class _ScheduleClinicCardState extends State<ScheduleClinicCard> { class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
child: Card( width: double.infinity,
margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 8.0), margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 8.0),
color: widget.isSelected ? Color(0xff06b806) : Colors.white, clipBehavior: Clip.antiAlias,
shape: RoundedRectangleBorder( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(width: widget.isSelected ? 3 : 0, color: widget.isSelected ? CustomColors.green : Colors.transparent),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.transparent,
),
child: Container(
decoration: BoxDecoration(
color: CustomColors.green,
borderRadius: BorderRadius.all(
Radius.circular(6.0),
),
), ),
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.8, margin: EdgeInsets.only(
padding: EdgeInsets.all(12.0), left: projectViewModel.isArabic
? 0
: widget.isSelected
? 4
: 6,
right: projectViewModel.isArabic
? widget.isSelected
? 4
: 6
: 0),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
),
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
child: Text( child: Text(
widget.languageID == 'ar' widget.clinicsHaveScheduleList.clinicDesc,
? widget.clinicsHaveScheduleList.clinicDescN != null ? widget.clinicsHaveScheduleList.clinicDescN: ""
: widget.clinicsHaveScheduleList.clinicDesc != null ? widget.clinicsHaveScheduleList.clinicDesc: "Test Clinic",
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
color: color: Colors.black,
widget.isSelected ? Colors.white : Colors.black)), fontWeight: FontWeight.w600,
),
),
), ),
], ],
), ),

@ -1,24 +1,29 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LiveCareHistoryCard extends StatefulWidget { class LiveCareHistoryCard extends StatefulWidget {
ErRequestHistoryList erRequestHistoryList; ErRequestHistoryList erRequestHistoryList;
int isFirstOrLast;
LiveCareHistoryCard({this.erRequestHistoryList}); LiveCareHistoryCard({this.erRequestHistoryList, this.isFirstOrLast});
@override @override
_LiveCareHistoryCardState createState() => _LiveCareHistoryCardState(); _LiveCareHistoryCardState createState() => _LiveCareHistoryCardState();
@ -40,99 +45,160 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.only(left: 12, right: 12, top: widget.isFirstOrLast == 0 ? 12 : 6, bottom: widget.isFirstOrLast == 1 ? 12 : 6),
child: Card( decoration: BoxDecoration(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), color: CustomColors.accentColor,
color: Colors.white, borderRadius: BorderRadius.all(
shape: RoundedRectangleBorder( Radius.circular(10.0),
borderRadius: BorderRadius.circular(10), ),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
), ),
child: Container( child: Container(
width: MediaQuery.of(context).size.width, margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 0, right: projectViewModel.isArabic ? 0 : 0),
// height: MediaQuery.of(context).size.height * 0.22, padding: EdgeInsets.symmetric(vertical: 10, horizontal: 12),
padding: EdgeInsets.all(10.0), decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(10) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(10),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(10),
),
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Text(TranslationBase.of(context).requestedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), Text(
Container( widget.erRequestHistoryList.stringCallStatus ,
margin: EdgeInsets.only(top: 0.0), style: TextStyle(
child: Row( fontSize: 10.0,
mainAxisAlignment: MainAxisAlignment.spaceBetween, fontWeight: FontWeight.w600,
children: <Widget>[ letterSpacing: -0.4,
Text(DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.erRequestHistoryList.arrivalTime)), style: TextStyle(fontSize: 14.0)), color: CustomColors.green,
Text(TranslationBase.of(context).callDuration + "\n" + getCallTime(widget.erRequestHistoryList.callDuration), textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.grey[600])), //color: widget.erRequestHistoryList.stringCallStatus == "Completed" ? CustomColors.green : CustomColors.orange,
],
), ),
), ),
Container( mHeight(12),
padding: EdgeInsets.all(7.0), Text(
decoration: BoxDecoration( TranslationBase.of(context).requestedDate + ": " + DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.erRequestHistoryList.arrivalTime)),
shape: BoxShape.rectangle, style: TextStyle(
borderRadius: BorderRadius.all(Radius.circular(5)), fontSize: 16.0,
color: Colors.green, fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
), ),
margin: EdgeInsets.only(top: 5.0, bottom: 5.0), mHeight(4),
child: Text(widget.erRequestHistoryList.stringCallStatus, style: TextStyle(fontSize: 14.0, color: Colors.white)), Row(
children: <Widget>[
Text(
TranslationBase.of(context).callDuration + ": ",
style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w600, letterSpacing: -0.4, color: CustomColors.textColor),
),
Text(
getCallTime(widget.erRequestHistoryList.callDuration),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
), ),
Divider(
color: Colors.grey[500],
), ),
],
),mHeight(12),
Container( Container(
margin: EdgeInsets.all(5.0), width: double.infinity,
child: Flex( child: Row(
direction: Axis.horizontal, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
openInvoice(); openInvoice();
}, },
child: Container( child: Container(
padding: EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6),
decoration: containerRadius(CustomColors.devider, 100),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Icon(Icons.content_paste, color: Colors.red), SvgPicture.asset("assets/images/new/services/invoice_list.svg",width: 18,height: 18,),
Container( mWidth(10),
margin: EdgeInsets.only(left: 10.0), Text(
child: Text(TranslationBase.of(context).invoice, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)), TranslationBase.of(context).invoice,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 11.0,
letterSpacing: -0.46,
fontWeight: FontWeight.w600,
),
), ),
], ],
), ),
), ),
), ),
), ),
mWidth(12),
Expanded( Expanded(
flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
openComplaint(); openComplaint();
}, },
child: Container( child: Container(
padding: EdgeInsets.only(left: 12, right: 12, top: 7, bottom: 7),
decoration: containerRadius(CustomColors.devider, 100),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Icon(Icons.add, size: 24.0, color: Colors.red), SvgPicture.asset("assets/images/new/services/raise_comp.svg",width: 16,height: 16,),
Container( mWidth(10),
margin: EdgeInsets.only(left: 10.0), Expanded(
child: Text(TranslationBase.of(context).complaint, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)), child: AutoSizeText(
TranslationBase.of(context).complaint,
textAlign: TextAlign.center,
maxLines: 1,minFontSize: 8,
style: TextStyle(
fontSize: 11.0,
letterSpacing: -0.46,
fontWeight: FontWeight.w600,
),
),
), ),
], ],
), ),
), ),
), ),
), ),
mWidth(12),
Expanded( Expanded(
flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
rateLiveCareAppo(); rateLiveCareAppo();
}, },
child: Container( child: Container(
padding: EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6),
decoration: containerRadius(CustomColors.devider, 100),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Icon(Icons.star, size: 24.0, color: Colors.yellow[700]), Icon( Icons.star,size: 18,),
Container( mWidth(10),
width: MediaQuery.of(context).size.width * 0.2, Text(
margin: EdgeInsets.only(left: 9.0), TranslationBase.of(context).rate,
child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 11.0)), overflow: TextOverflow.clip,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 11.0,
letterSpacing: -0.46,
fontWeight: FontWeight.w600,
),
), ),
], ],
), ),
@ -145,17 +211,13 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
], ],
), ),
), ),
),
); );
} }
rateLiveCareAppo() { rateLiveCareAppo() {
if(widget.erRequestHistoryList.isAppointmentHaveRating) { if (widget.erRequestHistoryList.isAppointmentHaveRating) {
AppToast.showErrorToast(message: TranslationBase.of(context).alreadyRated); AppToast.showErrorToast(message: TranslationBase.of(context).alreadyRated);
} else { } else {}
}
} }
openInvoice() { openInvoice() {

@ -40,6 +40,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
height: 600.0, height: 600.0,
margin: EdgeInsets.all(20.0), margin: EdgeInsets.all(20.0),
width: 500.0, width: 500.0,
color: Colors.red,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -1,11 +1,17 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import '../clinic_timings_page.dart';
import 'ClinicTimingsDialog.dart'; import 'ClinicTimingsDialog.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
@ -32,14 +38,16 @@ class _State extends State<ClinicCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 8.0), margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 8.0),
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(width: 2, color: widget.isSelected ? CustomColors.green : Color(0xffEFEFEF)), border: Border.all(width: widget.isSelected ? 3 : 0, color: widget.isSelected ? CustomColors.green : Colors.transparent),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.05), color: Color(0xff000000).withOpacity(.05),
@ -47,30 +55,106 @@ class _State extends State<ClinicCard> {
offset: Offset(0, -3), offset: Offset(0, -3),
), ),
], ],
color: Colors.white), color: Colors.transparent,
),
child: Container(
decoration: BoxDecoration(
color: widget.patientERGetClinicsList.isOnline == 1 ? CustomColors.green : CustomColors.accentColor,
borderRadius: BorderRadius.all(
Radius.circular(6.0),
),
),
child: Container( child: Container(
padding: EdgeInsets.fromLTRB(12.0, 25.0, 12.0, 25.0), margin: EdgeInsets.only(
left: projectViewModel.isArabic
? 0
: widget.isSelected
? 4
: 6,
right: projectViewModel.isArabic ? widget.isSelected
? 4
: 6: 0),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
),
),
child: Row(
children: [
Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Text(
child: Text(widget.languageID == 'ar' ? widget.patientERGetClinicsList.serviceNameN : widget.patientERGetClinicsList.serviceName, widget.languageID == 'ar' ? widget.patientERGetClinicsList.serviceNameN : widget.patientERGetClinicsList.serviceName,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16)), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.48,
),
), ),
Row( Row(
children: [ children: [
Container( Container(
child: Text(".", style: TextStyle(fontSize: 30.0)), width: 4,
height: 4,
decoration: containerRadius(
widget.patientERGetClinicsList.isOnline == 1 ? CustomColors.green : CustomColors.accentColor,
100,
),
),
mWidth(4),
Text(
widget.patientERGetClinicsList.isOnline == 1 ? TranslationBase.of(context).onlineTag : TranslationBase.of(context).offlineTag,
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.w600,
color: widget.patientERGetClinicsList.isOnline == 1 ? CustomColors.green : CustomColors.accentColor,
letterSpacing: -0.48,
), ),
Container(
child: Text("Online"),
), ),
], ],
), ),
], ],
), ),
), ),
InkWell(
onTap: (){ getClinicTimings(widget.patientERGetClinicsList);},
child: Container(
padding: EdgeInsets.only(left: 8,right: 8,top: 4,bottom: 4),
decoration: containerRadius(CustomColors.devider, 100),
child: Row(
children: [
SvgPicture.asset(
"assets/images/new-design/ic_schedule.svg",
width: 16,
height: 16,
color: Colors.black,
),
mWidth(4),
Text(
TranslationBase.of(context).schedule,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
)
],
),
),
),
],
),
),
),
); );
} }
@ -84,26 +168,30 @@ class _State extends State<ClinicCard> {
clinicsServiceTimingsResponse = ClinicsServiceTimingsResponse.fromJson(res); clinicsServiceTimingsResponse = ClinicsServiceTimingsResponse.fromJson(res);
print(clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList.length); print(clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList.length);
showGeneralDialog( navigateTo(context, ClinicTimingsPage(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: ClinicTimingsDialog(
clinicName: patientERGetClinicsList.serviceName, clinicName: patientERGetClinicsList.serviceName,
patientERGetClinicsServiceTimingsList: clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList, patientERGetClinicsServiceTimingsList: clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList,
), ));
), // showGeneralDialog(
); // barrierColor: Colors.black.withOpacity(0.5),
}, // transitionBuilder: (context, a1, a2, widget) {
transitionDuration: Duration(milliseconds: 500), // final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
barrierDismissible: true, // return Transform(
barrierLabel: '', // transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
context: context, // child: Opacity(
pageBuilder: (context, animation1, animation2) {}); // opacity: a1.value,
// child: ClinicTimingsDialog(
// clinicName: patientERGetClinicsList.serviceName,
// patientERGetClinicsServiceTimingsList: clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList,
// ),
// ),
// );
// },
// transitionDuration: Duration(milliseconds: 500),
// barrierDismissible: true,
// barrierLabel: '',
// context: context,
// pageBuilder: (context, animation1, animation2) {});
}); });
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -29,6 +30,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../live_care_payment_page.dart';
class ClinicList extends StatefulWidget { class ClinicList extends StatefulWidget {
final Function getLiveCareHistory; final Function getLiveCareHistory;
@ -89,7 +92,9 @@ class _clinic_listState extends State<ClinicList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView(child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList()); return Container(
child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(),
);
} }
void startLiveCare() { void startLiveCare() {
@ -172,24 +177,8 @@ class _clinic_listState extends State<ClinicList> {
} }
showLiveCarePaymentDialog(GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) { showLiveCarePaymentDialog(GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) {
showGeneralDialog( navigateTo(context, LiveCarePatmentPage(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName)).then(
barrierColor: Colors.black.withOpacity(0.5), (value) {
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: LiveCarePaymentDialog(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {})
.then((value) {
if (value) { if (value) {
if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") {
showLiveCareInfoDialog(getERAppointmentFeesList); showLiveCareInfoDialog(getERAppointmentFeesList);
@ -197,7 +186,34 @@ class _clinic_listState extends State<ClinicList> {
navigateToPaymentMethod(getERAppointmentFeesList, context); navigateToPaymentMethod(getERAppointmentFeesList, context);
} }
} }
}); },
);
// showGeneralDialog(
// barrierColor: Colors.black.withOpacity(0.5),
// transitionBuilder: (context, a1, a2, widget) {
// final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
// return Transform(
// transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
// child: Opacity(
// opacity: a1.value,
// child: LiveCarePaymentDialog(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName),
// ),
// );
// },
// transitionDuration: Duration(milliseconds: 500),
// barrierDismissible: true,
// barrierLabel: '',
// context: context,
// pageBuilder: (context, animation1, animation2) {})
// .then((value) {
// if (value) {
// if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") {
// showLiveCareInfoDialog(getERAppointmentFeesList);
// } else {
// navigateToPaymentMethod(getERAppointmentFeesList, context);
// }
// }
// });
} }
showLiveCareInfoDialog(GetERAppointmentFeesList getERAppointmentFeesList) async { showLiveCareInfoDialog(GetERAppointmentFeesList getERAppointmentFeesList) async {
@ -435,12 +451,13 @@ class _clinic_listState extends State<ClinicList> {
return Column( return Column(
children: <Widget>[ children: <Widget>[
isDataLoaded isDataLoaded
? Container( ? Expanded(
height: MediaQuery.of(context).size.height * 0.7, child: Container(
child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0 child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
mHeight(10),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
@ -466,15 +483,14 @@ class _clinic_listState extends State<ClinicList> {
], ],
) )
: getNoDataWidget(context), : getNoDataWidget(context),
),
) )
: Container(), : Container(),
isDataLoaded isDataLoaded
? Align( ? Container(
alignment: FractionalOffset.bottomCenter, width: double.infinity,
child: Container( color: Colors.white,
width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(12),
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
@ -482,7 +498,7 @@ class _clinic_listState extends State<ClinicList> {
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color: CustomColors.accentColor,
textColor: Colors.white, textColor: Colors.white,
elevation: 0, elevation: 0,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
@ -491,7 +507,6 @@ class _clinic_listState extends State<ClinicList> {
child: Text(TranslationBase.of(context).start, style: TextStyle(fontSize: 18.0)), child: Text(TranslationBase.of(context).start, style: TextStyle(fontSize: 18.0)),
), ),
), ),
),
) )
: Container(), : Container(),
], ],
@ -502,8 +517,8 @@ class _clinic_listState extends State<ClinicList> {
return Column( return Column(
children: <Widget>[ children: <Widget>[
isDataLoaded isDataLoaded
? Container( ? Expanded(
height: MediaQuery.of(context).size.height * 0.75, child: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -546,23 +561,23 @@ class _clinic_listState extends State<ClinicList> {
}, },
), ),
Container( Container(
height: 50.0, height: 10.0,
), ),
], ],
)), )),
),
) )
: Container(), : Container(),
isDataLoaded isDataLoaded
? Align( ? Container(
alignment: FractionalOffset.bottomCenter, color: Colors.white,
child: Container( width: double.infinity,
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), padding: EdgeInsets.all(16),
color: Colors.grey[100], child: DefaultButton(
width: MediaQuery.of(context).size.width, TranslationBase.of(context).start,
height: 50.0, () {
child: DefaultButton(TranslationBase.of(context).start, () {
startLiveCare(); startLiveCare();
}), },
), ),
) )
: Container(), : Container(),

@ -30,7 +30,12 @@ class _LiveCareLogsState extends State<LiveCareLogs> {
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.erRequestHistoryList.length, itemCount: widget.erRequestHistoryList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return widget.erRequestHistoryList[index].callStatus < 4 ? Container() : LiveCareHistoryCard(erRequestHistoryList: widget.erRequestHistoryList[index]); return widget.erRequestHistoryList[index].callStatus < 4
? Container()
: LiveCareHistoryCard(
erRequestHistoryList: widget.erRequestHistoryList[index],
isFirstOrLast: index==0?0:(index==widget.erRequestHistoryList.length-1)?1:2,
);
}, },
), ),
) )

@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -16,7 +15,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -24,9 +23,6 @@ import 'package:flutter/material.dart';
import '../../../core/model/my_balance/AdvanceModel.dart'; import '../../../core/model/my_balance/AdvanceModel.dart';
import 'confirm_payment_page.dart'; import 'confirm_payment_page.dart';
import 'dialogs/SelectBeneficiaryDialog.dart';
import 'dialogs/SelectPatientFamilyDialog.dart';
import 'dialogs/SelectPatientInfoDialog.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
@ -87,16 +83,48 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
Text( Text(
TranslationBase.of(context).advancePaymentLabel, TranslationBase.of(context).advancePaymentLabel,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.46, letterSpacing: -0.64,
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
InkWell( InkWell(
onTap: () => confirmSelectBeneficiaryDialog(model), onTap: () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(TranslationBase.of(context).myAccount, 0),
RadioSelectionDialogModel(TranslationBase.of(context).myFamilyFiles, 1),
RadioSelectionDialogModel(TranslationBase.of(context).otherAccount, 2),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex:
beneficiaryType == BeneficiaryType.MyAccount ? 0 : (beneficiaryType == BeneficiaryType.MyFamilyFiles ? 1 : (beneficiaryType == BeneficiaryType.OtherAccount ? 2 : -1)),
onValueSelected: (index) {
var type;
if (index == 0) {
type = BeneficiaryType.MyAccount;
} else if (index == 1) {
type = BeneficiaryType.MyFamilyFiles;
} else {
type = BeneficiaryType.OtherAccount;
}
setState(() {
if (type == BeneficiaryType.MyAccount) {
_fileTextController.text = model.user.patientID.toString();
advanceModel.depositorName = model.user.firstName + " " + model.user.lastName;
} else
_fileTextController.text = "";
beneficiaryType = type;
});
},
),
);
},
child: Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
@ -118,10 +146,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
), ),
if (beneficiaryType == BeneficiaryType.MyFamilyFiles) if (beneficiaryType == BeneficiaryType.MyFamilyFiles) SizedBox(height: 12),
SizedBox(
height: 12,
),
if (beneficiaryType == BeneficiaryType.MyFamilyFiles) if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
InkWell( InkWell(
onTap: () { onTap: () {
@ -152,18 +177,13 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).fileNumber, hintText: TranslationBase.of(context).fileNumber,
controller: _fileTextController, controller: _fileTextController,
readOnly: beneficiaryType == BeneficiaryType.OtherAccount ? false : true, readOnly: beneficiaryType == BeneficiaryType.OtherAccount ? false : true,
), ),
if (beneficiaryType == BeneficiaryType.OtherAccount) if (beneficiaryType == BeneficiaryType.OtherAccount) SizedBox(height: 12),
SizedBox(
height: 12,
),
if (beneficiaryType == BeneficiaryType.OtherAccount) if (beneficiaryType == BeneficiaryType.OtherAccount)
InkWell( InkWell(
onTap: () { onTap: () {
@ -197,9 +217,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
InkWell( InkWell(
onTap: () => confirmSelectHospitalDialog(model.hospitals), onTap: () => confirmSelectHospitalDialog(model.hospitals),
child: Container( child: Container(
@ -223,9 +241,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).amount, hintText: TranslationBase.of(context).amount,
keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true), keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
@ -235,9 +251,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
}); });
}, },
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
if (model.user != null) if (model.user != null)
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).depositorEmail, hintText: TranslationBase.of(context).depositorEmail,
@ -246,9 +260,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
email = value; email = value;
}, },
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).notes, hintText: TranslationBase.of(context).notes,
controller: _notesTextController, controller: _notesTextController,
@ -334,74 +346,71 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
); );
} }
void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { int _selectedHospitalIndex = -1;
showDialog(
context: context,
child: SelectBeneficiaryDialog(
beneficiaryType: beneficiaryType,
onValueSelected: (value) {
setState(() {
if (value == BeneficiaryType.MyAccount) {
_fileTextController.text = model.user.patientID.toString();
advanceModel.depositorName = model.user.firstName + " " + model.user.lastName;
} else
_fileTextController.text = "";
beneficiaryType = value;
});
},
),
);
}
void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) { void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i),
];
showDialog( showDialog(
context: context, context: context,
child: SelectHospitalDialog( child: RadioSelectionDialog(
hospitals: hospitals, listData: list,
selectedHospital: _selectedHospital, selectedIndex: _selectedHospitalIndex,
onValueSelected: (value) { isScrollable: true,
setState(() { onValueSelected: (index) {
_selectedHospital = value; _selectedHospitalIndex = index;
}); _selectedHospital = hospitals[index];
setState(() {});
}, },
), ),
); );
} }
int _selectedPatientIndex = -1;
void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) { void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < patientInfoList.length; i++) RadioSelectionDialogModel(patientInfoList[i].fullName, i),
];
showDialog( showDialog(
context: context, context: context,
child: SelectPatientInfoDialog( child: RadioSelectionDialog(
patientInfoList: patientInfoList, listData: list,
selectedPatientInfo: _selectedPatientInfo, isScrollable: true,
onValueSelected: (value) { selectedIndex: _selectedPatientIndex,
setState(() { onValueSelected: (index) {
advanceModel.depositorName = value.fullName; _selectedPatientIndex = index;
_selectedPatientInfo = value; _selectedPatientInfo = patientInfoList[index];
}); advanceModel.depositorName = _selectedPatientInfo.fullName;
setState(() {});
}, },
), ),
); );
} }
int _selectedFamilyMemberIndex = -1;
void confirmSelectFamilyDialog(List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) { void confirmSelectFamilyDialog(List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
if (getAllSharedRecordsByStatusList.isNotEmpty) if (getAllSharedRecordsByStatusList.isNotEmpty) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < getAllSharedRecordsByStatusList.length; i++) RadioSelectionDialogModel(getAllSharedRecordsByStatusList[i].patientName, i),
];
showDialog( showDialog(
context: context, context: context,
child: SelectPatientFamilyDialog( child: RadioSelectionDialog(
getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, listData: list,
selectedPatientFamily: selectedPatientFamily, isScrollable: true,
onValueSelected: (value) { selectedIndex: _selectedFamilyMemberIndex,
setState(() { onValueSelected: (index) {
selectedPatientFamily = value; _selectedFamilyMemberIndex = index;
_fileTextController.text = selectedPatientFamily.responseID.toString(); selectedPatientFamily = getAllSharedRecordsByStatusList[index];
advanceModel.depositorName = value.patientName; setState(() {});
});
}, },
), ),
); );
} }
}
String getBeneficiaryType() { String getBeneficiaryType() {
switch (beneficiaryType) { switch (beneficiaryType) {

@ -1,204 +0,0 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../Constants.dart';
import '../advance_payment_page.dart';
class SelectBeneficiaryDialog extends StatefulWidget {
final BeneficiaryType beneficiaryType;
final Function(BeneficiaryType) onValueSelected;
SelectBeneficiaryDialog({Key key, this.beneficiaryType, this.onValueSelected});
@override
_SelectBeneficiaryDialogState createState() => _SelectBeneficiaryDialogState(this.beneficiaryType);
}
class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
_SelectBeneficiaryDialogState(this.beneficiaryType);
BeneficiaryType beneficiaryType;
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Container(
child: Column(
children: [
Divider(),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
beneficiaryType = BeneficiaryType.MyAccount;
});
},
child: ListTile(
title: Text(
TranslationBase.of(context).myAccount,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: BeneficiaryType.MyAccount,
groupValue: beneficiaryType,
activeColor: secondaryColor,
onChanged: (BeneficiaryType value) {
setState(() {
beneficiaryType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
beneficiaryType = BeneficiaryType.MyFamilyFiles;
});
},
child: ListTile(
title: Text(
TranslationBase.of(context).myFamilyFiles,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: BeneficiaryType.MyFamilyFiles,
groupValue: beneficiaryType,
activeColor: Color(0xffC5272D),
onChanged: (BeneficiaryType value) {
setState(() {
beneficiaryType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
beneficiaryType = BeneficiaryType.OtherAccount;
});
},
child: ListTile(
title: Text(
TranslationBase.of(context).otherAccount,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: BeneficiaryType.OtherAccount,
groupValue: beneficiaryType,
activeColor: Color(0xffC5272D),
onChanged: (BeneficiaryType value) {
setState(() {
beneficiaryType = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Color(0xffC5272D),
),
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(beneficiaryType);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
TranslationBase.of(context).ok.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
),
),
),
],
)
],
),
)
],
);
}
}

@ -7,6 +7,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// todo 'sikander' remove this file when usage known
class SelectCiteisDialog extends StatefulWidget { class SelectCiteisDialog extends StatefulWidget {
final List<CitiesModel> hospitals; final List<CitiesModel> hospitals;
final Function(CitiesModel) onValueSelected; final Function(CitiesModel) onValueSelected;

@ -1,145 +0,0 @@
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class SelectHospitalDialog extends StatefulWidget {
final List<HospitalsModel> hospitals;
final Function(HospitalsModel) onValueSelected;
HospitalsModel selectedHospital;
SelectHospitalDialog({Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override
_SelectHospitalDialogState createState() => _SelectHospitalDialogState();
}
class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
@override
void initState() {
super.initState();
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Divider(),
...List.generate(
widget.hospitals.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedHospital = widget.hospitals[index];
});
},
child: ListTile(
title: Text(
widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} ' + TranslationBase.of(context).km,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: widget.hospitals[index],
groupValue: widget.selectedHospital,
activeColor: secondaryColor,
onChanged: (value) {
setState(() {
widget.selectedHospital = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red
),
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedHospital);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
TranslationBase.of(context).ok,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
),
),
),
],
)
],
)
],
);
}
}

@ -1,152 +0,0 @@
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class SelectPatientFamilyDialog extends StatefulWidget {
final List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList;
final Function(GetAllSharedRecordsByStatusList) onValueSelected;
GetAllSharedRecordsByStatusList selectedPatientFamily;
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusApprovedList = new List();
SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected, this.selectedPatientFamily});
@override
_SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState();
}
class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
@override
void initState() {
super.initState();
widget.selectedPatientFamily = widget.selectedPatientFamily ?? widget.getAllSharedRecordsByStatusList[0];
if (widget.getAllSharedRecordsByStatusList.isNotEmpty)
widget.getAllSharedRecordsByStatusList.forEach((element) {
if (element.status == 3) widget.getAllSharedRecordsByStatusApprovedList.add(element);
});
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Divider(),
...List.generate(
widget.getAllSharedRecordsByStatusApprovedList.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedPatientFamily = widget.getAllSharedRecordsByStatusApprovedList[index];
});
},
child: ListTile(
title: Text(
widget.getAllSharedRecordsByStatusApprovedList[index].patientName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: widget.getAllSharedRecordsByStatusApprovedList[index],
groupValue: widget.selectedPatientFamily,
activeColor: secondaryColor,
onChanged: (value) {
setState(() {
widget.selectedPatientFamily = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red,
),
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedPatientFamily);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
TranslationBase.of(context).ok,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
),
),
),
],
)
],
)
],
);
}
}

@ -1,146 +0,0 @@
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class SelectPatientInfoDialog extends StatefulWidget {
final List<PatientInfo> patientInfoList;
final Function(PatientInfo) onValueSelected;
PatientInfo selectedPatientInfo;
SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected, this.selectedPatientInfo});
@override
_SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState();
}
class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
@override
void initState() {
super.initState();
widget.selectedPatientInfo = widget.selectedPatientInfo ?? widget.patientInfoList[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Divider(),
...List.generate(
widget.patientInfoList.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedPatientInfo = widget.patientInfoList[index];
});
},
child: ListTile(
title: Text(
widget.patientInfoList[index].fullName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: widget.patientInfoList[index],
groupValue: widget.selectedPatientInfo,
activeColor: secondaryColor,
onChanged: (value) {
setState(() {
widget.selectedPatientInfo = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red,
),
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedPatientInfo);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
TranslationBase.of(context).ok.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
),
),
),
),
],
)
],
)
],
);
}
}

@ -1,14 +1,16 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_svg/svg.dart';
import 'advance_payment_page.dart'; import 'advance_payment_page.dart';
@ -24,118 +26,156 @@ class MyBalancePage extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).myBalances, appBarTitle: TranslationBase.of(context).myWallet,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
description: TranslationBase.of(context).infoMyBalance, description: TranslationBase.of(context).infoMyBalance,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView( body: Column(
child: Container( children: [
margin: EdgeInsets.all(12), Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.fromLTRB(14, 12, 10, 12),
decoration: BoxDecoration(
color: Color(0xff2B353E),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
SvgPicture.asset(
"assets/images/new/services/balance_credit.svg",
height: 40,
width: 40,
color: Colors.white,
),
SizedBox(height: 6),
Text( Text(
TranslationBase.of(context).balanceAmount, TranslationBase.of(context).totalBalance,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, letterSpacing: -0.96,
letterSpacing: -0.46, fontWeight: FontWeight.bold,
color: Colors.white,
//height: 16/22
),
), ),
],
), ),
SizedBox(
height: 15,
), ),
Container( Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.fromLTRB(14, 10, 12, 10),
width: double.infinity,
height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red[700], color: Color(0xff3f4850),
shape: BoxShape.rectangle, borderRadius: BorderRadius.all(
borderRadius: BorderRadius.circular(7), Radius.circular(10.0),
), ),
child: Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
'${model.totalAdvanceBalanceAmount ?? 0} ' + TranslationBase.of(context).sar, double.parse(model.totalAdvanceBalanceAmount?.toString() ?? "0").toStringAsFixed(2),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 24,
fontWeight: FontWeight.w600, fontWeight: FontWeight.bold,
letterSpacing: -0.46, letterSpacing: -1.44,
height: 24 / 23,
color: Colors.white, color: Colors.white,
), ),
), ),
Text( Text(
TranslationBase.of(context).totalBalance, TranslationBase.of(context).sar,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
letterSpacing: -0.46, fontWeight: FontWeight.bold,
letterSpacing: -0.96,
color: Colors.white, color: Colors.white,
), ),
), ),
], ],
), ),
), ),
SizedBox( ],
height: 9, ),
), ),
...List.generate( SizedBox(height: 12),
model.patientAdvanceBalanceAmountList.length, ListView.separated(
(index) => Container( physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.all(8), shrinkWrap: true,
height: 65, itemBuilder: (cxt, index) {
margin: EdgeInsets.only(top: 8), PatientAdvanceBalanceAmount balanceAmount = model.patientAdvanceBalanceAmountList[index];
double amount = double.parse(balanceAmount.patientAdvanceBalanceAmount?.toString() ?? "0");
return Container(
padding: EdgeInsets.fromLTRB(14, 18, 14, 18),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.all(
shape: BoxShape.rectangle, Radius.circular(10.0),
borderRadius: BorderRadius.circular(12), ),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
), ),
],
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Expanded(
'${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} ' + TranslationBase.of(context).sar, child: Text(
balanceAmount.projectDescription,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
fontWeight: FontWeight.w600, letterSpacing: -0.64,
letterSpacing: -0.46, fontWeight: amount > 0 ? FontWeight.bold : FontWeight.w500,
color: Color(0xff2E303A),
),
), ),
), ),
Text( Text(
model.patientAdvanceBalanceAmountList[index].projectDescription, amount.toStringAsFixed(2) + " " + TranslationBase.of(context).sar,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
letterSpacing: -0.46, letterSpacing: -0.64,
fontWeight: amount > 0 ? FontWeight.bold : FontWeight.w500,
color: Color(0xff2E303A),
), ),
), ),
], ],
), ),
), );
), },
SizedBox( separatorBuilder: (cxt, index) => SizedBox(height: 12),
height: MediaQuery.of(context).size.height * 0.13, itemCount: model.patientAdvanceBalanceAmountList.length),
)
], ],
), ),
), ),
), ),
bottomSheet: Container( DefaultButton(
// height: MediaQuery.of(context).size.height * 0.12,
height: 70.0,
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(12),
child: DefaultButton(
// textColor: Colors.white,
// color: CustomColors.accentColor,
TranslationBase.of(context).createAdvancedPayment, TranslationBase.of(context).createAdvancedPayment,
() { () {
Navigator.push(context, FadePage(page: AdvancePaymentPage())); Navigator.push(context, FadePage(page: AdvancePaymentPage()));
}, },
), ).insideContainer,
],
), ),
), ),
); );

@ -9,7 +9,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -280,24 +280,6 @@ class _AddWeightPageState extends State<AddWeightPage> {
return " ${timeWeightDate.hour}:${timeWeightDate.minute}"; return " ${timeWeightDate.hour}:${timeWeightDate.minute}";
} }
void confirmSelectMeasureTimeDialog(List<String> list) {
showDialog(
context: context,
child: RadioStringDialog(
radioList: list,
title: TranslationBase.of(context).measureUnit,
selectedValue: measureTimeSelectedType,
onValueSelected: (value) {
setState(() {
measureTimeSelectedType = value;
weightUnit = list.indexOf(value);
validateForm();
});
},
),
);
}
void validateForm() { void validateForm() {
if (_weightValueController.text.length > 0 && measureTimeSelectedType != null) { if (_weightValueController.text.length > 0 && measureTimeSelectedType != null) {
setState(() { setState(() {

@ -6,10 +6,8 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -119,9 +117,6 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
}, },
), ),
); );
return;
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -277,24 +272,6 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
} }
void confirmSelectMeasureTimeDialog(List<String> list) {
showDialog(
context: context,
child: RadioStringDialog(
radioList: list,
title: TranslationBase.of(context).selectArm,
selectedValue: measureTimeSelectedType,
onValueSelected: (value) {
setState(() {
measureTimeSelectedType = value;
measuredArm = list.indexOf(value);
validateForm();
});
},
),
);
}
void validateForm() { void validateForm() {
print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString()); print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString());
if (_bloodSystolicValueController.text.length > 0 && _bloodDiastolicValueController.text.length > 0) { if (_bloodSystolicValueController.text.length > 0 && _bloodDiastolicValueController.text.length > 0) {

@ -8,8 +8,8 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -41,6 +41,8 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
String measureUnitSelectedType = 'mg/dlt'; String measureUnitSelectedType = 'mg/dlt';
int measuredTime = 1; int measuredTime = 1;
bool isButtonDisabled = true; bool isButtonDisabled = true;
int _selectedMeasureUnitIndex = 0;
final List<String> measureUnitList = ['mg/dlt', 'mol/L']; final List<String> measureUnitList = ['mg/dlt', 'mol/L'];
final List<String> measureTimeEnList = [ final List<String> measureTimeEnList = [
'Before Breakfast', 'Before Breakfast',
@ -66,6 +68,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
"صائم", "صائم",
"آخر", "آخر",
]; ];
int _selectedMeasureTimeIndex;
String measureTimeSelectedType; String measureTimeSelectedType;
@override @override
@ -92,15 +95,14 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
body: SingleChildScrollView( body: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( padding: EdgeInsets.all(21),
margin: EdgeInsets.all(15),
child: Column( child: Column(
children: [ children: [
SizedBox(
height: 15,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).sugarAdd, hintText: TranslationBase.of(context).sugarAdd,
controller: _bloodSugarValueController, controller: _bloodSugarValueController,
@ -109,9 +111,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 14, fontSize: 14,
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureUnitDialog(); confirmSelectMeasureUnitDialog();
@ -133,9 +133,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) { DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) {
@ -158,9 +156,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
@ -180,9 +176,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
), ),
), ),
), ),
SizedBox( SizedBox(height: 12),
height: 8,
),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
@ -218,14 +212,11 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
color: Colors.red[900], color: Colors.red[900],
), ),
onTap: () { onTap: () {
ConfirmDialog dialog = new ConfirmDialog( showDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).removeMeasure, child: ConfirmWithMessageDialog(
okText: TranslationBase.of(context).ok, message: TranslationBase.of(context).removeMeasure,
cancelText: TranslationBase.of(context).cancel, onTap: () async {
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) { widget.bloodSugarViewMode.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -238,23 +229,20 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
}); });
}, },
cancelFunction: () => {}); ),
dialog.showAlertDialog(context); );
}, },
) )
], ],
)) ),
)
: Container() : Container()
], ],
), ),
), ),
), ),
bottomSheet: Container( DefaultButton(
color: Theme.of(context).scaffoldBackgroundColor, TranslationBase.of(context).save,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton(
TranslationBase.of(context).save.toUpperCase(),
isButtonDisabled isButtonDisabled
? null ? null
: () async { : () async {
@ -291,9 +279,10 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
} }
}, },
disabledColor: Colors.grey, disabledColor: Colors.grey,
).insideContainer,
],
), ),
), );
));
} }
String getDate() { String getDate() {
@ -305,33 +294,41 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
} }
void confirmSelectMeasureUnitDialog() { void confirmSelectMeasureUnitDialog() {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel("mg/dlt", 0),
RadioSelectionDialogModel("mol/L", 1),
];
showDialog( showDialog(
context: context, context: context,
child: RadioStringDialog( child: RadioSelectionDialog(
radioList: measureUnitList, listData: list,
title: TranslationBase.of(context).measureUnit, selectedIndex: _selectedMeasureUnitIndex,
selectedValue: measureUnitSelectedType, onValueSelected: (index) {
onValueSelected: (value) { _selectedMeasureUnitIndex = index;
setState(() { measureUnitSelectedType = list[index].title;
measureUnitSelectedType = value; setState(() {});
});
}, },
), ),
); );
} }
void confirmSelectMeasureTimeDialog(List<String> list) { void confirmSelectMeasureTimeDialog(List<String> dataList) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < dataList.length; i++) RadioSelectionDialogModel(dataList[i], i),
];
showDialog( showDialog(
context: context, context: context,
child: RadioStringDialog( child: RadioSelectionDialog(
radioList: list, listData: list,
title: TranslationBase.of(context).measureTime, selectedIndex: _selectedMeasureTimeIndex,
selectedValue: measureTimeSelectedType, isScrollable: true,
onValueSelected: (value) { onValueSelected: (index) {
setState(() { _selectedMeasureTimeIndex = index;
measureTimeSelectedType = value; measureTimeSelectedType = list[index].title;
measuredTime = list.indexOf(value); measuredTime = index;
}); setState(() {});
}, },
), ),
); );

@ -171,7 +171,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model await model
.insertDeliveryOrder( .insertDeliveryOrder(
lineItemNo: 0, lineItemNo: 1,
longitude: longitude, longitude: longitude,
latitude: latitude, latitude: latitude,
appointmentNo: prescriptions.appointmentNo, appointmentNo: prescriptions.appointmentNo,

@ -107,7 +107,11 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
child: new TabBarView( child: new TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ children: [
isWeeklyDataLoaded ? getWeeklyHeartRateDetails() : Container(), isWeeklyDataLoaded
? avgWeeklyHearRateValue != 0
? getWeeklyHeartRateDetails()
: getNoDataWidget(context)
: Container(),
isMonthlyDataLoaded ? getMonthlyHeartRateDetails() : Container(), isMonthlyDataLoaded ? getMonthlyHeartRateDetails() : Container(),
isYearlyDataLoaded ? getYearlyHeartRateDetails() : Container() isYearlyDataLoaded ? getYearlyHeartRateDetails() : Container()
], ],
@ -135,9 +139,11 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
weeklyDataLength++; weeklyDataLength++;
} }
}); });
generateWeekData(); if (weekyHearRateList.isNotEmpty) generateWeekData();
setState(() { setState(() {
if (avgWeeklyHearRateValue != 0) {
weeklyStatsAvgValue = avgWeeklyHearRateValue ~/ weeklyDataLength; weeklyStatsAvgValue = avgWeeklyHearRateValue ~/ weeklyDataLength;
}
isWeeklyDataLoaded = true; isWeeklyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {

@ -9,7 +9,6 @@ import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchI
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -52,7 +51,19 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
], ],
body: Container( body: Container(
child: Platform.isIOS ? _getAppleWatchInstructions() : _getGoogleWatchInstructions(), child: Platform.isIOS ? _getAppleWatchInstructions() : _getGoogleWatchInstructions(),
)); ),
bottomSheet: Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 30.0),
child: DefaultButton(
TranslationBase.of(context).continues,
() {
_openHealthDataList();
},
color: Color(0xff359846),
),
),
);
} }
_getAppleWatchInstructions() { _getAppleWatchInstructions() {
@ -61,29 +72,15 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Flexible( Container(
child: CarouselSlider( width: double.infinity,
carouselController: buttonCarouselController, margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.9), child: Column(
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(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600)),
), ),
Container( Container(
child: Row( child: Row(
@ -94,9 +91,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row( child: Row(
children: [ children: [
Image.asset("assets/images/SmartWatches/apple-watch-1.jpeg", width: 70.0, height: 70.0), Image.asset("assets/images/SmartWatches/apple-watch-1.jpeg", width: 70.0, height: 70.0),
Container( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 1", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), child: Text("Apple Watch Series 1", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
) )
], ],
), ),
@ -108,9 +108,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row( child: Row(
children: [ children: [
Image.asset("assets/images/SmartWatches/apple-watch-2.jpg", width: 70.0, height: 70.0), Image.asset("assets/images/SmartWatches/apple-watch-2.jpg", width: 70.0, height: 70.0),
Container( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), child: Text("Apple Watch Series 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
) )
], ],
), ),
@ -129,9 +132,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row( child: Row(
children: [ children: [
Image.asset("assets/images/SmartWatches/apple-watch-3.jpg", width: 70.0, height: 70.0), Image.asset("assets/images/SmartWatches/apple-watch-3.jpg", width: 70.0, height: 70.0),
Container( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), child: Text("Apple Watch Series 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
) )
], ],
), ),
@ -143,9 +149,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row( child: Row(
children: [ children: [
Image.asset("assets/images/SmartWatches/apple-watch-4.jpg", width: 70.0, height: 70.0), Image.asset("assets/images/SmartWatches/apple-watch-4.jpg", width: 70.0, height: 70.0),
Container( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), child: Text("Apple Watch Series 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
) )
], ],
), ),
@ -164,9 +173,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row( child: Row(
children: [ children: [
Image.asset("assets/images/SmartWatches/apple-watch-5.jpg", width: 70.0, height: 70.0), Image.asset("assets/images/SmartWatches/apple-watch-5.jpg", width: 70.0, height: 70.0),
Container( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 5", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), child: Text("Apple Watch Series 5", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
) )
], ],
), ),
@ -178,9 +190,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row( child: Row(
children: [ children: [
Image.asset("assets/images/SmartWatches/Apple-Watch-6.png", width: 70.0, height: 70.0), Image.asset("assets/images/SmartWatches/Apple-Watch-6.png", width: 70.0, height: 70.0),
Container( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 6", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), child: Text("Apple Watch Series 6", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
) )
], ],
), ),
@ -199,9 +214,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row( child: Row(
children: [ children: [
Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0), Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0),
Container( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
) )
], ],
), ),
@ -213,9 +231,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row( child: Row(
children: [ children: [
Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0), Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0),
Container( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22, width: MediaQuery.of(context).size.width * 0.22,
child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)), child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
) )
], ],
), ),
@ -232,66 +253,14 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
), ),
Container( InkWell(
margin: EdgeInsets.fromLTRB(15.0, 40.0, 15.0, 0.0), onTap: () {
child: DefaultButton( showInstructionsDialog();
TranslationBase.of(context).continues,
() {
buttonCarouselController.nextPage();
},
color: Color(0xff359846),
),
),
],
)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).watchInstructions, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).iosInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).iosInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).iosInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Padding(
padding: const EdgeInsets.fromLTRB(12.0, 50.0, 12.0, 20.0),
child: Row(
children: [
Expanded(
child: DefaultButton(
TranslationBase.of(context).syncHealthData,
() {},
color: Color(0xFFD02127),
disabledColor: Color(0xff28323A).withOpacity(0.3),
),
),
mWidth(12),
if (hasAlreadySynced)
Expanded(
child: DefaultButton(
TranslationBase.of(context).alreadySynced,
() {
_openHealthDataList();
}, },
color: Color(0xff359846), child: Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Text(TranslationBase.of(context).watchInstructions,
style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline)),
), ),
), ),
], ],
@ -299,50 +268,19 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
), ),
], ],
), ),
));
},
);
}).toList(),
),
)
],
),
); );
} }
_getGoogleWatchInstructions() { _getGoogleWatchInstructions() {
return SingleChildScrollView( return SingleChildScrollView(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 10.0), child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600)),
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(
// enableInfiniteScroll: true,
viewportFraction: 0.99,
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.only(top: 16.0, bottom: 8.0),
// 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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)),
), ),
Container( Container(
child: Row( child: Row(
@ -488,143 +426,130 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
launch("https://wearos.google.com/#find-your-watch"); launch("https://wearos.google.com/#find-your-watch");
}, },
child: Container( child: Container(
margin: EdgeInsets.only(top: 20.0, left: 15.0, right: 15.0), margin: EdgeInsets.only(top: 20.0),
child: Text(TranslationBase.of(context).moreSupportedWatches, child: Text(TranslationBase.of(context).moreSupportedWatches, style: TextStyle(fontSize: 14.0, color: Colors.blue, decoration: TextDecoration.underline, letterSpacing: -0.36)),
textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.blue, decoration: TextDecoration.underline, letterSpacing: -0.36)),
), ),
), ),
Container( Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
), ),
Container( Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)), child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
), ),
Container( InkWell(
margin: EdgeInsets.all(15.0), onTap: () {
child: DefaultButton( showInstructionsDialog();
TranslationBase.of(context).continues,
() {
buttonCarouselController.nextPage();
}, },
color: CustomColors.green, child: Padding(
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
child: Text(TranslationBase.of(context).watchInstructions,
style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline)),
), ),
), ),
], ],
) ),
: Column( ),
);
}
showInstructionsDialog() {
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: Dialog(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), width: 350.0,
child: Text(TranslationBase.of(context).watchInstructions, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)), color: Colors.white,
), child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container( Container(
margin: EdgeInsets.all(10.0), width: MediaQuery.of(context).size.width,
child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), padding: EdgeInsets.all(20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(TranslationBase.of(context).smartWatches, style: TextStyle(fontSize: 22.0, color: Colors.black, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
IconButton(
icon: Icon(
Icons.close,
color: Colors.black,
),
onPressed: () {
Navigator.pop(context);
},
),
],
), ),
Container(
margin: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)),
), ),
Container( Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).androidInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
), ),
Platform.isIOS
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container( Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).androidInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), child: Text(TranslationBase.of(context).iosInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
), ),
Container( Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).androidInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), child: Text(TranslationBase.of(context).iosInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
), ),
Container( Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 21.0),
child: Text(TranslationBase.of(context).androidInstructions4, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)), child: Text(TranslationBase.of(context).iosInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
), ),
Padding( ],
padding: const EdgeInsets.fromLTRB(12.0, 50.0, 12.0, 20.0), )
child: Row( : Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Container(
child: DefaultButton( margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
TranslationBase.of(context).syncHealthData, child: Text(TranslationBase.of(context).androidInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
() {},
color: Color(0xFFD02127),
disabledColor: Color(0xff28323A).withOpacity(0.3),
), ),
Container(
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).androidInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
), ),
mWidth(12), Container(
if (hasAlreadySynced) margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
Expanded( child: Text(TranslationBase.of(context).androidInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
child: DefaultButton(
TranslationBase.of(context).alreadySynced,
() {
_openHealthDataList();
},
color: Color(0xff359846),
), ),
Container(
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).androidInstructions4, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
), ),
], ],
), ),
],
), ),
// Container(
// margin: EdgeInsets.fromLTRB(15.0, 75.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,
// elevation: 0,
// 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,
// elevation: 0,
// disabledTextColor: Colors.white,
// disabledColor: new Color(0xFFbcc2c4),
// onPressed: () {
// _openHealthDataList();
// },
// child: Text("ALREADY SYNCED", style: TextStyle(fontSize: 18.0)),
// ),
// ),
// )
// : Container(),
],
),
));
},
);
}).toList(),
), ),
)
], ],
), ),
),
),
); );
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
} }
getLastPatientRecord(BuildContext context) { getLastPatientRecord(BuildContext context) {

@ -50,10 +50,8 @@ class _PharmacyPageState extends State<PharmacyPage> {
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
//crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
BannerPager(model), BannerPager(model),
GridViewButtons(model),
PrescriptionsWidget(), PrescriptionsWidget(),
ShopByBrandWidget(), ShopByBrandWidget(),
RecentlyViewedWidget(), RecentlyViewedWidget(),

@ -31,6 +31,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
return Container( return Container(
color: Colors.white, color: Colors.white,
child: FractionallySizedBox( child: FractionallySizedBox(
@ -81,7 +82,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
height: 18, height: 18,
child: Center( child: Center(
child: Texts( child: Texts(
Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount.toString(), orderPreviewViewModel.cartResponse.quantityCount.toString(),
style: "caption", style: "caption",
medium: true, medium: true,
color: Colors.white, color: Colors.white,

@ -2,8 +2,6 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/phramacy-product-detail-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';

@ -1,10 +1,15 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/GridViewCard.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class BannerPager extends StatefulWidget { class BannerPager extends StatefulWidget {
final PharmacyModuleViewModel _model; final PharmacyModuleViewModel _model;
@ -20,14 +25,16 @@ class _BannerPagerState extends State<BannerPager> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
child: Column( child: Column(
children: [ children: [
CarouselSlider( CarouselSlider(
options: CarouselOptions( options: CarouselOptions(
aspectRatio: 7 / 2, aspectRatio: 5 / 2,
enlargeCenterPage: true, enlargeCenterPage: true,
enableInfiniteScroll: false, enableInfiniteScroll: false,
viewportFraction: 1.0,
initialPage: 0, initialPage: 0,
autoPlay: true, autoPlay: true,
autoPlayInterval: Duration(seconds: 3), autoPlayInterval: Duration(seconds: 3),
@ -39,53 +46,44 @@ class _BannerPagerState extends State<BannerPager> {
}); });
}, },
), ),
items: widget._model items: widget._model.getBannerImagesUrl(projectViewModel).mapIndexed(
.getBannerImagesUrl() (item, index) {
.mapIndexed( return InkWell(
(item, index) => InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(context, FadePage(page: OffersCategorisePage()));
context, FadePage(page: OffersCategorisePage()));
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 1.0), margin: EdgeInsets.symmetric(horizontal: 1.0),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5.0)), borderRadius: BorderRadius.all(Radius.circular(5.0)),
child: Center( child: Center(
child: index == 0 child: index == 0 || index == 1
? Image.asset( ? Image.asset(
item, item,
fit: BoxFit.cover, fit: BoxFit.cover,
) )
: CachedNetworkImage( : CachedNetworkImage(imageUrl: item, fit: BoxFit.fitWidth, errorWidget: (context, url, error) => SizedBox()),
imageUrl: item,
fit: BoxFit.fitWidth,
errorWidget: (context, url, error) =>
SizedBox()),
),
), ),
), ),
), ),
) );
.toList(), },
).toList(),
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: widget._model children: widget._model
.getBannerImagesUrl() .getBannerImagesUrl(projectViewModel)
.mapIndexed( .mapIndexed(
(item, index) => Container( (item, index) => Container(
width: 12.0, width: 12.0,
height: 4.0, height: 4.0,
margin: margin: EdgeInsets.symmetric(vertical: 0.0, horizontal: 2.0),
EdgeInsets.symmetric(vertical: 0.0, horizontal: 2.0),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
color: _current == index color: _current == index ? Color.fromRGBO(0, 250, 0, 0.9) : Color.fromRGBO(0, 0, 0, 0.4),
? Color.fromRGBO(0, 250, 0, 0.9)
: Color.fromRGBO(0, 0, 0, 0.4),
), ),
), ),
) )

@ -39,44 +39,44 @@ class GridViewButtons extends StatelessWidget {
Navigator.push(context, FadePage(page: OffersCategorisePage())); Navigator.push(context, FadePage(page: OffersCategorisePage()));
}), }),
), ),
DashboardItem( // DashboardItem(
imageName: 'pharmacy_module/bg_2.png', // imageName: 'pharmacy_module/bg_2.png',
opacity: 0, // opacity: 0,
hasColorFilter: false, // hasColorFilter: false,
child: GridViewCard(TranslationBase.of(context).medicationRefill, // child: GridViewCard(TranslationBase.of(context).medicationRefill,
'assets/images/pharmacy_module/medication_icon.png', () { // 'assets/images/pharmacy_module/medication_icon.png', () {
Navigator.push(
context, FadePage(page: HomePrescriptionsPage()));
// model.checkUserIsActivated().then((isActivated) {
// if (isActivated) {
// Navigator.push(context, FadePage(page: LakumMainPage()));
// } else {
// Navigator.push( // Navigator.push(
// context, FadePage(page: LakumActivationVidaPage())); // context, FadePage(page: HomePrescriptionsPage()));
// } //
// }); // // model.checkUserIsActivated().then((isActivated) {
}), // // if (isActivated) {
), // // Navigator.push(context, FadePage(page: LakumMainPage()));
DashboardItem( // // } else {
imageName: 'pharmacy_module/bg_3.png', // // Navigator.push(
opacity: 0, // // context, FadePage(page: LakumActivationVidaPage()));
hasColorFilter: false, // // }
child: GridViewCard(TranslationBase.of(context).myPrescriptions, // // });
'assets/images/pharmacy_module/prescription_icon.png', () { // }),
Navigator.push( // ),
context, FadePage(page: HomePrescriptionsPage())); // DashboardItem(
}), // imageName: 'pharmacy_module/bg_3.png',
), // opacity: 0,
DashboardItem( // hasColorFilter: false,
imageName: 'pharmacy_module/bg_4.png', // child: GridViewCard(TranslationBase.of(context).myPrescriptions,
opacity: 0, // 'assets/images/pharmacy_module/prescription_icon.png', () {
hasColorFilter: false, // Navigator.push(
child: GridViewCard( // context, FadePage(page: HomePrescriptionsPage()));
TranslationBase.of(context).searchAndScanMedication, // }),
'assets/images/pharmacy_module/search_scan_icon.png', // ),
() {Navigator.push(context, FadePage(page: SearchProductsPage()));}), // DashboardItem(
), // imageName: 'pharmacy_module/bg_4.png',
// opacity: 0,
// hasColorFilter: false,
// child: GridViewCard(
// TranslationBase.of(context).searchAndScanMedication,
// 'assets/images/pharmacy_module/search_scan_icon.png',
// () {Navigator.push(context, FadePage(page: SearchProductsPage()));}),
// ),
], ],
), ),
), ),

@ -1,8 +1,6 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';

@ -25,18 +25,7 @@ class LiveCareService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0
@ -60,18 +49,7 @@ class LiveCareService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0
@ -95,19 +73,8 @@ class LiveCareService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"ServiceID": serviceID, "ServiceID": serviceID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0
@ -154,18 +121,8 @@ class LiveCareService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"ServiceID": serviceID, "ServiceID": serviceID,
"DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0
@ -189,21 +146,9 @@ class LiveCareService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"ServiceID": serviceID, "ServiceID": serviceID,
"ProjectID": 15, "ProjectID": 15,
"DeviceTypeID": req.DeviceTypeID,
"PatientType": authUser.patientType != null ? authUser.patientType : 0,
"PatientTypeID": authUser.patientType != null ? authUser.patientType : 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0
@ -227,21 +172,9 @@ class LiveCareService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"ServiceID": serviceID, "ServiceID": serviceID,
"ProjectID": 15, "ProjectID": 15,
"DeviceTypeID": req.DeviceTypeID,
"PatientType": authUser.patientType != null ? authUser.patientType : 0,
"PatientTypeID": authUser.patientType != null ? authUser.patientType : 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0
@ -271,15 +204,7 @@ class LiveCareService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"ErServiceID": serviceID, "ErServiceID": serviceID,
"ClientRequestID": clientRequestID, "ClientRequestID": clientRequestID,
"DeviceToken": deviceToken, "DeviceToken": deviceToken,
@ -287,9 +212,6 @@ class LiveCareService extends BaseService {
"Latitude": "24.708488", "Latitude": "24.708488",
"Longitude": "46.665925", "Longitude": "46.665925",
"DeviceType": Platform.isIOS ? 'iOS' : 'Android', "DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"PatientType": authUser.patientType != null ? authUser.patientType : 0,
"PatientTypeID": authUser.patientType != null ? authUser.patientType : 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0

@ -795,6 +795,8 @@ class TranslationBase {
String get myBalances => localizedValues['MyBalances'][locale.languageCode]; String get myBalances => localizedValues['MyBalances'][locale.languageCode];
String get myWallet => localizedValues['MyWallet'][locale.languageCode];
String get balanceAmount => localizedValues['BalanceAmount'][locale.languageCode]; String get balanceAmount => localizedValues['BalanceAmount'][locale.languageCode];
String get totalBalance => localizedValues['TotalBalance'][locale.languageCode]; String get totalBalance => localizedValues['TotalBalance'][locale.languageCode];
@ -2565,6 +2567,17 @@ class TranslationBase {
String get androidInstructions4 => localizedValues["android-instructions-4"][locale.languageCode]; String get androidInstructions4 => localizedValues["android-instructions-4"][locale.languageCode];
String get tamaraInstPlan => localizedValues["tamaraInstPlan"][locale.languageCode]; String get tamaraInstPlan => localizedValues["tamaraInstPlan"][locale.languageCode];
String get onlineTag => localizedValues["onlineTag"][locale.languageCode];
String get offlineTag => localizedValues["offlineTag"][locale.languageCode];
String get viewDocList => localizedValues["viewDocList"][locale.languageCode];
String get bodyFatTitle => localizedValues["bodyFatTitle"][locale.languageCode];
String get cholesTitle => localizedValues["cholesTitle"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,139 +0,0 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RadioStringDialog extends StatefulWidget {
final List<String> radioList;
final Function(String) onValueSelected;
final String title;
String selectedValue;
RadioStringDialog({Key key, this.radioList, this.onValueSelected, this.selectedValue, this.title});
@override
_RadioStringDialogState createState() => _RadioStringDialogState();
}
class _RadioStringDialogState extends State<RadioStringDialog> {
@override
void initState() {
super.initState();
widget.selectedValue = widget.selectedValue ?? widget.radioList[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
title: Container(
width: double.infinity,
child: Center(
child: Texts(
widget.title,
textAlign: TextAlign.center,
))),
children: [
Container(
height: widget.radioList.length > 3 ? MediaQuery.of(context).size.height * 0.6 : null,
child: SingleChildScrollView(
child: Column(
children: [
Divider(),
...List.generate(
widget.radioList.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// SizedBox(
// height: 2,
// ),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedValue = widget.radioList[index];
});
},
child: ListTile(
title: Texts(
widget.radioList[index],
fontSize: 14,
),
leading: Radio(
value: widget.radioList[index],
groupValue: widget.selectedValue,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedValue = value;
});
},
),
),
),
)
],
),
],
),
),
SizedBox(
height: 5.0,
),
],
),
),
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedValue);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
),
),
),
),
),
],
)
],
);
}
}

@ -346,7 +346,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
actions: <Widget>[ actions: <Widget>[
(widget.isPharmacy && widget.showPharmacyCart) (widget.isPharmacy && widget.showPharmacyCart)
? IconButton( ? IconButton(
icon: Badge(badgeContent: Text(_badgeText), child: Icon(Icons.shopping_cart)), icon: Badge(badgeContent: Text(orderPreviewViewModel.cartResponse.quantityCount.toString()), child: Icon(Icons.shopping_cart)),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.of(context).popUntil(ModalRoute.withName('/')); Navigator.of(context).popUntil(ModalRoute.withName('/'));

Loading…
Cancel
Save