Merge branch 'development_new_design_2.0' into mirza_home_page

# Conflicts:
#	lib/pages/landing/widgets/logged_slider_view.dart
#	lib/uitl/translations_delegate_base.dart
merge-requests/390/head
Mirza.Shafique 4 years ago
commit 82a1d410db

@ -99,7 +99,7 @@
<!-- Geofencing -->
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"/>
android:value="AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"/>
<!-- Don't delete the meta-data below.

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -257,6 +257,8 @@ const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtu
const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const APPLE_PAY_INSERT_REQUEST = 'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert';
const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
@ -294,7 +296,8 @@ const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoF
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
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_DWH";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS";

@ -1226,7 +1226,7 @@ const Map localizedValues = {
"en": "Choose one of the following symptoms to show the right doctors or choose a consultation to show all",
"ar": "اختر أحد الأعراض التالية لتظهر للأطباء المناسبين أو اختر استشارة لإظهار الكل"
},
"continue": {"en": "CONTINUE", "ar": "إستمرار"},
"continue": {"en": "Continue", "ar": "إستمرار"},
"skip": {"en": "SKIP", "ar": "تخطى"},
"calorieCalcDesc": {
"en": "Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity ",
@ -1418,10 +1418,7 @@ const Map localizedValues = {
},
"dental-procedure-list": {"en": "Dental Procedures for this Appointment: ", "ar": "إجراءات الأسنان لهذا الموعد:"},
"time-needed": {"en": "Time Needed:", "ar": "الوقت اللازم:"},
"total-time-needed": {
"en": "Total Appointment Time:",
"ar": "وقت المواعيد الكلي:"
},
"total-time-needed": {"en": "Total Appointment Time:", "ar": "وقت المواعيد الكلي:"},
"info-eye": {
"en": "This service allows you to view all the eye measurements, lenses, and eyeglasses that have been made in the Habib Medical Group.",
"ar": " خدمة قياسات النظر: هذه الخدمة تمكنك من الاطلاع على جميع قياسات النظر والعدسات والنظارات التي تمت في مجموعة الحبيب الطبية."
@ -1435,31 +1432,39 @@ const Map localizedValues = {
"ar": "متابعة قراءاتي: هذه الخدمة تمكنك من تسجيل قراءات قياس السكر والضغط والوزن بشكل دوري ومن ثم الاطلاع عليها كمرجع وكذلك الاطلاع على الرسوم البيانية لمتابعة تطور الحالة."
},
"info-health-data": {
"en": "This service is designed to allows you to synchronize the health data from your smart watches into your health record system in Habib Medical Group so that the doctors you are visiting can analyze your health & activity level.",
"en":
"This service is designed to allows you to synchronize the health data from your smart watches into your health record system in Habib Medical Group so that the doctors you are visiting can analyze your health & activity level.",
"ar": "تم تصميم هذه الخدمة للسماح لك بمزامنة البيانات الصحية من ساعاتك الذكية الى نظام السجلات الصحية الخاص بك في مجموعة حبيب الطبية حتى يتمكن الأطباء الذين تزورهم من تحليل مستوى صحتك ونشاطك."
},
"info-ask-doc": {
"en": "This service allows you to ask the doctor you have visited during the last 14 days. When you receive a response from the doctor, you will be notified via the system to view the doctor's reply.",
"en":
"This service allows you to ask the doctor you have visited during the last 14 days. When you receive a response from the doctor, you will be notified via the system to view the doctor's reply.",
"ar": "اسال طبيبك: هذه الخدمة تمكنك من توجيه استفسارات الى الطبيب الذي قمت بزيارته خلال اخر 14 يوم وكذلك عند تلقى الرد من الطبيب سوف يتم ابلاغك عن طريق النظام للاطلاع على رد الطبيب."
},
"info-auto-wifi": {
"en": "This service allows you to connect to the Internet directly without the need for entering a user name or password.",
"ar": "الاتصال بالانترنت: هذه الخدمة تمكنك من الاتصال بالانترنت مباشرة دون الحاجة الى اسم مستخدم او كلمة مرور."
},
"auto-wifi": {
"en": "Connect To Internet",
"ar": "الإتصال بالإنترنت"
},
"auto-wifi": {"en": "Connect To Internet", "ar": "الإتصال بالإنترنت"},
"child-vaccine-info": {
"en": "This service to remind you of the deadlines of the necessary vaccinations for your childs against diseases targeted by immunization according to the MOH vaccinations schedule by sending a reminding message and notifications of the vaccination date to the registered mobile phone.",
"ar": "هذه الخدمة تم تصميمها لتذكيرك بالمواعيد النهائية للتحصينات اللازمة لطفلك ضد الأمراض المستهدفة بالتحصين وفقًا لجدول تطعيمات وزارة الصحة عن طريق إرسال رسالة تذكير وإشعارات عن مواعيد التطعيم على الجوال المسجل."
"en":
"This service to remind you of the deadlines of the necessary vaccinations for your childs against diseases targeted by immunization according to the MOH vaccinations schedule by sending a reminding message and notifications of the vaccination date to the registered mobile phone.",
"ar":
"هذه الخدمة تم تصميمها لتذكيرك بالمواعيد النهائية للتحصينات اللازمة لطفلك ضد الأمراض المستهدفة بالتحصين وفقًا لجدول تطعيمات وزارة الصحة عن طريق إرسال رسالة تذكير وإشعارات عن مواعيد التطعيم على الجوال المسجل."
},
"h2o-info": {
"en": "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.",
"ar": "تم تصميم هذه الخدمة لمساعدتك في تحديد وتتبع كميات المياه التي يتوجب شربها بشكل يومي. كما توفر هذه الخدمة تذكيرات الجدول الزمني وتقدم تحليلًا إحصائيًا لمقدار ما استهلكته خلال اليوم أو الأسبوع أو الشهر."
},
"ask-doc-empty": {
"en": "This service is available to doctors visited during the past 15 days",
"ar": "هذه الخدمة متاحة للاطباء الذين تمت زيارتهم خلال ال 15 يوم الماضية"
"en":
"This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.",
"ar":
"تم تصميم هذه الخدمة لمساعدتك في تحديد وتتبع كميات المياه التي يتوجب شربها بشكل يومي. كما توفر هذه الخدمة تذكيرات الجدول الزمني وتقدم تحليلًا إحصائيًا لمقدار ما استهلكته خلال اليوم أو الأسبوع أو الشهر."
},
"sys/dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"},
"arm": {"en": "Arm", "ar": "الذراع"},
"remove-measure": {"en": "Remove this measure", "ar": "إزالة هذا القياس؟"},
"select-arm": {"en": "Select the Arm", "ar": "إختر الذراع"},
"ask-doc-empty": {"en": "This service is available to doctors visited during the past 15 days", "ar": "هذه الخدمة متاحة للاطباء الذين تمت زيارتهم خلال ال 15 يوم الماضية"},
"online-clinics": {"en": "Online Clinics: ", "ar": "​العيادات المفتوحة: "},
"offline-clinics": {"en": "Offline Clinics: ", "ar": "العيادات المغلقة: "},
"clinic-schedule": {"en": "Clinic Schedule", "ar": "جدول العيادة"},
};

@ -14,6 +14,7 @@ class RequestInsuranceApprovalModel {
int patientType;
int eXuldAPPNO;
int projectID;
int appointmentNo;
RequestInsuranceApprovalModel(
{this.versionID,
@ -30,7 +31,8 @@ class RequestInsuranceApprovalModel {
this.patientTypeID,
this.patientType,
this.eXuldAPPNO,
this.projectID});
this.projectID,
this.appointmentNo});
RequestInsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];
@ -48,6 +50,7 @@ class RequestInsuranceApprovalModel {
patientType = json['PatientType'];
eXuldAPPNO = json['EXuldAPPNO'];
projectID = json['ProjectID'];
appointmentNo = json['AppointmentNo'];
}
Map<String, dynamic> toJson() {
@ -67,6 +70,7 @@ class RequestInsuranceApprovalModel {
data['PatientType'] = this.patientType;
data['EXuldAPPNO'] = this.eXuldAPPNO;
data['ProjectID'] = this.projectID;
data['AppointmentNo'] = this.appointmentNo;
return data;
}
}

@ -216,7 +216,7 @@ class InsuranceApprovalModel {
eApprovalRemarks = json['EApprovalRemarks'];
isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval'];
eAuthorizationID = json['EAuthorizationID'];
if (json['ApporvalDetails'] != null) {
if (json['ApporvalDetails'] != null && json['ApporvalDetails'].length != 0) {
apporvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]);
}
approvalStatusDescption = json['ApprovalStatusDescption'];
@ -239,7 +239,7 @@ class InsuranceApprovalModel {
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
qR = json['QR'];
speciality = json['Speciality'].cast<String>();
if (json['Speciality'] != null) speciality = json['Speciality'].cast<String>();
strApprovalDate = json['StrApprovalDate'];
strExpiryDate = json['StrExpiryDate'];
strSubmitDate = json['StrSubmitDate'];

@ -67,21 +67,19 @@ class InsuranceCardService extends BaseService {
Future getInsuranceApproval({int appointmentNo}) async {
hasError = false;
// _cardList.clear();
if (appointmentNo != null) {
// _requestInsuranceApprovalModel.appointmentNo = appointmentNo;
_requestInsuranceApprovalModel.eXuldAPPNO = null;
_requestInsuranceApprovalModel.projectID = null;
_requestInsuranceApprovalModel.appointmentNo = appointmentNo;
_requestInsuranceApprovalModel.eXuldAPPNO = 0;
_requestInsuranceApprovalModel.projectID = 0;
} else {
// _requestInsuranceApprovalModel.appointmentNo = null;
_requestInsuranceApprovalModel.appointmentNo = 0;
_requestInsuranceApprovalModel.eXuldAPPNO = 0;
_requestInsuranceApprovalModel.projectID = 0;
}
_insuranceApproval.clear();
_insuranceApproval.length = 0;
await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, onSuccess: (dynamic response, int statusCode) {
print(response['HIS_Approval_List'].length);
_insuranceApproval.clear();
_insuranceApproval.length = 0;
response['HIS_Approval_List'].forEach((item) {
_insuranceApproval.add(InsuranceApprovalModel.fromJson(item));
});

@ -0,0 +1,152 @@
class ApplePayInsertRequest {
String clientRequestID;
int clinicID;
String currency;
String customerEmail;
int customerID;
String customerName;
String deviceToken;
int doctorID;
String projectID;
String serviceID;
int channelID;
int patientID;
int patientTypeID;
int patientOutSA;
dynamic appointmentDate;
int appointmentNo;
String orderDescription;
String liveServiceID;
String latitude;
String longitude;
String amount;
String isSchedule;
String language;
int userName;
String responseContinueURL;
String backClickUrl;
String paymentOption;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
ApplePayInsertRequest(
{this.clientRequestID,
this.clinicID,
this.currency,
this.customerEmail,
this.customerID,
this.customerName,
this.deviceToken,
this.doctorID,
this.projectID,
this.serviceID,
this.channelID,
this.patientID,
this.patientTypeID,
this.patientOutSA,
this.appointmentDate,
this.appointmentNo,
this.orderDescription,
this.liveServiceID,
this.latitude,
this.longitude,
this.amount,
this.isSchedule,
this.language,
this.userName,
this.responseContinueURL,
this.backClickUrl,
this.paymentOption,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID});
ApplePayInsertRequest.fromJson(Map<String, dynamic> json) {
clientRequestID = json['ClientRequestID'];
clinicID = json['ClinicID'];
currency = json['Currency'];
customerEmail = json['CustomerEmail'];
customerID = json['CustomerID'];
customerName = json['CustomerName'];
deviceToken = json['DeviceToken'];
doctorID = json['DoctorID'];
projectID = json['ProjectID'];
serviceID = json['Service_ID'];
channelID = json['Channel_ID'];
patientID = json['PatientID'];
patientTypeID = json['PatientTypeID'];
patientOutSA = json['PatientOutSA'];
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
orderDescription = json['OrderDescription'];
liveServiceID = json['Live_ServiceID'];
latitude = json['Latitude'];
longitude = json['Longitude'];
amount = json['Amount'];
isSchedule = json['IsSchedule'];
language = json['Language'];
userName = json['userName'];
responseContinueURL = json['ResponseContinueURL'];
backClickUrl = json['BackClickUrl'];
paymentOption = json['PaymentOption'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClientRequestID'] = this.clientRequestID;
data['ClinicID'] = this.clinicID;
data['Currency'] = this.currency;
data['CustomerEmail'] = this.customerEmail;
data['CustomerID'] = this.customerID;
data['CustomerName'] = this.customerName;
data['DeviceToken'] = this.deviceToken;
data['DoctorID'] = this.doctorID;
data['ProjectID'] = this.projectID;
data['Service_ID'] = this.serviceID;
data['Channel_ID'] = this.channelID;
data['PatientID'] = this.patientID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientOutSA'] = this.patientOutSA;
data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo;
data['OrderDescription'] = this.orderDescription;
data['Live_ServiceID'] = this.liveServiceID;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['Amount'] = this.amount;
data['IsSchedule'] = this.isSchedule;
data['Language'] = this.language;
data['userName'] = this.userName;
data['ResponseContinueURL'] = this.responseContinueURL;
data['BackClickUrl'] = this.backClickUrl;
data['PaymentOption'] = this.paymentOption;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
return data;
}
}

@ -21,132 +21,115 @@ class LocationPage extends StatefulWidget {
final double longitude;
final dynamic model;
const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model})
: super(key: key);
const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) : super(key: key);
@override
_LocationPageState createState() =>
_LocationPageState();
_LocationPageState createState() => _LocationPageState();
}
class _LocationPageState
extends State<LocationPage> {
class _LocationPageState extends State<LocationPage> {
double latitude = 0;
double longitude = 0;
bool showCurrentLocation = false;
@override
void initState() {
latitude = widget.latitude;
longitude = widget.longitude;
if(latitude == 0.0 && longitude == 0.0) {
if (latitude == 0.0 && longitude == 0.0) {
showCurrentLocation = true;
}
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).addAddress,
isShowDecPage: false,
isShowAppBar: true,
baseViewModel: model,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () async {
AddNewAddressRequestModel
addNewAddressRequestModel =
new AddNewAddressRequestModel(
customer: Customer(addresses: [
Addresses(
address1:
selectedPlace.formattedAddress,
address2: selectedPlace
.formattedAddress,
customerAttributes: "",
city: "",
createdOnUtc: "",
id: 0,
latLong: "$latitude,$longitude",
email: "")
]),
);
selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer
.addresses[0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer
.addresses[0].zipPostalCode =
e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer
.addresses[0].city =
e.longName;
}
});
appBarTitle: TranslationBase.of(context).addAddress,
isShowDecPage: false,
isShowAppBar: true,
baseViewModel: model,
showNewAppBarTitle: true,
showNewAppBar: true,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
},
selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () async {
AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
customer: Customer(addresses: [
Addresses(
address1: selectedPlace.formattedAddress,
address2: selectedPlace.formattedAddress,
customerAttributes: "",
city: "",
createdOnUtc: "",
id: 0,
latLong: "$latitude,$longitude",
email: "")
]),
);
selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer.addresses[0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer.addresses[0].city = e.longName;
}
});
await model.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(
message: "Address Added Successfully");
}
Navigator.of(context).pop(addNewAddressRequestModel);
},
label: TranslationBase.of(context).addNewAddress,
),
],
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: showCurrentLocation,
),
));
await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(message: "Address Added Successfully");
}
Navigator.of(context).pop(addNewAddressRequestModel);
},
label: TranslationBase.of(context).addNewAddress,
),
],
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: showCurrentLocation,
),
));
}
}

@ -5,43 +5,33 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
class NewHomeHealthCareStepOnePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel
patientERInsertPresOrderRequestModel;
final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final HomeHealthCareViewModel model;
const NewHomeHealthCareStepOnePage(
{Key key,
this.patientERInsertPresOrderRequestModel,
this.model,
this.changePageViewIndex})
: super(key: key);
const NewHomeHealthCareStepOnePage({Key key, this.patientERInsertPresOrderRequestModel, this.model, this.changePageViewIndex}) : super(key: key);
@override
_NewHomeHealthCareStepOnePageState createState() =>
_NewHomeHealthCareStepOnePageState();
_NewHomeHealthCareStepOnePageState createState() => _NewHomeHealthCareStepOnePageState();
}
class _NewHomeHealthCareStepOnePageState
extends State<NewHomeHealthCareStepOnePage> {
class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOnePage> {
PickResult _result;
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList ==
null)
widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList = [];
if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null) widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = [];
super.initState();
}
@ -55,30 +45,25 @@ class _NewHomeHealthCareStepOnePageState
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.05, right: MediaQuery.of(context).size.width * 0.05),
child: Center(
child: FractionallySizedBox(
widthFactor: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Texts(
TranslationBase.of(context).selectHomeHealthCareServices,
textAlign: TextAlign.center,
),
// Texts(
// TranslationBase.of(context).selectHomeHealthCareServices,
// textAlign: TextAlign.center,
// ),
Column(
children: widget.model.hhcAllServicesList.map((service) {
return Container(
margin: EdgeInsets.only(top: 15),
margin: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Theme.of(context).primaryColor),
// border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
),
child: Column(
children: [
Row(
@ -86,21 +71,14 @@ class _NewHomeHealthCareStepOnePageState
Checkbox(
value: isServiceSelected(service.serviceID),
activeColor: Colors.red[800],
tristate: false,
onChanged: (bool newValue) {
setState(() {
if (!isServiceSelected(
service.serviceID))
widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.add(PatientERHHCInsertServicesList(
recordID: widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length,
serviceID: service.serviceID,
serviceName:
service.description));
if (!isServiceSelected(service.serviceID))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList(
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
serviceID: service.serviceID,
serviceName: service.description));
else
removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel
@ -109,22 +87,27 @@ class _NewHomeHealthCareStepOnePageState
}),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20.0),
padding: const EdgeInsets.only(left: 0.0, right: 10),
child: Texts(
projectViewModel.isArabic
? service.descriptionN
: service.description,
projectViewModel.isArabic ? service.descriptionN : service.description.toLowerCase()?.capitalize(),
fontSize: 15,
style: 'letterSpacing: -0.48',
fontWeight: FontWeight.bold,
),
),
),
],
),
Divider(
height: 1,
color: Colors.grey,
)
],
),
);
}).toList(),
)
),
SizedBox(height: 70)
],
),
),
@ -132,44 +115,73 @@ class _NewHomeHealthCareStepOnePageState
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: TranslationBase.of(context).next,
disabled: this
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length ==
0 ||
widget.model.state == ViewState.BusyLocal,
color: Colors.grey[800],
loading: widget.model.state == ViewState.BusyLocal,
onTap: () async {
await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) {
Utils.showErrorToast();
} else {
widget.changePageViewIndex(1);
}
},
textColor: Theme.of(context).backgroundColor),
),
],
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) {
Utils.showErrorToast();
} else {
Navigator.push(
context,
FadePage(
page: NewHomeHealthCareStepTowPage(
patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
model: widget.model,
),
),
);
// widget.changePageViewIndex(1);
}
},
label: TranslationBase.of(context).next,
backgroundColor: Colors.red[900],
disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal,
loading: widget.model.state == ViewState.BusyLocal,
),
),
// Container(
// height: MediaQuery.of(context).size.height * 0.10,
// width: double.infinity,
// child: Column(
// children: <Widget>[
// Container(
// width: MediaQuery.of(context).size.width * 0.9,
// child: SecondaryButton(
// label: TranslationBase.of(context).next,
// disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal,
// color: Colors.grey[800],
// loading: widget.model.state == ViewState.BusyLocal,
// onTap: () async {
// await widget.model.getCustomerInfo();
// if (widget.model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast();
// } else {
// Navigator.push(
// context,
// FadePage(
// page: NewHomeHealthCareStepTowPage(),
// ),
// );
// // widget.changePageViewIndex(1);
// }
// },
// textColor: Theme.of(context).backgroundColor),
// ),
// ],
// ),
// ),
);
}
isServiceSelected(int serviceId) {
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.where((element) => serviceId == element.serviceID);
if (patientERHHCInsertServicesList.length > 0) {
return true;
}
@ -178,15 +190,11 @@ class _NewHomeHealthCareStepOnePageState
removeSelected(int serviceId) {
Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.where((element) => serviceId == element.serviceID);
if (patientERHHCInsertServicesList.length > 0)
setState(() {
widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.remove(patientERHHCInsertServicesList.first);
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.remove(patientERHHCInsertServicesList.first);
});
}
}

@ -12,26 +12,21 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart';
class NewHomeHealthCareStepThreePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel
patientERInsertPresOrderRequestModel;
final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final HomeHealthCareViewModel model;
NewHomeHealthCareStepThreePage(
{Key key,
this.patientERInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model});
NewHomeHealthCareStepThreePage({Key key, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, this.model});
@override
_NewHomeHealthCareStepThreePageState createState() =>
_NewHomeHealthCareStepThreePageState();
_NewHomeHealthCareStepThreePageState createState() => _NewHomeHealthCareStepThreePageState();
}
class _NewHomeHealthCareStepThreePageState
extends State<NewHomeHealthCareStepThreePage> {
class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepThreePage> {
Completer<GoogleMapController> _controller = Completer();
static CameraPosition _kGooglePlex = CameraPosition(
@ -42,22 +37,17 @@ class _NewHomeHealthCareStepThreePageState
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude != null) {
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
widget.patientERInsertPresOrderRequestModel.latitude.hashCode
.toString(),
widget.patientERInsertPresOrderRequestModel.latitude.hashCode.toString(),
),
position: LatLng(
widget.patientERInsertPresOrderRequestModel.latitude,
widget.patientERInsertPresOrderRequestModel.longitude)),
position: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, widget.patientERInsertPresOrderRequestModel.longitude)),
);
_kGooglePlex = CameraPosition(
target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude,
widget.patientERInsertPresOrderRequestModel.longitude),
target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, widget.patientERInsertPresOrderRequestModel.longitude),
zoom: 14.4746,
);
}
@ -71,6 +61,9 @@ class _NewHomeHealthCareStepThreePageState
return AppScaffold(
isShowDecPage: false,
baseViewModel: widget.model,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).homeHealthCare,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
@ -79,19 +72,20 @@ class _NewHomeHealthCareStepThreePageState
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).orderDetails, fontWeight: FontWeight.bold,),
SizedBox(
height: 12,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(20),
child: Texts(
TranslationBase.of(context).RRTSummary,
fontWeight: FontWeight.bold,
fontSize: 22,
)),
Container(
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).orderLocation, fontWeight: FontWeight.bold),
Texts(TranslationBase.of(context).selectedLocation, fontWeight: FontWeight.bold),
SizedBox(
height: 12,
),
@ -112,29 +106,32 @@ class _NewHomeHealthCareStepThreePageState
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).selectedService + " : ", fontWeight: FontWeight.bold),
Texts(TranslationBase.of(context).selectedService),
...List.generate(
widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList.length,
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).serviceName,
fontSize: 12,
),
// Texts(
// TranslationBase.of(context).serviceName,
// fontSize: 12,
// ),
SizedBox(
height: 5,
),
Texts(
widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList[index]
.serviceName,
fontSize: 15,
bold: true,
),
Row(
children: [
Texts(
(index + 1).toString() + '. ',
fontSize: 15,
),
Texts(
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList[index].serviceName,
fontSize: 15,
),
],
)
],
),
),
@ -158,15 +155,12 @@ class _NewHomeHealthCareStepThreePageState
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: TranslationBase.of(context).confirm,
disabled: widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList.length ==
0,
disabled: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0,
color: Colors.grey[800],
onTap: () async {
await widget.model.insertPresPresOrder(
order: widget.patientERInsertPresOrderRequestModel);
await widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) {
widget.changePageViewIndex(0);
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: NewHomeHealthCarePage));
}
},
textColor: Theme.of(context).backgroundColor),

@ -1,9 +1,12 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -14,41 +17,37 @@ import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
import 'dart:async';
import 'location_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart';
class NewHomeHealthCareStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final PatientERInsertPresOrderRequestModel
patientERInsertPresOrderRequestModel;
final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final HomeHealthCareViewModel model;
const NewHomeHealthCareStepTowPage(
{Key key,
this.onPick,
this.latitude,
this.longitude,
this.patientERInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model})
: super(key: key);
const NewHomeHealthCareStepTowPage({Key key, this.onPick, this.latitude, this.longitude, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, this.model}) : super(key: key);
@override
_NewHomeHealthCareStepTowPageState createState() =>
_NewHomeHealthCareStepTowPageState();
_NewHomeHealthCareStepTowPageState createState() => _NewHomeHealthCareStepTowPageState();
}
class _NewHomeHealthCareStepTowPageState
extends State<NewHomeHealthCareStepTowPage> {
class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowPage> {
double latitude = 0;
double longitude = 0;
AddressInfo _selectedAddress;
bool showCurrentLocation = false;
Completer<GoogleMapController> _controller = Completer();
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
final Set<Marker> markers = new Set();
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
@ -57,30 +56,38 @@ class _NewHomeHealthCareStepTowPageState
latitude = widget.patientERInsertPresOrderRequestModel.latitude;
longitude = widget.patientERInsertPresOrderRequestModel.longitude;
}
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
latitude.hashCode.toString(),
),
position: LatLng(latitude, longitude)),
);
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
super.initState();
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) {
if (latLong == null){
if(widget.model.addressesList.isEmpty) {
if (latLong == null) {
if (widget.model.addressesList.isEmpty) {
setState(() {
showCurrentLocation = true;
});
} else {
latLong = widget.model.addressesList[widget.model.addressesList
.length - 1].latLong;
latLong = widget.model.addressesList[widget.model.addressesList.length - 1].latLong;
}
}
if(!showCurrentLocation) {
if (!showCurrentLocation) {
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
}
@override
@ -88,121 +95,211 @@ class _NewHomeHealthCareStepTowPageState
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).homeHealthCare,
body: Stack(
children: [
PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
Container(
margin: EdgeInsets.only(top: 120),
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
)
// PlacePicker(
// apiKey: GOOGLE_API_KEY,
// enableMyLocationButton: true,
// automaticallyImplyAppBarLeading: false,
// autocompleteOnTrailingWhitespace: false,
// selectInitialPosition: true,
// autocompleteLanguage: projectViewModel.currentLanguage,
// enableMapTypeButton: false,
// searchForInitialValue: true,
// // onPlacePicked: (PickResult result) {
// // print(result.adrAddress);
// // widget.changePageViewIndex(3);
// // },
// selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
// print("state: $state, isSearchBarFocused: $isSearchBarFocused");
// return isSearchBarFocused
// ? Container()
// : FloatingCard(
// bottomPosition: 0.0,
// leftPosition: 0.0,
// rightPosition: 0.0,
// width: 500,
// borderRadius: BorderRadius.circular(12.0),
// child: Container(
// margin: EdgeInsets.all(12),
// child: Column(
// children: [
// // SecondaryButton(
// // color: Colors.grey[800],
// // textColor: Colors.white,
// // onTap: () {
// // Navigator.push(
// // context,
// // FadePage(
// // page: LocationPage(
// // latitude: latitude,
// // longitude: longitude,
// // ),
// // ),
// // );
// // },
// // label: TranslationBase.of(context).addNewAddress,
// // ),
// // SizedBox(
// // height: 10,
// // ),
// SecondaryButton(
// color: Colors.red[800],
// textColor: Colors.white,
// onTap: () {
// setState(() {
// widget.patientERInsertPresOrderRequestModel.latitude = selectedPlace.geometry.location.lat;
// widget.patientERInsertPresOrderRequestModel.longitude = selectedPlace.geometry.location.lng;
// });
// widget.changePageViewIndex(3);
// },
// label: TranslationBase.of(context).confirm,
// ),
// ],
// ),
// ),
// );
// },
// initialPosition: LatLng(latitude, longitude),
// useCurrentLocation: showCurrentLocation,
// )
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
Navigator.push(
context,
FadePage(
page:
LocationPage(
latitude: latitude,
longitude: longitude,
),
),
);
},
label: TranslationBase.of(context).addNewAddress,
),
if (widget.model.addressesList.isNotEmpty)
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Container(
height: 60,
width: MediaQuery.of(context).size.width * .9,
margin: EdgeInsets.only(top: 10),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white),
child: DropdownButtonHideUnderline(
child: ButtonTheme(
alignedDropdown: true,
child: DropdownButton<AddressInfo>(
hint: Text(
widget.model.addressesList[0].address1,
style: TextStyle(color: CustomColors.black, fontSize: 14),
),
SizedBox(height: 10,),
SecondaryButton(
color: Colors.red[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientERInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.patientERInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).confirm,
iconEnabledColor: CustomColors.grey2,
style: TextStyle(color: CustomColors.black, fontSize: 14),
dropdownColor: CustomColors.white,
value: _selectedAddress,
items: widget.model.addressesList.map((AddressInfo value) {
return DropdownMenuItem<AddressInfo>(
value: value,
child: new AutoSizeText(
value.address1,
),
);
}).toList(),
onChanged: (r) {},
underline: Container(
height: 0,
),
],
),
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: showCurrentLocation,
),
if(widget.model.addressesList.isNotEmpty)
Container(
child: InkWell(
onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList),
child: Container(
padding: EdgeInsets.all(10),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getAddressName(), fontSize: 14,),),
Icon(Icons.arrow_drop_down)
],
)
]),
Positioned(
top: 80,
left: 20,
child: Row(
children: [
Icon(
Icons.add_circle_rounded,
),
InkWell(
child: Texts(
TranslationBase.of(context).addNewAddress,
fontWeight: FontWeight.bold,
),
onTap: () {
Navigator.push(
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
),
),
);
},
),
],
))
// Container(
// child: InkWell(
// onTap: () => confirmSelectLocationDialog(widget.model.addressesList),
// child: Container(
// padding: EdgeInsets.all(10),
// width: double.infinity,
// // height: 65,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: Texts(
// getAddressName(),
// fontSize: 14,
// ),
// ),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
// height: 56,
// width: double.infinity,
// color: Theme.of(context).scaffoldBackgroundColor,
// )
],
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
Navigator.push(
context,
FadePage(
page: NewHomeHealthCareStepThreePage(
patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
model: widget.model,
),
),
),
height: 56, width: double.infinity, color: Theme
.of(context)
.scaffoldBackgroundColor,
)
],
);
},
label: TranslationBase.of(context).continues,
backgroundColor: Colors.red[900],
),
),
);
}
void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog(
context: context,
child: SelectLocationDialog(
addresses: addresses,
selectedAddress: _selectedAddress
,
selectedAddress: _selectedAddress,
onValueSelected: (value) {
setLatitudeAndLongitude(latLong: value.latLong);
setState(() {

@ -11,12 +11,12 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import '../StepsWidget.dart';
import 'new_Home_health_care_step_one_page.dart';
@ -28,15 +28,13 @@ class NewHomeHealthCarePage extends StatefulWidget {
_NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState();
}
class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
with TickerProviderStateMixin {
class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 1;
double _latitude;
double _longitude;
PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel =
new PatientERInsertPresOrderRequestModel();
PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = new PatientERInsertPresOrderRequestModel();
@override
void initState() {
@ -64,32 +62,23 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
setState(() {
_currentIndex = tab;
});
_controller.animateToPage(tab,
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
_controller.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
}
@override
Widget build(BuildContext context) {
void showConfirmMessage(HomeHealthCareViewModel model,
GetOrderDetailByOrderIDResponseModel order) {
void showConfirmMessage(HomeHealthCareViewModel model, GetOrderDetailByOrderIDResponseModel order) {
showDialog(
context: context,
child: ConfirmCancelOrderDialog(
model: model,
onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel =
UpdatePresOrderRequestModel(
presOrderID: order.presOrderID,
rejectionReason: "",
presOrderStatus: 4,
editedBy: 3);
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(
message:
TranslationBase.of(context).processDoneSuccessfully);
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders();
// await model.getHHCAllServices();
}
@ -106,15 +95,15 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
height: MediaQuery.of(context).size.height * 0.8,
child: Column(
children: [
Container(
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: _changeCurrentTab,
),
),
// Container(
// margin: EdgeInsets.only(
// left: MediaQuery.of(context).size.width * 0.05,
// right: MediaQuery.of(context).size.width * 0.05),
// child: StepsWidget(
// index: _currentIndex,
// changeCurrentTab: _changeCurrentTab,
// ),
// ),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
@ -130,248 +119,284 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
? FractionallySizedBox(
widthFactor: 0.9,
child: SingleChildScrollView(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color:
Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.requestID,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.pendingOrder.iD
.toString(),
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color:
Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.OrderStatus,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic
? widget.model.pendingOrder
.descriptionN
: widget.model.pendingOrder
.description,
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color:
Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.pickupDate,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil
.getDayMonthYearDateFormatted(
DateUtil
.convertStringToDate(
widget
.model
.pendingOrder
.createdOn)),
fontSize: 22,
),
],
),
),
...List.generate(
widget.model.hhcAllOrderDetail.length,
(index) => Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Theme.of(context)
.primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.serviceName,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic
? widget
.model
.hhcAllOrderDetail[
index]
.descriptionN
: widget
.model
.hhcAllOrderDetail[
index]
.description,
fontSize: 22,
bold: true,
),
],
),
),
),
SizedBox(
height: 12,
),
Center(
child: Row(
children: [
Expanded(
flex: 3,
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
child: Container(
width: MediaQuery.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: TranslationBase.of(context)
.cancel
.toUpperCase(),
onTap: () {
showConfirmMessage(
widget.model,
widget.model
.hhcAllOrderDetail[0]);
},
color: Colors.red[800],
disabled: false,
textColor: Theme.of(context)
.backgroundColor),
),
),
SizedBox(
height: 12,
),
],
),
),
),
)
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
margin: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7),
decoration: BoxDecoration(boxShadow: [
BoxShadow(color: Color(0xffcd9e1b), offset: Offset(-10, 0)),
], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white),
child: Row(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).OrderStatus +
' ' +
(projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
bold: false,
fontSize: 12,
color: Color(0xffcd9e1b),
fontWeight: FontWeight.bold,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Texts(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
fontSize: 14,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
bold: false,
fontSize: 18,
),
Texts(
TranslationBase.of(context).serviceName,
fontSize: 12,
),
...List.generate(
widget.model.hhcAllOrderDetail.length,
(index) => Container(
child: Texts(
projectViewModel.isArabic
? widget.model.hhcAllOrderDetail[index].descriptionN
: widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 14,
),
),
),
],
),
SecondaryButton(
onTap: () {
showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
},
label: TranslationBase.of(context).cancel,
color: Colors.red[900],
small: true,
)
],
// )
// ],
// )
// ],
),
],
))
],
))),
)
],
))
// Row(
// children: [
// Expanded(
// flex: 1,
// child: ClipRRect(
// borderRadius: const BorderRadius.all(Radius.circular(20.0)),
// child: Container(
// padding: EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20),
// margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7),
// decoration: BoxDecoration(
// boxShadow: [
// BoxShadow(color: Colors.green, offset: Offset(-5, 0)),
// ],
// )))),
// Expanded(
// flex: 5,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// width: double.infinity,
// padding: EdgeInsets.all(5),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// ),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).OrderStatus,
// bold: false,
// fontSize: 12,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description,
// fontSize: 12,
// ),
// ],
// ),
// ),
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).requestID,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// widget.model.pendingOrder.iD.toString(),
// fontSize: 22,
// ),
// ],
// ),
// ),
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).pickupDate,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
// fontSize: 22,
// ),
// ],
// ),
// ),
// ...List.generate(
// widget.model.hhcAllOrderDetail.length,
// (index) => Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// color: Theme.of(context).primaryColor),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).serviceName,
// bold: false,
// fontSize: 13,
// ),
// SizedBox(
// height: 4,
// ),
// Texts(
// projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description,
// fontSize: 22,
// bold: true,
// ),
// ],
// ),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// Center(
// child: Container(
// width: MediaQuery.of(context).size.width * 0.85,
// child: SecondaryButton(
// label: TranslationBase.of(context).cancel.toUpperCase(),
// onTap: () {
// showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
// },
// color: Colors.red[800],
// disabled: false,
// textColor: Theme.of(context).backgroundColor),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// ],
// ),
// )
// ],
// ),
//),
)
: NewHomeHealthCareStepOnePage(
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel:
patientERInsertPresOrderRequestModel,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model,
),
NewHomeHealthCareStepTowPage(
latitude: _latitude,
longitude: _longitude,
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel:
patientERInsertPresOrderRequestModel,
model: widget.model,
),
NewHomeHealthCareStepThreePage(
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel:
patientERInsertPresOrderRequestModel,
model: widget.model,
)
// NewHomeHealthCareStepTowPage(
// latitude: _latitude,
// longitude: _longitude,
// changePageViewIndex: _changeCurrentTab,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
// model: widget.model,
// ),
// NewHomeHealthCareStepThreePage(
// changePageViewIndex: _changeCurrentTab,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
// model: widget.model,
// )
],
),
),

@ -17,8 +17,7 @@ class HomeHealthCarePage extends StatefulWidget {
_HomeHealthCarePageState createState() => _HomeHealthCarePageState();
}
class _HomeHealthCarePageState extends State<HomeHealthCarePage>
with SingleTickerProviderStateMixin {
class _HomeHealthCarePageState extends State<HomeHealthCarePage> with SingleTickerProviderStateMixin {
TabController _tabController;
@override
@ -43,75 +42,46 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
isShowAppBar: true,
description: TranslationBase.of(context).HHCNotAuthMsg,
appBarTitle: TranslationBase.of(context).homeHealthCare,
imagesInfo: [
ImagesInfo(
imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png',
imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png')
],
showNewAppBar: true,
showNewAppBarTitle: true,
imagesInfo: [ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png')],
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0),
child: Stack(
children: <Widget>[
Positioned(
bottom: 1,
left: 0,
right: 0,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container(
color: Theme.of(context)
.scaffoldBackgroundColor
.withOpacity(0.8),
height: 70.0,
),
),
),
Center(
child: Container(
height: 60.0,
margin: EdgeInsets.only(top: 10.0),
width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.7),
),
color: Theme.of(context).primaryColor),
child: Center(
child: TabBar(
isScrollable: true,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts(
TranslationBase.of(context).homeHealthCare,
color: Colors.black,
),
child: Center(
child: TabBar(
isScrollable: true,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts(
TranslationBase.of(context).homeHealthCare,
color: Colors.black,
),
),
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts(
TranslationBase.of(context).orderLog,
color: Colors.black,
),
),
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts(
TranslationBase.of(context).orderLog,
color: Colors.black,
),
),
],
),
),
],
),
),
),

@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart';
@ -86,7 +87,7 @@ class ConfirmPaymentPage extends StatelessWidget {
height: 100.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(getImagePath(selectedPaymentMethod)),
child: selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(selectedPaymentMethod)) : Image.asset(getImagePath(selectedPaymentMethod)),
),
Texts(
'${advanceModel.amount} SAR',
@ -193,6 +194,9 @@ class ConfirmPaymentPage extends StatelessWidget {
case "Installment":
return 'assets/images/new-design/installment.png';
break;
case "ApplePay":
return 'assets/images/new-design/applepay.svg';
break;
}
return 'assets/images/new-design/mada.png';
@ -219,7 +223,7 @@ class ConfirmPaymentPage extends StatelessWidget {
authenticatedUser,
browser,
false,
null,
"3",
null);
}

@ -20,7 +20,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:intl/intl.dart';
import 'QRCode.dart';
@ -489,33 +488,28 @@ class _BookSuccessState extends State<BookSuccess> {
}
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
if (paymentMethod == "ApplePay") {
await widget.chromeBrowser.open(
url: "https://applepay-datatrans-sample.herokuapp.com/",
options: ChromeSafariBrowserClassOptions(android: AndroidChromeCustomTabsOptions(addDefaultShareMenuItem: false), ios: IOSSafariOptions(barCollapsingEnabled: true)));
} else {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
widget.browser.openPaymentBrowser(
amount,
"Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser,
widget.patientShareResponse.isLiveCareAppointment,
null,
null,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
}
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser(
amount,
"Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser,
widget.patientShareResponse.isLiveCareAppointment,
"2",
null,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
// }
}
onBrowserLoadStart(String url) {
@ -546,7 +540,6 @@ class _BookSuccessState extends State<BookSuccess> {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) {
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
createAdvancePayment(res, appo);

@ -32,36 +32,40 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
Widget build(BuildContext context) {
AppGlobal.context = context;
return AppScaffold(
isShowAppBar: false,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).bookAppo,
backgroundColor: Color(0xFFF7F7F7),
body: Container(
child: Column(
children: [
TabBar(
tabs: [
Tab(child: Text(TranslationBase.of(context).clinicName, style: TextStyle(color: Colors.black))),
Tab(
child: Text(TranslationBase.of(context).doctorName, style: TextStyle(color: Colors.black)),
)
],
controller: _tabController,
),
Expanded(
child: new TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
SearchByClinic(
clnicIds: widget.clnicIds,
),
SearchByDoctor()
],
controller: _tabController,
),
)
],
isShowAppBar: false,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).bookAppo,
backgroundColor: Color(0xFFF7F7F7),
body: Column(
children: [
TabBar(
controller: _tabController,
indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).clinicName), Text(TranslationBase.of(context).doctorName)],
),
));
Expanded(
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [SearchByClinic(clnicIds: widget.clnicIds), SearchByDoctor()],
controller: _tabController,
),
)
],
),
);
}
}

@ -31,45 +31,36 @@ class _SearchResultsState extends State<SearchResults> {
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView(
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView.separated(
physics: BouncingScrollPhysics(),
child: Column(
children: <Widget>[
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
// padding: EdgeInsets.only(left: 21, right: 21),
separatorBuilder: (context, index) {
return Container(
height: 1,
margin: EdgeInsets.only(left: 21, right: 21),
color: Color(0xffD9D9D9),
);
},
itemBuilder: (context, index) {
return AppExpandableNotifier(
title:
widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
return DoctorView(
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
isLiveCareAppointment: widget.isLiveCareAppointment,
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
);
},
itemCount: widget.patientDoctorAppointmentListHospital.length,
),
],
),
separatorBuilder: (context, index) {
return Container(
height: 1,
margin: EdgeInsets.only(left: 21, right: 21),
color: Color(0xffD9D9D9),
);
},
itemBuilder: (context, index) {
return AppExpandableNotifier(
title: widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
isTitleSingleLine: false,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
return DoctorView(
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
isLiveCareAppointment: widget.isLiveCareAppointment,
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
);
},
itemCount: widget.patientDoctorAppointmentListHospital.length,
),
);
}

@ -2,6 +2,9 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/Weight/WeightHomePage.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -62,6 +65,15 @@ class CardCommonContact extends StatelessWidget {
} else if (type == 2) {
//LiveChatPage
Navigator.push(context, FadePage(page: LiveChatPage()));
} else if (type == 3) {
//LiveChatPage
Navigator.push(context, FadePage(page: BloodSugarHomePage()));
} else if (type == 4) {
//LiveChatPage
Navigator.push(context, FadePage(page: BloodPressureHomePage()));
} else if (type == 5) {
//LiveChatPage
Navigator.push(context, FadePage(page: WeightHomePage()));
}
}
}

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget {
@ -27,8 +28,7 @@ class CovidPaymentSummary extends StatefulWidget {
AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = "";
CovidPaymentSummary(
{@required this.patientShareResponse, this.selectedPaymentMethod});
CovidPaymentSummary({@required this.patientShareResponse, this.selectedPaymentMethod});
@override
_CovidPaymentSummaryState createState() => _CovidPaymentSummaryState();
@ -64,12 +64,10 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
height: 100.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child:
Image.asset(getImagePath(widget.selectedPaymentMethod)),
child: widget.selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(widget.selectedPaymentMethod)) : Image.asset(getImagePath(widget.selectedPaymentMethod)),
),
Texts(
'${widget.patientShareResponse.patientShareWithTax} ' +
TranslationBase.of(context).sar,
'${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar,
fontSize: 26,
bold: true,
)
@ -85,8 +83,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
margin: EdgeInsets.all(3),
child: NewTextFields(
hintText: TranslationBase.of(context).fileNumber,
initialValue:
projectViewModel.user.patientID.toString(),
initialValue: projectViewModel.user.patientID.toString(),
isEnabled: false,
),
),
@ -116,11 +113,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
),
NewTextFields(
hintText: TranslationBase.of(context).depositorName,
initialValue: projectViewModel.user.firstName +
" " +
projectViewModel.user.middleName +
" " +
projectViewModel.user.lastName,
initialValue: projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName,
isEnabled: false,
),
],
@ -149,55 +142,31 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
appo.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
openPayment(
widget.selectedPaymentMethod,
authenticatedUser,
double.parse(
widget.patientShareResponse.patientShareWithTax.toString()),
widget.patientShareResponse,
appo);
openPayment(widget.selectedPaymentMethod, authenticatedUser, double.parse(widget.patientShareResponse.patientShareWithTax.toString()), widget.patientShareResponse, appo);
}
openPayment(
String paymentMethod,
AuthenticatedUser authenticatedUser,
double amount,
PatientShareResponse patientShareResponse,
AppoitmentAllHistoryResultList appo) async {
if (paymentMethod == "ApplePay") {
// await widget.chromeBrowser.open(
// url: "https://applepay-datatrans-sample.herokuapp.com/",
// options: ChromeSafariBrowserClassOptions(
// android: AndroidChromeCustomTabsOptions(
// addDefaultShareMenuItem: false),
// ios: IOSSafariOptions(barCollapsingEnabled: true)));
} else {
widget.browser = new MyInAppBrowser(
onExitCallback: onBrowserExit,
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser(
amount,
"Appointment check in",
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser,
widget.patientShareResponse.isLiveCareAppointment,
null,
null,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
}
widget.browser.openPaymentBrowser(
amount,
"Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser,
widget.patientShareResponse.isLiveCareAppointment,
"2",
null,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
}
onBrowserLoadStart(String url) {
@ -229,12 +198,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.checkPaymentStatus(
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
context)
.then((res) {
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) {
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message'];
@ -254,15 +218,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'],
res['Fort_id'], res['PaymentMethod'], context)
.then((res) {
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString());
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString());
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
@ -270,13 +228,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
});
}
addAdvancedNumberRequest(
String advanceNumber, String paymentReference, String appointmentID) {
addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID) {
DoctorsListService service = new DoctorsListService();
service
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context)
.then((res) {
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {
print(res);
getAppoQR(context);
}).catchError((err) {
@ -288,9 +242,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
getAppoQR(context) {
DoctorsListService service = new DoctorsListService();
service
.generateAppointmentQR(widget.patientShareResponse, context)
.then((res) {
service.generateAppointmentQR(widget.patientShareResponse, context).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
navigateToQR(context, res['AppointmentQR']);
@ -328,6 +280,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
case "Installment":
return 'assets/images/new-design/installment.png';
break;
case "ApplePay":
return 'assets/images/new-design/applepay.svg';
break;
}
return 'assets/images/new-design/mada.png';

@ -35,13 +35,13 @@ class ArrivedButtons {
},
{
"title": TranslationBase.of(AppGlobal.context).insuranceApproval,
"subtitle": TranslationBase.of(AppGlobal.context).insuranceSubtitle,
"subtitle": TranslationBase.of(AppGlobal.context).insuranceApprovalSubtitle,
"icon": 'insurance_approval.svg',
"caller": "Insurance",
},
{
"title": TranslationBase.of(AppGlobal.context).askDoctor,
"subtitle": TranslationBase.of(AppGlobal.context).askYourSubtitle,
"subtitle": TranslationBase.of(AppGlobal.context).service,
"icon": 'ask_doctor.svg',
"caller": "askDoc",
},

@ -597,7 +597,7 @@ class _ToDoState extends State<ToDo> {
}
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser(
amount,
@ -612,7 +612,7 @@ class _ToDoState extends State<ToDo> {
authenticatedUser,
widget.browser,
appo.isLiveCareAppointment,
null,
"2",
null,
appo.appointmentDate,
appo.appointmentNo,

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -145,7 +147,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
],
),
),
Container(
Platform.isIOS ? Container(
margin: EdgeInsets.only(top: 25.0),
child: Flex(
direction: Axis.horizontal,
@ -178,7 +180,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
),
],
),
),
) : Container(),
SizedBox(
height: 150.0,
),

@ -32,7 +32,9 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
baseViewModel: model,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).approvals,
description: TranslationBase.of(context).infoApprovals,
infoList: TranslationBase.of(context).infoApprovalPoints,

@ -113,7 +113,7 @@ class InsurancePage extends StatelessWidget {
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46),
),
Text(
TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientID.toString(),
TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46),
),
],

@ -510,7 +510,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
TranslationBase.of(context).HMGPharmacy,
TranslationBase.of(context).onlinePharmacy,
style: TextStyle(
color: Colors.black,
fontSize: 14,

@ -524,12 +524,6 @@ class _HomePageState extends State<HomePage> {
)
: Column(
children: <Widget>[
// if (projectViewModel.user != null && model.isLogin && model.user.outSA == 1)
// Image.asset(
// 'assets/images/lock_icon.png',
// width: 50,
// height: 50,
// ),
Image.asset(
'assets/images/pharmacy_logo.png',
width: 40,

@ -41,7 +41,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import '../../locator.dart';
import '../../routes.dart';
@ -601,31 +601,33 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
),
),
drawer: SafeArea(child: AppDrawer()),
extendBody: true,
extendBody: false,
body: WillPopScope(
onWillPop: onWillPop,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
HomePage2(
goToMyProfile: () {
changeCurrentTab(1);
},
onLoginClick: () {
login();
},
onMedicalFileClick: () {
changeCurrentTab(1);
},
onWillPop: onWillPop,
child: Stack(children: [
PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
HomePage2(
goToMyProfile: () {
changeCurrentTab(1);
},
onLoginClick: () {
login();
},
onMedicalFileClick: () {
changeCurrentTab(1);
},
),
MedicalProfilePageNew(),
Search(),
MyFamily(isAppbarVisible: false),
ToDo(isShowAppBar: false),
], // Please do not remove the BookingOptions from this array
),
MedicalProfilePageNew(),
Search(),
MyFamily(isAppbarVisible: false),
ToDo(isShowAppBar: false),
], // Please do not remove the BookingOptions from this array
),
),
RobotIcon()
])),
bottomNavigationBar: BottomNavBar(
changeIndex: changeCurrentTab,
index: currentTab,

@ -50,7 +50,7 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "LiveCare",
appBarTitle: TranslationBase.of(context).livecare,
isShowAppBar: true,
imagesInfo: imagesInfo,
description: TranslationBase.of(context).erConsultation,

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class ClinicTimingsDialog extends StatefulWidget {
@ -31,7 +32,7 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container(
height: MediaQuery.of(context).size.height * 0.68,
height: 580.0,
margin: EdgeInsets.all(20.0),
width: 450.0,
child: Column(
@ -41,7 +42,7 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 10.0),
child: Text("Clinic Schedule",
child: Text(TranslationBase.of(context).clinicSchedule,
textAlign: TextAlign.center,
style:
TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
@ -98,7 +99,7 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
Navigator.pop(context);
},
child: Container(
child: Text("OK",
child: Text(TranslationBase.of(context).ok,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18.0,

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class LiveCarePaymentDialog extends StatefulWidget {
GetERAppointmentFeesList getERAppointmentFeesList;
@ -20,11 +22,14 @@ class LiveCarePaymentDialog extends StatefulWidget {
class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
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 Container(
child: Dialog(
@ -66,7 +71,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
),
),
Expanded(
child: Text(widget.waitingTime.toString() + " Minutes",
child: Text(widget.waitingTime.toString() + " " + TranslationBase.of(context).minute,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 16.0,
@ -156,7 +161,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
children: <Widget>[
Image.asset("assets/images/new-design/alert-triangle.png"),
Container(
margin: EdgeInsets.only(left: 10.0),
margin: EdgeInsets.only(left: 10.0, right: 10.0),
width: MediaQuery.of(context).size.width * 0.55,
child: Text(TranslationBase.of(context).insuredPatient,
style: TextStyle(fontSize: 13.0)),
@ -181,14 +186,6 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
style: new TextStyle(fontSize: 14.0),
),
),
// Container(
//// alignment: Alignment.centerRight,
// child: new Text(
// 'Click Here',
// textAlign: TextAlign.end,
// style: new TextStyle(fontSize: 16.0),
// ),
// ),
],
),
),
@ -228,7 +225,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
Navigator.pop(context, false);
},
child: Container(
child: Text("Cancel",
child: Text(TranslationBase.of(context).cancel,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18.0, color: Colors.red[700])),
@ -247,7 +244,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
}
},
child: Container(
child: Text("Ok",
child: Text(TranslationBase.of(context).ok,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18.0,
@ -278,7 +275,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14,
fontFamily: 'Open-Sans',
// fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
letterSpacing: 0.5,
color: Colors.black)),
);
@ -291,7 +288,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14,
fontFamily: 'Open-Sans',
// fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
letterSpacing: 0.5,
fontWeight: FontWeight.bold,
color: Colors.black)),

@ -157,7 +157,6 @@ class _clinic_listState extends State<ClinicList> {
GifLoaderDialogUtils.showMyDialog(context);
service.getERAppointmentTime(selectedClinicID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
@ -236,6 +235,7 @@ class _clinic_listState extends State<ClinicList> {
appo.clinicID = selectedClinicID;
appo.appointmentNo = DateTime.now().millisecondsSinceEpoch;
appo.projectID = 12;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -253,9 +253,9 @@ class _clinic_listState extends State<ClinicList> {
}
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod,
browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod,
authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID.toString());
}
@ -368,7 +368,6 @@ class _clinic_listState extends State<ClinicList> {
if (res['MessageStatus'] == 1) {
setState(() {
liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res);
print(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length);
selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].serviceID;
selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].clinicDesc;
isDataLoaded = true;
@ -432,12 +431,6 @@ class _clinic_listState extends State<ClinicList> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Container(
// margin: EdgeInsets.all(15.0),
// child: Text("Online Clinics: ",
// style: TextStyle(
// fontSize: 20.0, fontWeight: FontWeight.bold)),
// ),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
@ -505,7 +498,7 @@ class _clinic_listState extends State<ClinicList> {
children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Text("Online Clinics: ", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).onlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder(
scrollDirection: Axis.vertical,
@ -529,7 +522,7 @@ class _clinic_listState extends State<ClinicList> {
),
Container(
margin: EdgeInsets.all(15.0),
child: Text("Offline Clinics: ", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).offlineClinics, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder(
scrollDirection: Axis.vertical,
@ -581,7 +574,7 @@ class _clinic_listState extends State<ClinicList> {
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).start, style: TextStyle(fontSize: 18.0)),
),
),
),

@ -225,7 +225,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
),
NewTextFields(
hintText: TranslationBase.of(context).amount,
keyboardType: TextInputType.number,
keyboardType: TextInputType.numberWithOptions(signed: false, decimal: true),
onChanged: (value) {
setState(() {
amount = value;

@ -20,6 +20,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart';
@ -88,7 +89,7 @@ class ConfirmPaymentPage extends StatelessWidget {
height: 100.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child: Image.asset(getImagePath(selectedPaymentMethod)),
child: selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(selectedPaymentMethod)) : Image.asset(getImagePath(selectedPaymentMethod)),
),
Text(
'${advanceModel.amount} SAR',
@ -197,6 +198,9 @@ class ConfirmPaymentPage extends StatelessWidget {
case "Installment":
return 'assets/images/new-design/installment.png';
break;
case "ApplePay":
return 'assets/images/new-design/applepay.svg';
break;
}
return 'assets/images/new-design/mada.png';
@ -208,7 +212,7 @@ class ConfirmPaymentPage extends StatelessWidget {
transID = Utils.getAdvancePaymentTransID(advanceModel.hospitalsModel.iD, int.parse(advanceModel.fileNumber));
browser.openPaymentBrowser(amount, "Advance Payment", transID, advanceModel.hospitalsModel.iD.toString(), advanceModel.email, paymentMethod, patientInfoAndMobileNumber.patientType,
advanceModel.patientName, advanceModel.fileNumber, authenticatedUser, browser, false,null,null);
advanceModel.patientName, advanceModel.fileNumber, authenticatedUser, browser, false, "3", null);
}
onBrowserLoadStart(String url) {

@ -28,6 +28,8 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
appBarTitle: TranslationBase.of(context).passportNumber,
isShowAppBar: true,
isBottomBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Container(
child: SingleChildScrollView(
child: Column(
@ -50,34 +52,34 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
onChanged: (value) => {_onPassportTextChanged(value)},
padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).passportNumber,
))
)),
Container(
margin: EdgeInsets.only(top: 30.0, left: 45.0, right: 45.0, bottom: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
if (_isButtonDisabled == false)
updatePassportNumber();
else
AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber);
},
child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)),
),
),
),
],
),
),
),
bottomSheet: Container(
margin: EdgeInsets.only(top: 10.0, left: 30.0, right: 30.0, bottom: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
if (_isButtonDisabled == false)
updatePassportNumber();
else
AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber);
},
child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)),
),
),
),
);
}

@ -15,6 +15,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
class AddWeightPage extends StatefulWidget {
final WeightPressureViewModel model;
@ -25,16 +26,7 @@ class AddWeightPage extends StatefulWidget {
final String measureTimeSelectedType;
final int weightUnit;
AddWeightPage(
{Key key,
this.model,
this.isUpdate = false,
this.dayWeightDate,
this.lineItemNo,
this.weightValue,
this.measureTimeSelectedType,
this.weightUnit})
: super(key: key);
AddWeightPage({Key key, this.model, this.isUpdate = false, this.dayWeightDate, this.lineItemNo, this.weightValue, this.measureTimeSelectedType, this.weightUnit}) : super(key: key);
@override
_AddWeightPageState createState() => _AddWeightPageState();
@ -62,8 +54,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
measureTimeSelectedType = widget.measureTimeSelectedType;
if (measureUnitEnList.contains(widget.measureTimeSelectedType))
weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType);
else if (measureUnitArList.contains(widget.measureTimeSelectedType))
weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType);
else if (measureUnitArList.contains(widget.measureTimeSelectedType)) weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType);
_weightValueController.text = widget.weightValue;
validateForm();
}
@ -74,211 +65,199 @@ class _AddWeightPageState extends State<AddWeightPage> {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
appBarTitle: widget.isUpdate
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate
? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.deleteWeightResult(lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
: null,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: TranslationBase.of(context).weightAdd,
controller: _weightValueController,
keyboardType: TextInputType.number,
onChanged: (value) => validateForm(),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureUnitArList
: measureUnitEnList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType ??
TranslationBase.of(context).other),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
isShowAppBar: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
showNewAppBar: true,
showNewAppBarTitle: true,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: TranslationBase.of(context).weightAdd,
controller: _weightValueController,
keyboardType: TextInputType.number,
onChanged: (value) => validateForm(),
fontWeight: FontWeight.normal,
fontSize: 14,
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureUnitArList : measureUnitEnList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType ?? TranslationBase.of(context).other),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
),
),
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
setState(() {
dayWeightDate = date;
});
},
currentTime: dayWeightDate,
locale: projectViewModel.localeType,
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
setState(() {
dayWeightDate = date;
});
},
currentTime: dayWeightDate,
locale: projectViewModel.localeType,
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
),
),
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(
context,
showTitleActions: true,
onConfirm: (date) {
setState(() {
timeWeightDate = date;
});
},
currentTime: timeWeightDate,
locale: projectViewModel.localeType,
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(
context,
showTitleActions: true,
onConfirm: (date) {
setState(() {
timeWeightDate = date;
});
},
currentTime: timeWeightDate,
locale: projectViewModel.localeType,
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
),
),
),
),
],
widget.isUpdate
? Container(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
child: Texts(
TranslationBase.of(context).delete,
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
color: Colors.red[900],
),
onTap: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).removeMeasure,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deleteWeightResult(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
})
],
))
: Container()
],
),
),
),
),
bottomSheet: Container(
color: Colors.transparent,
width: double.infinity,
height: MediaQuery.of(context).size.width * 0.2,
child: Padding(
padding: const EdgeInsets.all(15.0),
child: SecondaryButton(
loading: widget.model.state == ViewState.BusyLocal,
label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white,
color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
onTap: () {
if (_weightValueController.text.isNotEmpty) {
if (widget.isUpdate) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.updateWeightResult(
weightDate:
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured:
_weightValueController.text.toString(),
weightUnit: weightUnit,
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
} else
widget.model
.addWeightResult(
weightDate:
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
}
}),
),
),
);
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
if (_weightValueController.text.isNotEmpty) {
if (widget.isUpdate) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.updateWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
} else
widget.model
.addWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
});
}
},
label: TranslationBase.of(context).save.toUpperCase(),
backgroundColor: Colors.red[900],
disabled: isButtonDisabled,
),
));
}
String getDate() {
@ -308,8 +287,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
}
void validateForm() {
if (_weightValueController.text.length > 0 &&
measureTimeSelectedType != null) {
if (_weightValueController.text.length > 0 && measureTimeSelectedType != null) {
setState(() {
isButtonDisabled = true;
});

@ -42,6 +42,8 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).weight,
appBarIcons: [
IconButton(

@ -15,6 +15,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
class AddBloodPressurePage extends StatefulWidget {
final DateTime bloodSugarDate;
@ -25,15 +26,7 @@ class AddBloodPressurePage extends StatefulWidget {
final String bloodDiastolicValue;
final BloodPressureViewMode model;
const AddBloodPressurePage(
{Key key,
this.bloodSugarDate,
this.measureTimeSelectedType,
this.isUpdate = false,
this.lineItemNo,
this.model,
this.bloodSystolicValue,
this.bloodDiastolicValue})
const AddBloodPressurePage({Key key, this.bloodSugarDate, this.measureTimeSelectedType, this.isUpdate = false, this.lineItemNo, this.model, this.bloodSystolicValue, this.bloodDiastolicValue})
: super(key: key);
@override
@ -42,8 +35,7 @@ class AddBloodPressurePage extends StatefulWidget {
class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
TextEditingController _bloodSystolicValueController = TextEditingController();
TextEditingController _bloodDiastolicValueController =
TextEditingController();
TextEditingController _bloodDiastolicValueController = TextEditingController();
DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now();
int measuredArm = 1;
@ -67,8 +59,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
measureTimeSelectedType = widget.measureTimeSelectedType;
if (measureTimeEnList.contains(widget.measureTimeSelectedType))
measuredArm = measureTimeEnList.indexOf(widget.measureTimeSelectedType);
else if (measureTimeArList.contains(widget.measureTimeSelectedType))
measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType);
else if (measureTimeArList.contains(widget.measureTimeSelectedType)) measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType);
_bloodSystolicValueController.text = widget.bloodSystolicValue;
_bloodDiastolicValueController.text = widget.bloodDiastolicValue;
validateForm();
@ -80,221 +71,194 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
appBarTitle: widget.isUpdate
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate
? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.deactivateDiabeticStatus(
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
: null,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: TranslationBase.of(context).systolicAdd,
controller: _bloodSystolicValueController,
keyboardType: TextInputType.number,
maxLength: 3,
onChanged: (value) => validateForm(),
),
SizedBox(
height: 8,
),
NewTextFields(
hintText: TranslationBase.of(context).diastolicAdd,
controller: _bloodDiastolicValueController,
keyboardType: TextInputType.number,
maxLength: 3,
onChanged: (value) => validateForm(),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureTimeArList
: measureTimeEnList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
isShowAppBar: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
showNewAppBar: true,
showNewAppBarTitle: true,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: TranslationBase.of(context).systolicAdd,
controller: _bloodSystolicValueController,
keyboardType: TextInputType.number,
maxLength: 3,
onChanged: (value) => validateForm(),
fontWeight: FontWeight.normal,
fontSize: 14,
),
SizedBox(
height: 8,
),
NewTextFields(
hintText: TranslationBase.of(context).diastolicAdd,
controller: _bloodDiastolicValueController,
keyboardType: TextInputType.number,
maxLength: 3,
onChanged: (value) => validateForm(),
fontWeight: FontWeight.normal,
fontSize: 14,
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
),
),
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(), onConfirm: (date) {
setState(
() {
bloodSugarDate = date;
},
);
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) {
setState(
() {
bloodSugarDate = date;
},
);
}, currentTime: bloodSugarDate, locale: projectViewModel.localeType);
},
currentTime: bloodSugarDate,
locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
),
),
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true,
onConfirm: (date) {
setState(
() {
timeSugarDate = date;
},
);
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
setState(
() {
timeSugarDate = date;
},
);
}, currentTime: timeSugarDate, locale: projectViewModel.localeType);
},
currentTime: timeSugarDate,
locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
),
),
),
),
],
widget.isUpdate
? Container(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
child: Texts(
TranslationBase.of(context).delete,
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
color: Colors.red[900],
),
onTap: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).removeMeasure,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
})
],
))
: Container()
],
),
),
),
),
bottomSheet: Container(
color: Colors.transparent,
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.10,
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
Container(
height: 50,
child: SecondaryButton(
loading: widget.model.state == ViewState.BusyLocal,
label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white,
color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty &&
_bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.addORUpdateDiabtecResult(
isUpdate: widget.isUpdate,
bloodPressureDate:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure:
_bloodDiastolicValueController.text.toString(),
systolicePressure:
_bloodSystolicValueController.text.toString(),
measuredArm: measuredArm,
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.BusyLocal)
AppToast.showErrorToast(
message: widget.model.error);
else
Navigator.pop(context);
;
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
}
}),
),
],
widget.model
.addORUpdateDiabtecResult(
isUpdate: widget.isUpdate,
bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: _bloodDiastolicValueController.text.toString(),
systolicePressure: _bloodSystolicValueController.text.toString(),
measuredArm: measuredArm,
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.BusyLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
;
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
}
},
label: TranslationBase.of(context).save.toUpperCase(),
backgroundColor: Colors.red[900],
disabled: isButtonDisabled,
),
),
),
);
));
}
String getDate() {
@ -310,7 +274,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
context: context,
child: RadioStringDialog(
radioList: list,
title: 'Select the Arm',
title: TranslationBase.of(context).selectArm,
selectedValue: measureTimeSelectedType,
onValueSelected: (value) {
setState(() {
@ -324,11 +288,8 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
}
void validateForm() {
print("_bloodSystolicValueController " +
_bloodSystolicValueController.text.length.toString());
if (measureTimeSelectedType != 'Left Arm' &&
_bloodSystolicValueController.text.length > 0 &&
_bloodDiastolicValueController.text.length > 0) {
print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString());
if (measureTimeSelectedType != 'Left Arm' && _bloodSystolicValueController.text.length > 0 && _bloodDiastolicValueController.text.length > 0) {
setState(() {
isButtonDisabled = true;
});

@ -14,14 +14,14 @@ import 'AddBloodPressurePage.dart';
import 'BloodPressureMonthly.dart';
import 'BloodPressureYeaPage.dart';
import 'bloodPressureWeeklyPage.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
class BloodPressureHomePage extends StatefulWidget {
@override
_BloodPressureHomePageState createState() => _BloodPressureHomePageState();
}
class _BloodPressureHomePageState extends State<BloodPressureHomePage>
with SingleTickerProviderStateMixin {
class _BloodPressureHomePageState extends State<BloodPressureHomePage> with SingleTickerProviderStateMixin {
TabController _tabController;
@override
@ -41,78 +41,92 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage>
return BaseView<BloodPressureViewMode>(
onModelReady: (model) => model.getBloodPressure(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodPressure,
baseViewModel: model,
appBarIcons: [IconButton(
icon: Icon(Icons.email),
color: Colors.white,
onPressed: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async{
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if(model.state == ViewState.ErrorLocal){
AppToast.showErrorToast(message: model.error);
}else{
AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, );
}
}).catchError((e){
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
),],
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: TabBarWidget(tabController: _tabController,),
body: Column(
children: <Widget>[
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
BloodPressureWeeklyPage(
model: model,
),
BloodPressureMonthlyPage(
model: model,
),
BloodPressureYearPage(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodPressure,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: TabBarWidget(
tabController: _tabController,
),
body: Column(
children: <Widget>[
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
BloodPressureWeeklyPage(
model: model,
),
BloodPressureMonthlyPage(
model: model,
),
BloodPressureYearPage(
model: model,
)
],
),
)
],
),
floatingActionButton: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddBloodPressurePage(
model: model,
)
],
),
)
],
),
floatingActionButton: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
),
),
),
),
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase.of(context).emailSentSuccessfully,
);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
label: TranslationBase.of(context).sendEmail,
backgroundColor: Colors.red[900],
),
),
)),
);
}
}

@ -16,7 +16,6 @@ class BloodPressureMonthlyPage extends StatelessWidget {
const BloodPressureMonthlyPage({Key key, this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -24,36 +23,43 @@ class BloodPressureMonthlyPage extends StatelessWidget {
return AppScaffold(
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: MonthCurvedChartBloodPressure(
horizontalInterval: 20.0,
title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weighMonthTimeSeriesDataTop.isEmpty?[TimeSeriesSales3(0,0.0)]:model.weighMonthTimeSeriesDataTop,
timeSeries2: model.weighMonthTimeSeriesDataLow.isEmpty?[TimeSeriesSales3(0,0.0)]:model.weighMonthTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
),
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: MonthCurvedChartBloodPressure(
horizontalInterval: 20.0,
title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weighMonthTimeSeriesDataTop.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesDataTop,
timeSeries2: model.weighMonthTimeSeriesDataLow.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Texts(TranslationBase.of(context).details),
// ),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weighMonthTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context,projectViewModel,model),
),
model.weighMonthTimeSeriesDataTop.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
SizedBox(height: 80)
],
),
)
@ -62,8 +68,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
);
}
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, BloodPressureViewMode model) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -78,7 +83,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
),
child: Center(
child: Texts(
'Date',
TranslationBase.of(context).date,
color: Colors.white,
fontSize: 15,
),
@ -93,7 +98,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
),
child: Center(
child: Texts(
'Time',
TranslationBase.of(context).time,
color: Colors.white,
fontSize: 15,
),
@ -107,7 +112,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
),
child: Center(
child: Texts(
'Arm',
TranslationBase.of(context).arm,
color: Colors.white,
fontSize: 15,
),
@ -124,7 +129,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
),
child: Center(
child: Texts(
'SBP/DBP',
TranslationBase.of(context).sysdias,
color: Colors.white,
fontSize: 15,
),
@ -143,8 +148,8 @@ class BloodPressureMonthlyPage extends StatelessWidget {
color: Colors.white,
child: Center(
child: Texts(
'${projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate):DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}',
fontSize: 15,
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}',
fontSize: 12,
textAlign: TextAlign.center,
),
),
@ -155,7 +160,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Center(
child: Texts(
'${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}',
fontSize: 15,
fontSize: 12,
),
),
height: 40),
@ -164,7 +169,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Center(
child: Texts(
diabtec.measuredArmDesc,
fontSize: 15,
fontSize: 12,
),
),
height: 40),
@ -174,7 +179,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Texts(
'${diabtec.systolicePressure}/${diabtec.diastolicPressure}',
color: Colors.red,
fontSize: 15,
fontSize: 12,
),
),
height: 40),

@ -19,38 +19,45 @@ class BloodPressureYearPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body:ListView(
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: CurvedChartBloodPressure(
horizontalInterval: 3.0,// model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0,
horizontalInterval: 3.0, // model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0,
title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weightYearTimeSeriesDataTop.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesDataTop,
timeSeries2: model.weightYearTimeSeriesDataLow.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesDataLow,
timeSeries1: model.weightYearTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataTop,
timeSeries2: model.weightYearTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Texts(TranslationBase.of(context).details),
// ),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightYearTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
model.weightYearTimeSeriesDataTop.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
SizedBox(height: 80)
],
),
)
@ -59,10 +66,7 @@ class BloodPressureYearPage extends StatelessWidget {
);
}
List<TableRow> fullData(
BuildContext context,
ProjectViewModel projectViewModel,
BloodPressureViewMode bloodSugarViewMode) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode bloodSugarViewMode) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -72,12 +76,8 @@ class BloodPressureYearPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -123,12 +123,8 @@ class BloodPressureYearPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(

@ -22,38 +22,45 @@ class BloodPressureWeeklyPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: ListView(
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: CurvedChartBloodPressure(
horizontalInterval:3.0,
horizontalInterval: 3.0,
title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightWeekTimeSeriesDataTop,
timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightWeekTimeSeriesDataLow,
timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataTop,
timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Texts(TranslationBase.of(context).details),
// ),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightWeekTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
model.weightWeekTimeSeriesDataTop.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
SizedBox(height: 80)
],
),
)
@ -62,10 +69,7 @@ class BloodPressureWeeklyPage extends StatelessWidget {
);
}
List<TableRow> fullData(
BuildContext context,
ProjectViewModel projectViewModel,
BloodPressureViewMode bloodSugarViewMode) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode bloodSugarViewMode) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -75,12 +79,8 @@ class BloodPressureWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -140,12 +140,8 @@ class BloodPressureWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
@ -25,15 +26,7 @@ class AddBloodSugarPage extends StatefulWidget {
final int lineItemNo;
final BloodSugarViewMode bloodSugarViewMode;
AddBloodSugarPage(
{Key key,
this.bloodSugarDate,
this.measureUnitSelectedType,
this.isUpdate = false,
this.measuredTime,
this.bloodSugarValue,
this.lineItemNo,
this.bloodSugarViewMode})
AddBloodSugarPage({Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode})
: super(key: key);
@override
@ -83,8 +76,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
measureUnitSelectedType = widget.measureUnitSelectedType;
if (measureTimeEnList.contains(widget.measuredTime))
measuredTime = measureTimeEnList.indexOf(widget.measuredTime);
else if (measureTimeArList.contains(widget.measuredTime))
measuredTime = measureTimeArList.indexOf(widget.measuredTime);
else if (measureTimeArList.contains(widget.measuredTime)) measuredTime = measureTimeArList.indexOf(widget.measuredTime);
_bloodSugarValueController.text = widget.bloodSugarValue;
validateForm();
}
@ -94,246 +86,222 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
appBarTitle: widget.isUpdate
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate
? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
// appBarIcons: widget.isUpdate
// ? [
// IconButton(
// icon: Icon(Icons.delete),
// color: Colors.white,
// onPressed: () {
GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode
.deactivateDiabeticStatus(
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state ==
ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
: null,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: TranslationBase.of(context).sugarAdd,
controller: _bloodSugarValueController,
keyboardType: TextInputType.number,
onChanged: (value) => validateForm(),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureUnitDialog();
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureUnitSelectedType),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
// },
// )
// ]
// : null,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: TranslationBase.of(context).sugarAdd,
controller: _bloodSugarValueController,
keyboardType: TextInputType.number,
onChanged: (value) => validateForm(),
fontWeight: FontWeight.normal,
fontSize: 14,
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureUnitDialog();
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureUnitSelectedType),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
),
),
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(), onConfirm: (date) {
setState(() {
bloodSugarDate = date;
});
},
currentTime: bloodSugarDate,
locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) {
setState(() {
bloodSugarDate = date;
});
}, currentTime: bloodSugarDate, locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
),
),
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true,
onConfirm: (date) {
setState(() {
timeSugarDate = date;
});
},
currentTime: timeSugarDate,
locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
setState(() {
timeSugarDate = date;
});
}, currentTime: timeSugarDate, locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
),
),
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureTimeArList
: measureTimeEnList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType ??
TranslationBase.of(context).other),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType ?? TranslationBase.of(context).other),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
),
),
),
),
],
widget.isUpdate
? Container(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
child: Texts(
TranslationBase.of(context).delete,
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
color: Colors.red[900],
),
onTap: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).removeMeasure,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
],
))
: Container()
],
),
),
),
),
bottomSheet: Container(
color: Colors.transparent,
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.10,
child: Column(
children: [
FractionallySizedBox(
widthFactor: 0.9,
child: SecondaryButton(
label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white,
color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
onTap: () async {
if (_bloodSugarValueController.text.isNotEmpty) {
if (widget.isUpdate) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.bloodSugarViewMode
.updateDiabtecResult(
month: bloodSugarDate,
hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
lineItemNo: widget.lineItemNo,
bloodSugerResult:
_bloodSugarValueController.text.toString());
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
if (_bloodSugarValueController.text.isNotEmpty) {
if (widget.isUpdate) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.bloodSugarViewMode.updateDiabtecResult(
month: bloodSugarDate,
hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
lineItemNo: widget.lineItemNo,
bloodSugerResult: _bloodSugarValueController.text.toString());
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state ==
ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
} else {
GifLoaderDialogUtils.showMyDialog(context);
await widget.bloodSugarViewMode
.addDiabtecResult(
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
bloodSugerResult:
_bloodSugarValueController.text.toString(),
bloodSugerDateChart:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
);
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
} else {
GifLoaderDialogUtils.showMyDialog(context);
await widget.bloodSugarViewMode.addDiabtecResult(
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
bloodSugerResult: _bloodSugarValueController.text.toString(),
bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
);
}
}),
),
],
),
),
);
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}
}
},
label: TranslationBase.of(context).save.toUpperCase(),
backgroundColor: Colors.red[900],
disabled: isButtonDisabled,
),
));
}
String getDate() {

@ -21,10 +21,7 @@ class BloodMonthlyPage extends StatelessWidget {
final List<TimeSeriesSales3> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode;
const BloodMonthlyPage(
{Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode})
: super(key: key);
const BloodMonthlyPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -39,9 +36,7 @@ class BloodMonthlyPage extends StatelessWidget {
color: Colors.white,
child: MonthLineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty
? [TimeSeriesSales3(0, 0.0)]
: timeSeriesData,
timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5,
)),
SizedBox(
@ -60,17 +55,16 @@ class BloodMonthlyPage extends StatelessWidget {
timeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(
TranslationBase.of(context).noDataAvailable),
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
border: TableBorder.symmetric(
inside:
BorderSide(width: 2.0, color: Colors.grey[300]),
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel),
),
SizedBox(height: 80)
],
),
)
@ -79,8 +73,7 @@ class BloodMonthlyPage extends StatelessWidget {
);
}
List<TableRow> fullData(
BuildContext context, ProjectViewModel projectViewModel) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -90,12 +83,8 @@ class BloodMonthlyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -141,12 +130,8 @@ class BloodMonthlyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(

@ -27,46 +27,47 @@ class BloodYearPage extends StatelessWidget {
return AppScaffold(
// baseViewModel: bloodSugarViewMode,
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
width: double.maxFinite,
color: Colors.white,
child: LineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5 ?? 0,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
timeSeriesData.isEmpty
? Container(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
width: double.maxFinite,
color: Colors.white,
child: LineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5 ?? 0,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
timeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
:Table(
: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel),
),
],
),
)
SizedBox(height: 80)
],
),
)
],
),
);
}

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart';
@ -26,8 +27,7 @@ class BloodSugarHomePage extends StatefulWidget {
_BloodSugarHomePageState createState() => _BloodSugarHomePageState();
}
class _BloodSugarHomePageState extends State<BloodSugarHomePage>
with SingleTickerProviderStateMixin {
class _BloodSugarHomePageState extends State<BloodSugarHomePage> with SingleTickerProviderStateMixin {
TabController _tabController;
@override
@ -47,38 +47,17 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
return BaseView<BloodSugarViewMode>(
onModelReady: (model) => model.getBloodSugar(),
builder: (_, model, w) => AppScaffold(
appBarIcons: [IconButton(
icon: Icon(Icons.email),
color: Colors.white,
onPressed: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async{
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if(model.state == ViewState.ErrorLocal){
AppToast.showErrorToast(message: model.error);
}else{
AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, );
}
}).catchError((e){
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
),],
isShowAppBar: true,
showNewAppBar: true,
isShowDecPage: true,
showNewAppBarTitle: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).bloodSugar,
// baseViewModel: model,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: TabBarWidget(tabController: _tabController,),
appBar: TabBarWidget(
tabController: _tabController,
),
body: Column(
children: <Widget>[
Expanded(
@ -93,7 +72,8 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
),
BloodMonthlyPage(
timeSeriesData: model.monthTimeSeriesData,
diabtecPatientResult: model.monthDiabtecPatientResult, bloodSugarViewMode: model,
diabtecPatientResult: model.monthDiabtecPatientResult,
bloodSugarViewMode: model,
),
BloodYearPage(
timeSeriesData: model.yearTimeSeriesData,
@ -107,13 +87,17 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
),
floatingActionButton: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,)));
Navigator.push(
context,
FadePage(
page: AddBloodSugarPage(
bloodSugarViewMode: model,
)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color:Theme.of(context).primaryColor),
decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
@ -122,6 +106,39 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
),
),
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase.of(context).emailSentSuccessfully,
);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
label: TranslationBase.of(context).sendEmail,
backgroundColor: Colors.red[900],
),
),
),
),
);

@ -20,66 +20,61 @@ class BloodSugarWeeklyPage extends StatelessWidget {
final BloodSugarViewMode bloodSugarViewMode;
final List<TimeSeriesSales2> timeSeriesData;
BloodSugarWeeklyPage(
{Key key,
this.diabtecPatientResult,
this.bloodSugarViewMode,
this.timeSeriesData})
: super(key: key);
BloodSugarWeeklyPage({Key key, this.diabtecPatientResult, this.bloodSugarViewMode, this.timeSeriesData}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
// baseViewModel: bloodSugarViewMode,
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: LineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
timeSeriesData.isEmpty
? Container(
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: LineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
timeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
:Table(
: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, bloodSugarViewMode),
),
],
),
SizedBox(
height: 80,
)
],
),
)
],
),
);
}
List<TableRow> fullData(
BuildContext context,
ProjectViewModel projectViewModel,
BloodSugarViewMode bloodSugarViewMode) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodSugarViewMode bloodSugarViewMode) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -89,12 +84,8 @@ class BloodSugarWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -154,12 +145,8 @@ class BloodSugarWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(
@ -186,7 +173,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
color: Colors.white,
child: Center(
child: Texts(
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart):DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ',
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ',
textAlign: TextAlign.center,
fontSize: 12,
),

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart';
import 'Weight/WeightHomePage.dart';
import 'blood_pressure/BloodPressureHomePage.dart';
import 'blood_suger/blood_sugar_home_page.dart';
@ -15,110 +15,136 @@ class MyTrackers extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).myTracker,
isShowAppBar: true,
showNewAppBar: true,
isShowDecPage: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8),
description: TranslationBase.of(context).infoTrackers,
imagesInfo: [
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/ar/0.png')
],
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(12),
margin: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.all(21),
shrinkWrap: true,
children: [
Expanded(
child: InkWell(
onTap: () => Navigator.push(context, FadePage(page: BloodSugarHomePage())),
child: Container(
margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/tracker/blood-suger.png',
width: 60.0,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).bloodSugar),
],
),
),
),
),
Expanded(
child: InkWell(
onTap: () => Navigator.push(context, FadePage(page: BloodPressureHomePage())),
child: Container(
margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/tracker/blood-pressure.png',
width: 60.0,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).bloodPressure),
],
),
),
),
),
],
CardCommonContact(
image: 'assets/tracker/blood-suger.png',
text: TranslationBase.of(context).bloodSugar,
subText: "",
type: 3,
),
Row(
//mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: InkWell(
onTap: () => Navigator.push(context, FadePage(page: WeightHomePage())),
child: Container(
margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/tracker/weight.png',
width: 60.0,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).weight),
],
),
),
),
),
Expanded(
child: Container(),
),
],
CardCommonContact(
image: 'assets/tracker/blood-pressure.png',
text: TranslationBase.of(context).bloodPressure,
subText: "",
type: 4,
),
],
),
),
CardCommonContact(
image: 'assets/tracker/weight.png',
text: TranslationBase.of(context).weight,
subText: "",
type: 5,
)
])
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: InkWell(
// onTap: () => Navigator.push(context, FadePage(page: BloodSugarHomePage())),
// child: Container(
// margin: EdgeInsets.all(5),
// width: MediaQuery.of(context).size.width * 0.35,
// height: MediaQuery.of(context).size.width * 0.35,
// decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// 'assets/tracker/blood-suger.png',
// width: 60.0,
// ),
// SizedBox(
// height: 15,
// ),
// Texts(TranslationBase.of(context).bloodSugar),
// ],
// ),
// ),
// ),
// ),
// Expanded(
// child: InkWell(
// onTap: () => Navigator.push(context, FadePage(page: BloodPressureHomePage())),
// child: Container(
// margin: EdgeInsets.all(5),
// width: MediaQuery.of(context).size.width * 0.35,
// height: MediaQuery.of(context).size.width * 0.35,
// decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// 'assets/tracker/blood-pressure.png',
// width: 60.0,
// ),
// SizedBox(
// height: 15,
// ),
// Texts(TranslationBase.of(context).bloodPressure),
// ],
// ),
// ),
// ),
// ),
// ],
// ),
// Row(
// //mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// Expanded(
// child: InkWell(
// onTap: () => Navigator.push(context, FadePage(page: WeightHomePage())),
// child: Container(
// margin: EdgeInsets.all(5),
// width: MediaQuery.of(context).size.width * 0.35,
// height: MediaQuery.of(context).size.width * 0.35,
// decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// 'assets/tracker/weight.png',
// width: 60.0,
// ),
// SizedBox(
// height: 15,
// ),
// Texts(TranslationBase.of(context).weight),
// ],
// ),
// ),
// ),
// ),
// Expanded(
// child: Container(),
// ),
// ],
// ),
// ],
// ),
),
),
);
}

@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../Constants.dart';
@ -22,6 +24,8 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
TabController _tabController;
List<ImagesInfo> imagesInfo = List();
ProjectViewModel projectViewModel;
@override
void initState() {
super.initState();
@ -40,6 +44,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptions(),
builder: (_, model, widget) => AppScaffold(
@ -71,7 +76,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).prescriptions), Text(TranslationBase.of(context).history)],
tabs: [Text(TranslationBase.of(context).prescriptions, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), Text(TranslationBase.of(context).history, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'))],
),
Expanded(
child: TabBarView(

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -11,6 +12,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MonthlyReportsPage extends StatefulWidget {
@override
@ -36,6 +38,7 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ReportsMonthlyViewModel>(builder: (_, model, w) {
if (isSummary == null) {
isSummary = model.receiveHealthSummaryReport;
@ -184,7 +187,7 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
RichText(
text: TextSpan(
text: TranslationBase.of(context).toViewTheTermsAndConditions + " ",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
children: [
TextSpan(
text: TranslationBase.of(context).clickHere,

@ -3,13 +3,12 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.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/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
@ -81,15 +80,19 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
tabs: [
Text(
TranslationBase.of(context).requested,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
),
Text(
TranslationBase.of(context).ready,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
),
Text(
TranslationBase.of(context).completed,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
),
Text(
TranslationBase.of(context).cancelled,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
),
],
),

@ -7,7 +7,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -38,96 +37,15 @@ class MedicalReports extends StatelessWidget {
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
body: ListView.separated(
physics: BouncingScrollPhysics(),
itemCount: model.appointHistoryList.length,
padding: EdgeInsets.all(21),
separatorBuilder: (context, index) => SizedBox(height: 14),
itemBuilder: (context, index) {
AppointmentHistory _appointmenHistory = model.appointHistoryList[index];
return InkWell(
onTap: () => confirmBox(model.appointHistoryList[index], model),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white),
child: Padding(
padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null)
Text(
(_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Text(
DateUtil.formatDateToDate(_appointmenHistory.appointmentDate, projectViewModel.isArabic),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
],
),
if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: _appointmenHistory.doctorName,
url: _appointmenHistory.doctorImageURL,
width: 48,
height: 48,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic),
if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingBar.readOnly(
initialRating: _appointmenHistory.actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
Icon(Icons.email, color: Color(0xff2B353E))
],
),
],
),
),
],
),
],
),
),
),
);
Container(
physics: BouncingScrollPhysics(),
itemCount: model.appointHistoryList.length,
padding: EdgeInsets.all(21),
separatorBuilder: (context, index) => SizedBox(height: 14),
itemBuilder: (context, index) {
AppointmentHistory _appointmenHistory = model.appointHistoryList[index];
return InkWell(
onTap: () => confirmBox(model.appointHistoryList[index], model),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
@ -135,74 +53,80 @@ class MedicalReports extends StatelessWidget {
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5, right: 5),
child: LargeAvatar(
width: 50,
height: 50,
name: model.appointHistoryList[index].doctorNameObj,
url: model.appointHistoryList[index].doctorImageURL,
),
),
Expanded(
flex: 4,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 12,
),
Texts(model.appointHistoryList[index].projectName),
Texts(model.appointHistoryList[index].clinicName),
Texts(projectViewModel.isArabic
? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate)
: DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)),
StarRating(totalAverage: model.appointHistoryList[index].actualDoctorRate.toDouble(), forceStars: true),
SizedBox(
height: 12,
child: Padding(
padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null)
Text(
_appointmenHistory.doctorTitle.toString() + " " + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
],
),
Text(
DateUtil.formatDateToDate(_appointmenHistory.appointmentDate, projectViewModel.isArabic),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
],
),
),
InkWell(
onTap: () => confirmBox(model.appointHistoryList[index], model),
child: Container(
width: 120,
height: 50,
decoration: BoxDecoration(
color: Colors.black54,
border: Border.all(color: Colors.transparent, width: 2),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(8.0),
if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: _appointmenHistory.doctorName,
url: _appointmenHistory.doctorImageURL,
width: 48,
height: 48,
),
),
child: Center(
child: Texts(
TranslationBase.of(context).requestReport,
fontSize: 12,
color: Colors.white,
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic),
if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingBar.readOnly(
initialRating: _appointmenHistory.actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
Icon(Icons.email, color: Color(0xff2B353E))
],
),
],
),
),
),
],
),
),
SizedBox(
width: 12,
),
],
],
),
),
);
}),
),
);
},
),
),
);
}

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -20,8 +21,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
@ -44,8 +44,7 @@ class LiveCareService extends BaseService {
dynamic localRes;
await baseAppClient.post(GET_LIVECARE_CLINICS,
onSuccess: (response, statusCode) async {
await baseAppClient.post(GET_LIVECARE_CLINICS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
@ -57,8 +56,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
@ -81,12 +79,11 @@ class LiveCareService extends BaseService {
dynamic localRes;
await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINICS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINICS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
@ -94,8 +91,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
@ -119,12 +115,11 @@ class LiveCareService extends BaseService {
dynamic localRes;
await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
@ -132,23 +127,17 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
// Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"TokenID": "",
"SessionID": "YckwoXhUmWBsnHKEKig"
};
request = {"LanguageID": languageID == 'ar' ? 1 : 2, "TokenID": "", "SessionID": "YckwoXhUmWBsnHKEKig"};
dynamic localRes;
await baseAppClient.post(GET_LIVECARE_HISTORY,
onSuccess: (response, statusCode) async {
await baseAppClient.post(GET_LIVECARE_HISTORY, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
@ -156,13 +145,11 @@ class LiveCareService extends BaseService {
return Future.value(localRes);
}
Future<Map> getLivecareClinicTiming(
int serviceID, BuildContext context) async {
Future<Map> getLivecareClinicTiming(int serviceID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
@ -185,8 +172,7 @@ class LiveCareService extends BaseService {
dynamic localRes;
await baseAppClient.post(GET_LIVECARE_CLINIC_TIMING,
onSuccess: (response, statusCode) async {
await baseAppClient.post(GET_LIVECARE_CLINIC_TIMING, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
@ -198,8 +184,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
@ -225,8 +210,7 @@ class LiveCareService extends BaseService {
dynamic localRes;
await baseAppClient.post(GET_ER_APPOINTMENT_FEES,
onSuccess: (response, statusCode) async {
await baseAppClient.post(GET_ER_APPOINTMENT_FEES, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
@ -238,8 +222,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
@ -265,8 +248,7 @@ class LiveCareService extends BaseService {
dynamic localRes;
await baseAppClient.post(GET_ER_APPOINTMENT_TIME,
onSuccess: (response, statusCode) async {
await baseAppClient.post(GET_ER_APPOINTMENT_TIME, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
@ -274,8 +256,7 @@ class LiveCareService extends BaseService {
return Future.value(localRes);
}
Future<Map> addNewCallForPatientER(
int serviceID, String clientRequestID, BuildContext context) async {
Future<Map> addNewCallForPatientER(int serviceID, String clientRequestID, BuildContext context) async {
Map<String, dynamic> request;
String deviceToken;
@ -285,8 +266,7 @@ class LiveCareService extends BaseService {
});
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
@ -316,8 +296,7 @@ class LiveCareService extends BaseService {
dynamic localRes;
await baseAppClient.post(ADD_NEW_CALL_FOR_PATIENT_ER,
onSuccess: (response, statusCode) async {
await baseAppClient.post(ADD_NEW_CALL_FOR_PATIENT_ER, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
@ -334,16 +313,14 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
request = {"VCID": vc_id};
dynamic localRes;
await baseAppClient.post(CANCEL_LIVECARE_REQUEST,
onSuccess: (response, statusCode) async {
await baseAppClient.post(CANCEL_LIVECARE_REQUEST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
@ -351,25 +328,34 @@ class LiveCareService extends BaseService {
return Future.value(localRes);
}
Future<Map> sendLiveCareInvoiceEmail(String appoNo, int projectID,
String emailAddress, BuildContext context) async {
Future<Map> applePayInsertRequest(ApplePayInsertRequest applePayInsertRequest, BuildContext context) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
dynamic localRes;
await baseAppClient.post(APPLE_PAY_INSERT_REQUEST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: applePayInsertRequest.toJson());
return Future.value(localRes);
}
Future<Map> sendLiveCareInvoiceEmail(String appoNo, int projectID, String emailAddress, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
request = {
"To": emailAddress,
"ProjectID": projectID,
"AppointmentNo": appoNo
};
request = {"To": emailAddress, "ProjectID": projectID, "AppointmentNo": appoNo};
dynamic localRes;
await baseAppClient.post(SEND_LIVECARE_INVOICE_EMAIL,
onSuccess: (response, statusCode) async {
await baseAppClient.post(SEND_LIVECARE_INVOICE_EMAIL, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;

@ -2173,39 +2173,25 @@ class TranslationBase {
String get aboutPointsLength => localizedValues["about-points"]['length'][locale.languageCode];
String get timeNeeded => localizedValues["time-needed"][locale.languageCode];
String get totalTimeNeeded =>
localizedValues["total-time-needed"][locale.languageCode];
String get infoEye =>
localizedValues["info-eye"][locale.languageCode];
String get infoVaccines =>
localizedValues["info-vaccines"][locale.languageCode];
String get infoTrackers =>
localizedValues["info-trackers"][locale.languageCode];
String get infoHealthData =>
localizedValues["info-health-data"][locale.languageCode];
String get infoAskDoc =>
localizedValues["info-ask-doc"][locale.languageCode];
String get infoAutoWifi =>
localizedValues["info-auto-wifi"][locale.languageCode];
String get autoWifi =>
localizedValues["auto-wifi"][locale.languageCode];
String get childVaccineInfo =>
localizedValues["child-vaccine-info"][locale.languageCode];
String get h2oInfo =>
localizedValues["h2o-info"][locale.languageCode];
String get askDocEmpty =>
localizedValues["ask-doc-empty"][locale.languageCode];
String get totalTimeNeeded => localizedValues["total-time-needed"][locale.languageCode];
String get infoEye => localizedValues["info-eye"][locale.languageCode];
String get infoVaccines => localizedValues["info-vaccines"][locale.languageCode];
String get infoTrackers => localizedValues["info-trackers"][locale.languageCode];
String get infoHealthData => localizedValues["info-health-data"][locale.languageCode];
String get infoAskDoc => localizedValues["info-ask-doc"][locale.languageCode];
String get infoAutoWifi => localizedValues["info-auto-wifi"][locale.languageCode];
String get autoWifi => localizedValues["auto-wifi"][locale.languageCode];
String get childVaccineInfo => localizedValues["child-vaccine-info"][locale.languageCode];
String get h2oInfo => localizedValues["h2o-info"][locale.languageCode];
String get sysdias => localizedValues["sys/dias"][locale.languageCode];
String get arm => localizedValues["arm"][locale.languageCode];
String get removeMeasure => localizedValues["remove-measure"][locale.languageCode];
String get selectArm => localizedValues["select-arm"][locale.languageCode];
String get askDocEmpty => localizedValues["ask-doc-empty"][locale.languageCode];
String get onlineClinics => localizedValues["online-clinics"][locale.languageCode];
String get offlineClinics => localizedValues["offline-clinics"][locale.languageCode];
String get clinicSchedule => localizedValues["clinic-schedule"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -931,6 +931,12 @@ String labelFrom({@required String className}) {
return result;
}
extension StringExtension on String {
String capitalize() {
return this.splitMapJoin(RegExp(r'\w+'), onMatch: (m) => '${m.group(0)}'.substring(0, 1).toUpperCase() + '${m.group(0)}'.substring(1).toLowerCase(), onNonMatch: (n) => ' ');
}
}
/*
userBoard.asMap().map((i, element) => MapEntry(i, Stack(
GestureDetector(onTap: () {

@ -237,7 +237,7 @@ class _TextsState extends State<Texts> {
letterSpacing: widget.variant == "overline" ? 1 : null,
fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily:
projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
),
if (widget.readMore && text.length > widget.maxLength && hidden)
Positioned(

@ -10,12 +10,7 @@ class RadioStringDialog extends StatefulWidget {
final String title;
String selectedValue;
RadioStringDialog(
{Key key,
this.radioList,
this.onValueSelected,
this.selectedValue,
this.title});
RadioStringDialog({Key key, this.radioList, this.onValueSelected, this.selectedValue, this.title});
@override
_RadioStringDialogState createState() => _RadioStringDialogState();
@ -40,9 +35,7 @@ class _RadioStringDialogState extends State<RadioStringDialog> {
))),
children: [
Container(
height: widget.radioList.length > 3
? MediaQuery.of(context).size.height * 0.6
: null,
height: widget.radioList.length > 3 ? MediaQuery.of(context).size.height * 0.6 : null,
child: SingleChildScrollView(
child: Column(
children: [
@ -52,9 +45,9 @@ class _RadioStringDialogState extends State<RadioStringDialog> {
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
// SizedBox(
// height: 2,
// ),
Row(
children: <Widget>[
Expanded(
@ -62,12 +55,14 @@ class _RadioStringDialogState extends State<RadioStringDialog> {
child: InkWell(
onTap: () {
setState(() {
widget.selectedValue =
widget.radioList[index];
widget.selectedValue = widget.radioList[index];
});
},
child: ListTile(
title: Text(widget.radioList[index]),
title: Texts(
widget.radioList[index],
fontSize: 14,
),
leading: Radio(
value: widget.radioList[index],
groupValue: widget.selectedValue,
@ -83,66 +78,61 @@ class _RadioStringDialogState extends State<RadioStringDialog> {
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
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,
),
),
),
),
],
),
),
),
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,
),
),
),
),
),
),
),
),
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,
),
],
)
],
),
),
),
),
),
],
)
],
);

@ -5,17 +5,21 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT }
var _InAppBrowserOptions = InAppBrowserClassOptions(
inAppWebViewGroupOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)),
inAppWebViewGroupOptions: InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)),
crossPlatform: InAppBrowserOptions(hideUrlBar: true),
ios: IOSInAppBrowserOptions(
toolbarBottom: false,
@ -23,38 +27,28 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType;
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live
static String PRESCRIPTION_PAYMENT_WITH_ORDERID = 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live
// Packages
static String PACKAGES_REQUEST_PAYMENT_URL =
'$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1';
static String PACKAGES_PAYMENT_SUCCESS_URL =
'$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess';
static String PACKAGES_PAYMENT_FAIL_URL =
'$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed';
static List<String> successURLS = [
'success',
'PayFortResponse',
'PayFortSucess',
'mobilepaymentcomplete'
];
static String PACKAGES_REQUEST_PAYMENT_URL = '$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1';
static String PACKAGES_PAYMENT_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess';
static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed';
static List<String> successURLS = ['success', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete'];
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed'];
@ -76,8 +70,7 @@ class MyInAppBrowser extends InAppBrowser {
static bool isPaymentDone = false;
MyInAppBrowser(
{this.onExitCallback, this.appo, this.onLoadStartCallback, this.context});
MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback, this.context});
Future onBrowserCreated() async {
print("\n\nBrowser Created!\n\n");
@ -99,8 +92,7 @@ class MyInAppBrowser extends InAppBrowser {
}
@override
void onProgressChanged(int progress) {
}
void onProgressChanged(int progress) {}
@override
void onExit() {
@ -109,14 +101,11 @@ class MyInAppBrowser extends InAppBrowser {
}
@override
Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(
ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async {
Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async {
var url = shouldOverrideUrlLoadingRequest.url;
debugPrint("redirecting/overriding to: $url");
if (paymentType == _PAYMENT_TYPE.PACKAGES &&
[PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL]
.contains(url)) {
if (paymentType == _PAYMENT_TYPE.PACKAGES && [PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL].contains(url)) {
isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL);
close();
}
@ -135,86 +124,88 @@ class MyInAppBrowser extends InAppBrowser {
getPatientData() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
if (await this.sharedPref.getDouble(USER_LAT) != null &&
await this.sharedPref.getDouble(USER_LONG) != null) {
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);
}
}
openPackagesPaymentBrowser(
{@required int customer_id, @required int order_id}) {
openPackagesPaymentBrowser({@required int customer_id, @required int order_id}) {
paymentType = _PAYMENT_TYPE.PACKAGES;
var full_url =
'$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id';
var full_url = '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id';
this.openUrl(url: full_url, options: _InAppBrowserOptions);
}
openPaymentBrowser(
double amount,
String orderDesc,
String transactionID,
String projId,
String emailId,
String paymentMethod,
dynamic patientType,
String patientName,
dynamic patientID,
AuthenticatedUser authenticatedUser,
InAppBrowser browser,
bool isLiveCareAppo,
var servID,
var LiveServID,
[var appoDate,
var appoNo,
var clinicID,
var doctorID]) {
openPaymentBrowser(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID,
AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, var servID, var LiveServID,
[var appoDate, var appoNo, var clinicID, var doctorID]) async {
this.browser = browser;
getPatientData();
generateURL(
amount,
orderDesc,
transactionID,
projId,
emailId,
paymentMethod,
patientType,
patientName,
patientID,
authenticatedUser,
isLiveCareAppo,
servID,
LiveServID,
appoDate,
appoNo,
clinicID,
doctorID)
.then((value) {
paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrl(url: value, options: _InAppBrowserOptions);
});
await getPatientData();
if (paymentMethod == "ApplePay") {
MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo);
if (context != null) GifLoaderDialogUtils.showMyDialog(context);
LiveCareService service = new LiveCareService();
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
applePayInsertRequest.clientRequestID = transactionID;
applePayInsertRequest.clinicID = clinicID != null ? clinicID : 0;
applePayInsertRequest.currency = authenticatedUser.outSA == 1 ? "AED" : "SAR";
applePayInsertRequest.customerEmail = emailId;
applePayInsertRequest.customerID = authenticatedUser.patientID;
applePayInsertRequest.customerName = authenticatedUser.firstName;
applePayInsertRequest.deviceToken = deviceToken;
applePayInsertRequest.doctorID = doctorID != null ? doctorID : 0;
applePayInsertRequest.projectID = projId;
applePayInsertRequest.serviceID = servID;
applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = authenticatedUser.patientID;
applePayInsertRequest.patientTypeID = authenticatedUser.patientType;
applePayInsertRequest.patientOutSA = authenticatedUser.outSA;
applePayInsertRequest.appointmentDate = appoDate != null ? appoDate : null;
applePayInsertRequest.appointmentNo = appoNo != null ? appoNo : 0;
applePayInsertRequest.orderDescription = orderDesc;
applePayInsertRequest.liveServiceID = LiveServID;
applePayInsertRequest.latitude = this.lat.toString();
applePayInsertRequest.longitude = this.long.toString();
applePayInsertRequest.amount = amount.toString();
applePayInsertRequest.isSchedule = "0";
applePayInsertRequest.language = getLanguageID() == 'ar' ? 'AR' : 'EN';
applePayInsertRequest.userName = authenticatedUser.patientID;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) {
if (context != null) GifLoaderDialogUtils.hideDialog(context);
var url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result'];
print(url);
safariBrowser.open(url: url);
// this.browser.openUrl(url: url, options: _InAppBrowserOptions);
}).catchError((err) {
print(err);
if (context != null) GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
} else {
generateURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo,
clinicID, doctorID)
.then((value) {
paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrl(url: value, options: _InAppBrowserOptions);
});
}
}
openPharmacyPaymentBrowser(
OrderDetailModel order,
double amount,
String orderDesc,
String transactionID,
String emailId,
String paymentMethod,
String patientName,
dynamic patientID,
AuthenticatedUser authenticatedUser,
InAppBrowser browser) {
openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID,
AuthenticatedUser authenticatedUser, InAppBrowser browser) {
this.browser = browser;
getPatientData();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId,
paymentMethod, patientName, patientID, authenticatedUser)
.then((value) {
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) {
this.browser.openUrl(url: value);
});
}
@ -224,25 +215,9 @@ class MyInAppBrowser extends InAppBrowser {
this.browser.openUrl(url: url, options: _InAppBrowserOptions);
}
Future<String> generateURL(
double amount,
String orderDesc,
String transactionID,
String projId,
String emailId,
String paymentMethod,
dynamic patientType,
String patientName,
dynamic patientID,
AuthenticatedUser authUser,
bool isLiveCareAppo,
var servID,
var LiveServID,
[var appoDate,
var appoNo,
var clinicID,
var doctorID,
var patientData]) async {
Future<String> generateURL(double amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID,
AuthenticatedUser authUser, bool isLiveCareAppo, var servID, var LiveServID,
[var appoDate, var appoNo, var clinicID, var doctorID, var patientData]) async {
getDeviceToken();
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = isLiveCareAppo ? getLiveCareForm() : getForm();
@ -256,19 +231,15 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('PROJECT_ID_VALUE', projId);
form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod);
form = form.replaceFirst('LANG_VALUE', currentLanguageID);
form = form.replaceFirst('PATIENT_OUT_SA',
authUser.outSA == 0 ? false.toString() : true.toString());
form = form.replaceFirst(
'PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1");
form = form.replaceFirst('PATIENT_OUT_SA', authUser.outSA == 0 ? false.toString() : true.toString());
form = form.replaceFirst('PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1");
form = form.replaceFirst(
'DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString());
form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString());
if (servID == "4")
form = form.replaceFirst(
'SERVICE_URL_VALUE', MyInAppBrowser.PREAUTH_SERVICE_URL);
form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.PREAUTH_SERVICE_URL);
else
form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.SERVICE_URL);
@ -297,19 +268,8 @@ class MyInAppBrowser extends InAppBrowser {
}
Future<String> generatePharmacyURL(
OrderDetailModel order,
double amount,
String orderDesc,
String transactionID,
String emailId,
String paymentMethod,
String patientName,
dynamic patientID,
AuthenticatedUser authUser) async {
String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID +
order.orderGuid +
'&&CustomerId=' +
"${order.customerId}";
OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, AuthenticatedUser authUser) async {
String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID + order.orderGuid + '&&CustomerId=' + "${order.customerId}";
return pharmacyURL;
}
@ -380,10 +340,18 @@ class MyInAppBrowser extends InAppBrowser {
'</body>' +
'</html>';
}
safariCallBack() {
print("Safari CallBack!!!");
}
}
class MyChromeSafariBrowser extends ChromeSafariBrowser {
MyChromeSafariBrowser(browserFallback) : super(bFallback: browserFallback);
final Function onExitCallback;
final Function onLoadStartCallback;
AppoitmentAllHistoryResultList appo;
MyChromeSafariBrowser(browserFallback, {@required this.onExitCallback, @required this.onLoadStartCallback, @required this.appo}) : super(bFallback: browserFallback);
@override
void onOpened() {
@ -393,10 +361,13 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
@override
void onCompletedInitialLoad() {
print("ChromeSafari browser initial load completed");
onLoadStartCallback("ApplePay");
}
@override
void onClosed() {
print("ChromeSafari browser closed");
MyInAppBrowser.isPaymentDone = true;
onExitCallback();
}
}

@ -18,7 +18,8 @@ class AppExpandableNotifier extends StatefulWidget {
final bool isExpand;
bool expandFlag = false;
var controller = new ExpandableController();
AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false});
bool isTitleSingleLine;
AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false, this.isTitleSingleLine = true});
_AppExpandableNotifier createState() => _AppExpandableNotifier();
}
@ -66,7 +67,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
header: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 12, left: 21, right: 21),
child: InkWell(
onTap: (){
onTap: () {
setState(() {
widget.expandFlag = !widget.expandFlag;
widget.controller.expanded = widget.expandFlag;
@ -80,16 +81,23 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (_mainTitle.isNotEmpty)
if (_mainTitle.isNotEmpty && widget.isTitleSingleLine)
Text(
_mainTitle,
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1),
),
// Text(
// _subTitle,
// maxLines: 1,
// style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24),
// ),
if (_title.isNotEmpty && !widget.isTitleSingleLine)
Text(
_title,
maxLines: 1,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2E303A), letterSpacing: -1.44, height: 25 / 24),
),
if (_subTitle.isNotEmpty && !widget.isTitleSingleLine)
Text(
_subTitle,
maxLines: 1,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 23 / 12),
),
],
),
),

@ -113,12 +113,13 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
void initState() {
controller = AnimationController(vsync: this, duration: Duration(seconds: 1));
offset = Tween<Offset>(begin: Offset(0.0, 1.0), end: Offset(0.0, 0.0)).animate(controller);
if (IS_VOICE_COMMAND_CLOSED == true) {
controller.reverse(from: -1);
} else {
if (mounted) {
//Future.delayed(const Duration(seconds: 2), () {
_currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode;
setState(() {
if (IS_TEXT_COMPLETED) {
isAnimationEnable = false;
@ -222,13 +223,14 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
}
startVoiceSearch() async {
_currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode;
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
_currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (available) {
speech.listen(
onResult: resultListener,
// listenMode: ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
//listenMode: ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA',
);
} else {
print("The user has denied the use of speech recognition.");

Loading…
Cancel
Save