Merge branch 'Haroon' into 'development'

Haroon

See merge request Cloud_Solution/diplomatic-quarter!268
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit 30d525791d

@ -0,0 +1,14 @@
{
"client":{
"appType":"1",
"cp_id":"2640966000002322881",
"product_id":"736430079244816576",
"client_id":"563737844552565952",
"client_secret":"9C9A2C272576B8AE6E886C78AF944E8354B91F0AF3381129BB8369FB35E41C47",
"project_id":"736430079244816576",
"app_id":"103856487",
"api_key":"CgB6e3x90XxBrOCMun809w+DOzcFEettcBDUF3fqaLry1ViqTeJqoPwpfaOq/uGw//x0oYwucu9aWazs+Rdj0GUF",
"package_name":"com.cloud.diplomaticquarterapp"
},
"configuration_version":"1.0"
}

@ -0,0 +1,14 @@
{
"client":{
"appType":"1",
"cp_id":"2640966000002322881",
"product_id":"736430079244816567",
"client_id":"563735388191982656",
"client_secret":"650C7C799812AFFD53A10C7756CF05FB9F215A7E49032ABA8EBF3E14B77535CF",
"project_id":"736430079244816567",
"app_id":"102857389",
"api_key":"CgB6e3x9DJzMgRCmnT6dyUEkp6UsIfddb6l3w0ZEXzeiRMHEFi3400Z5fJ5qaHneU0OrAI/JRpk+DMGVs3QpUxlI",
"package_name":"com.ejada.hmg"
},
"configuration_version":"1.0"
}

@ -1,39 +1,37 @@
{
"project_info": {
"project_number": "815750722565",
"firebase_url": "https://api-project-815750722565.firebaseio.com",
"project_id": "api-project-815750722565",
"storage_bucket": "api-project-815750722565.appspot.com"
"project_number": "864393916058",
"firebase_url": "https://diplomaticquarter-d2385.firebaseio.com",
"project_id": "diplomaticquarter-d2385",
"storage_bucket": "diplomaticquarter-d2385.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063",
"mobilesdk_app_id": "1:864393916058:android:5b5a65cd6d8c18b4b97923",
"android_client_info": {
"package_name": "com.cloud.diplomaticquarterapp"
}
},
"oauth_client": [
{
"client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com",
"client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw"
"current_key": "AIzaSyBdV3mos1BPhUzNKCj2KANJtiO3o2zh9IM"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
"other_platform_oauth_client": [
{
"client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}

@ -1333,12 +1333,14 @@ const Map localizedValues = {
"app-update": {
"en": "UPDATE THE APP",
"ar": "تحديث التطبيق"
}, "covid-alert": {
"en": "Alert",
"ar": "تنبيه"
},
"enterIdentificationNumber": {"en" : "Enter Identification Number", "ar": "أدخل رقم التعريف"},
"accountActivationDesc": {"en" : "This service allows you to activate your LAKUM account after registering through the Vida system.", "ar": "تتيح لك هذه الخدمة تفعيل حساب LAKUM الخاص بك بعد التسجيل من خلال نظام Vida."},
"pointsToTransfer": {"en" : "Point's to Transfer :", "ar": "النقاط المراد تحويلها:"},
"enterBeneficiaryAccountNo": {"en" : "Enter Beneficiary Account No.", "ar": "أدخل رقم حساب المستفيد"},
// "visit": {"en" : "Visit", "ar": "الزيارة"},
"confirm-prescription": {
"en": "Are you sure !! you want to send this request",
"ar": "تاكيد ارسال الطلب؟"

@ -5,8 +5,8 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -46,7 +46,7 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
Map<String,String> headers = {
Map<String, String> headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
@ -125,8 +125,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),
body: json.encode(body),
headers: headers);
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -164,21 +163,24 @@ class BaseAppClient {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if(parsed['ErrorSearchMsg'] == null ){
onFailure("Server Error found with no available message",
statusCode);
}else {
onFailure(parsed['ErrorSearchMsg'],
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message",
statusCode);
} else {
onFailure(parsed['ErrorSearchMsg'], statusCode);
}
} else {
onFailure(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
}
} else {
onFailure(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
}
} else if (!parsed['IsAuthenticated']) {
await logout();

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
@ -13,9 +14,11 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:table_calendar/table_calendar.dart';
class CovidTimeSlots extends StatefulWidget {
@ -28,6 +31,8 @@ class CovidTimeSlots extends StatefulWidget {
int selectedClinicID;
int selectedDoctorID;
var language;
PatientShareResponse patientShareResponse;
CovidTimeSlots({@required this.projectID});
@ -89,10 +94,10 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
super.dispose();
}
void _onDaySelected(DateTime day, List events) {
void _onDaySelected(DateTime day, List events, ProjectViewModel projectViewModel) {
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day);
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en");
openTimeSlotsPickerForDate(day, docFreeSlots);
CovidTimeSlots.selectedDate = formatter.format(day);
print(CovidTimeSlots.selectedDate);
@ -111,6 +116,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
@ -170,11 +176,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
borderRadius: BorderRadius.circular(10.0),
color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0),
padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0),
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.65,
// height: MediaQuery.of(context).size.height * 0.65,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.all(10.0),
@ -219,7 +226,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
},
),
),
_buildTableCalendarWithBuilders(),
_buildTableCalendarWithBuilders(projectViewModel),
],
),
),
@ -253,7 +260,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
onPressed: () {
bookCovidTestAppointment();
},
child: Text("BOOK", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
),
),
),
@ -264,9 +271,9 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
);
}
Widget _buildTableCalendarWithBuilders() {
Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
return TableCalendar(
locale: 'en_US',
locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US',
calendarController: _calendarController,
events: _events,
initialCalendarFormat: CalendarFormat.month,
@ -351,6 +358,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
_onDaySelected(
date,
event,
projectViewModel
);
_animationController.forward(from: 0.0);
},
@ -488,7 +496,6 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
CovidTimeSlots.selectedDate,
context)
.then((res) {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
@ -525,8 +532,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo,
BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
@ -560,10 +567,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
navigateToPaymentAlert() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CovidPaymentAlert(
patientShareResponse: widget.patientShareResponse)));
context,
FadePage(
page: CovidPaymentAlert(
patientShareResponse: widget.patientShareResponse),
),
);
}
getCovidFreeSlots(BuildContext context, int projectID) {

@ -1,7 +1,13 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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';
@ -15,10 +21,13 @@ class CovidPaymentAlert extends StatefulWidget {
}
class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "COVID-19 TEST",
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
body: SingleChildScrollView(
child: Column(
@ -43,7 +52,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 30.0, right: 20.0),
child: Text("Alert",
child: Text(TranslationBase.of(context).covidAlert,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
@ -54,7 +63,8 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
margin: EdgeInsets.only(
left: 30.0, right: 20.0, top: 5.0),
child: Text(
"Pay With-in 15 mins to confirm the appointment",
TranslationBase.of(context).covidAlertHeader,
// "Pay With-in 15 mins to confirm the appointment",
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.white, fontSize: 20.0)),
@ -72,7 +82,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
children: <Widget>[
Container(
alignment: Alignment.center,
child: Text("Pay With-in 15 mins",
child: Text(TranslationBase.of(context).covidAlertMins,
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
@ -83,7 +93,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
alignment: Alignment.center,
margin: EdgeInsets.only(top: 15.0),
child: Text(
"Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically.",
TranslationBase.of(context).covidAlertInfo,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey[700],
@ -115,7 +125,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
Container(
margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text("COVID-19 TEST",
child: Text(TranslationBase.of(context).covidTest,
style: TextStyle(
fontSize: 18.0,
color: Colors.black,
@ -137,10 +147,12 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
child: Text(
widget.patientShareResponse.projectName !=
null
? widget.patientShareResponse.projectName
? widget
.patientShareResponse.projectName
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
fontSize: 18.0,
color: Colors.grey[700])),
),
],
),
@ -159,14 +171,16 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
)),
Container(
child: Text(
widget.patientShareResponse.appointmentDate !=
widget.patientShareResponse
.appointmentDate !=
null
? getDate(widget.patientShareResponse
.appointmentDate)
.split(" ")[0]
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
fontSize: 18.0,
color: Colors.grey[700])),
),
],
),
@ -185,14 +199,16 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
)),
Container(
child: Text(
widget.patientShareResponse.appointmentDate !=
widget.patientShareResponse
.appointmentDate !=
null
? getDate(widget.patientShareResponse
.appointmentDate)
.split(" ")[1]
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
fontSize: 18.0,
color: Colors.grey[700])),
),
],
),
@ -216,7 +232,8 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
.patientShareResponse.doctorNameObj
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
fontSize: 18.0,
color: Colors.grey[700])),
),
],
),
@ -251,9 +268,9 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
// bookCovidTestAppointment();
startPaymentProcess();
},
child: Text("NEXT", style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
),
),
),
@ -264,6 +281,37 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
);
}
startPaymentProcess() {
navigateToPaymentMethod(context, widget.patientShareResponse);
}
Future navigateToPaymentMethod(
context, PatientShareResponse patientShareResponse) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
}
Navigator.push(
context, MaterialPageRoute(builder: (context) => PaymentMethod()))
.then((value) {
print(value);
if (value != null) {
Navigator.push(
context,
FadePage(
page: CovidPaymentSummary(
patientShareResponse: widget.patientShareResponse,
selectedPaymentMethod: value.toString()),
),
);
}
});
}
String getDate(String appoDate) {
var appoDateFormatted = "";

@ -0,0 +1,331 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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: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/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget {
PatientShareResponse patientShareResponse;
final String selectedPaymentMethod;
MyInAppBrowser browser;
AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = "";
CovidPaymentSummary(
{@required this.patientShareResponse, this.selectedPaymentMethod});
@override
_CovidPaymentSummaryState createState() => _CovidPaymentSummaryState();
}
class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).confirmThePayment,
textAlign: TextAlign.center,
fontWeight: FontWeight.w500,
fontSize: 24,
),
SizedBox(
height: 12,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: 100.0,
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width * 0.45,
child:
Image.asset(getImagePath(widget.selectedPaymentMethod)),
),
Texts(
'${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar,
fontSize: 26,
bold: true,
)
],
),
SizedBox(
height: 12,
),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.all(3),
child: NewTextFields(
hintText: TranslationBase.of(context).fileNumber,
initialValue:
projectViewModel.user.patientID.toString(),
isEnabled: false,
),
),
),
Expanded(
child: Container(
margin: EdgeInsets.all(3),
child: NewTextFields(
hintText: TranslationBase.of(context).name,
initialValue: projectViewModel.user.firstName,
isEnabled: false,
),
),
),
],
),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).mobileNumber,
initialValue: projectViewModel.user.mobileNumber,
isEnabled: false,
),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).depositorName,
initialValue: projectViewModel.user.firstName +
" " +
projectViewModel.user.middleName +
" " +
projectViewModel.user.lastName,
isEnabled: false,
),
],
),
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).confirm.toUpperCase(),
onTap: () {
startPaymentProcess(projectViewModel.user);
},
),
),
);
}
startPaymentProcess(AuthenticatedUser authenticatedUser) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientShareResponse.projectID;
appo.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
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);
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,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
}
}
onBrowserLoadStart(String url) {
print("onBrowserLoadStart");
print(url);
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
MyInAppBrowser.isPaymentDone = true;
return;
}
});
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
MyInAppBrowser.isPaymentDone = false;
return;
}
});
}
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
if (isPaymentMade) checkPaymentStatus(appo);
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
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'];
if (paymentInfo == 'Success') {
createAdvancePayment(res, appo);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
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) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString());
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
addAdvancedNumberRequest(
String advanceNumber, String paymentReference, String appointmentID) {
DoctorsListService service = new DoctorsListService();
service
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context)
.then((res) {
print(res);
getAppoQR(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
getAppoQR(context) {
DoctorsListService service = new DoctorsListService();
service
.generateAppointmentQR(widget.patientShareResponse, context)
.then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
navigateToQR(context, res['AppointmentQR']);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
Future navigateToQR(context, String appoQR) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => QRCode(
patientShareResponse: widget.patientShareResponse,
appoQR: appoQR,
)));
}
String getImagePath(String paymentMethod) {
switch (paymentMethod) {
case "MADA":
return 'assets/images/new-design/mada.png';
break;
case "SADAD":
return 'assets/images/new-design/sadad.png';
break;
case "VISA":
return 'assets/images/new-design/visa.png';
break;
case "MASTERCARD":
return 'assets/images/new-design/mastercard.png';
break;
case "Installment":
return 'assets/images/new-design/installment.png';
break;
}
return 'assets/images/new-design/mada.png';
}
}

@ -367,7 +367,7 @@ class _ToDoState extends State<ToDo> {
height: 30.0,
margin: projectViewModel.isArabic
? EdgeInsets.fromLTRB(160.0, 0.0, 30.0, 0.0)
: EdgeInsets.fromLTRB(30.0, 0.0, 160.0, 0.0),
: EdgeInsets.fromLTRB(20.0, 0.0, 160.0, 0.0),
transform: Matrix4.translationValues(0.0, -8.0, 0.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
@ -392,7 +392,7 @@ class _ToDoState extends State<ToDo> {
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
fontSize: 11.0)),
)
: Container(
child: Text(
@ -401,7 +401,7 @@ class _ToDoState extends State<ToDo> {
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
fontSize: 11.0)),
)
],
),

@ -27,7 +27,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
alignment: Alignment.center,
child: Text("Select Payment Method",
child: Text(TranslationBase.of(context).selectPaymentOption,
style: TextStyle(
fontSize: 26.0, fontWeight: FontWeight.bold)),
),

@ -289,13 +289,22 @@ class _HomePageState extends State<HomePage> {
SizedBox(
height: 8,
),
Texts(
model.user.firstName +
" " +
model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
Row(
children: [
Texts(
model.user.firstName +
" " +
model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
Container(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
child: SvgPicture.asset(
"assets/images/new-design/verification_check.svg"),
),
],
),
Texts(
'${model.user.patientID}',

@ -1,5 +1,8 @@
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/stepsTracker.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
// import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart';
class HealthDataList extends StatefulWidget {
@ -8,13 +11,30 @@ class HealthDataList extends StatefulWidget {
}
class _HealthDataListState extends State<HealthDataList> {
// List<DataType> dataTypes = List();
@override
void initState() {
// dataTypes.add(DataType.DISTANCE);
// dataTypes.add(DataType.STEP_COUNT);
// dataTypes.add(DataType.HEART_RATE);
// dataTypes.add(DataType.SLEEP);
// dataTypes.add(DataType.ENERGY);
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "Smartwatches",
isShowAppBar: true,
body: Container(
height: MediaQuery.of(context).size.height,
height: MediaQuery
.of(context)
.size
.height,
margin: EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: Column(
@ -58,21 +78,31 @@ class _HealthDataListState extends State<HealthDataList> {
Divider(
color: Colors.grey[500],
),
Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Steps",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: StepsTracker(),
),
);
},
child: Row(
children: [
Container(
child: Image.asset(
"assets/images/SmartWatches/heartrate_icon.png",
width: 60.0,
height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
child: Text("Steps",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
),
Divider(
color: Colors.grey[500],
@ -121,25 +151,68 @@ class _HealthDataListState extends State<HealthDataList> {
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.1,
height: MediaQuery
.of(context)
.size
.height * 0.1,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(
color: Colors.transparent,
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () {
// launch(model.radImageURL);
},
label: 'Sync Health Data',
backgroundColor: Colors.grey[800],
),
),
InkWell(
onTap: () {
print("ReadLast");
// readLast();
},
child:Container(
height: (MediaQuery
.of(context)
.size
.height/2)*0.12,
width: MediaQuery
.of(context)
.size
.width * 0.8,
decoration: BoxDecoration(
color: Colors.grey[800],
borderRadius: BorderRadius.circular(6.0),
),
child: Container(
padding: EdgeInsets.only(top: 10.0),
child: Text(
'Sync Health Data' , textAlign: TextAlign.center,style: TextStyle(
color: Colors.white , fontSize: 18.0
),
),
),),),
],
),
));
}
}
// void readLast() async {
// print("ReadLast");
// final result = await FitKit.readLast(DataType.DISTANCE);
// print(result);
// print(result);
// }
//
// void readAll() async {
// if (await FitKit.requestPermissions(dataTypes)) {
// for (DataType type in dataTypes) {
// final results = await FitKit.read(
// type,
// dateFrom: DateTime.now().subtract(Duration(days: 7)),
// dateTo: DateTime.now(),
// limit: 100,
// );
// print(results);
// print(results.length);
// }
// readLast();
// }
// }
}

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/healt
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
@ -88,8 +89,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 1",
"Apple Watch Series 1", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -108,8 +110,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 2",
"Apple Watch Series 2", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -135,8 +138,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 3",
"Apple Watch Series 3", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -155,8 +159,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 4",
"Apple Watch Series 4", overflow: TextOverflow.clip ,
style: TextStyle(
fontSize: 12.0)),
)
@ -182,8 +187,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 5",
"Apple Watch Series 5", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -202,8 +208,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Apple Watch Series 6",
"Apple Watch Series 6", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -229,7 +236,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 3",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Mi Band 3", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -248,7 +256,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 4",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Mi Band 4", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -417,9 +426,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(
enableInfiniteScroll: false,
viewportFraction: 0.95,
height: MediaQuery.of(context).size.height * 0.9),
// enableInfiniteScroll: true,
viewportFraction: 0.99,
height: MediaQuery.of(context).size.height*1.02 ),
items: [1, 2].map((i) {
return Builder(
builder: (BuildContext context) {
@ -427,7 +436,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
margin: EdgeInsets.only(top:16.0 , bottom: 8.0),
// fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
@ -457,8 +467,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Huawei Watch 2",
"Huawei Watch 2", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -477,8 +488,10 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"Mobovi TicWatch E2",
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -504,7 +517,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Huawei Watch",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Huawei Watch", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -523,7 +537,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Fossil Sport",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Fossil Sport", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -549,8 +564,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"MisFit Vapor 2",
"MisFit Vapor 2", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -569,8 +585,9 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
width: MediaQuery.of(context).size.width*0.22,
child: Text(
"LG Watch Sport",
"LG Watch Sport", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -596,7 +613,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 3",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Mi Band 3", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -615,7 +633,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
child: Text("Mi Band 4",
width: MediaQuery.of(context).size.width*0.22,
child: Text("Mi Band 4", overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 12.0)),
)
@ -735,7 +754,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
),
Container(
margin: EdgeInsets.fromLTRB(
15.0, 95.0, 15.0, 15.0),
15.0, 75.0, 15.0, 15.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:

@ -84,6 +84,7 @@ class _StepsTrackerState extends State<StepsTracker>
print(res['Med_GetYearStepsTransactionsStsList']);
yearlyStepsList.clear();
res['Med_GetYearStepsTransactionsStsList'].forEach((element) {
print('in forEach');
yearlyStepsList.add(new YearlyStepsResModel.fromJson(element));
if (element['ValueSum'] != null) {
double value = element['ValueSum'];
@ -91,7 +92,7 @@ class _StepsTrackerState extends State<StepsTracker>
dataLength++;
}
});
print("innnnnnnnnnnnnnnnn");
print(avgStepsValue);
print(dataLength);
setState(() {

@ -1116,6 +1116,7 @@ class TranslationBase {
String get youAlreadyHaveOrder => localizedValues["you-already-have-order"][locale.languageCode];
String get orderOverview => localizedValues["order-overview"][locale.languageCode];
String get shippingAddresss => localizedValues["shipping-address"][locale.languageCode];
String get covidAlert => localizedValues["covid-alert"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save