Merge branch 'Haroon' into 'master'

Haroon

See merge request Cloud_Solution/diplomatic-quarter!74
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit 50dffe9af9

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -272,6 +272,10 @@ const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetP
const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
///Smartwatch Integration Services
const GET_PATIENT_LAST_RECORD =
'Services/Patients.svc/REST/Med_GetPatientLastRecord';
///My Trackers
const GET_DIABETIC_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';

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

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

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

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

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

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

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

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

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

@ -98,10 +98,10 @@ class _HomePageState extends State<HomePage> {
Container(
margin: EdgeInsets.only(
top: 15.0, left: 3.5, right: 3.5),
// child: SvgPicture.asset(
// 'assets/images/new-design/covid-19-car.svg',
// width: 45.0,
// height: 45.0),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 45.0,
height: 45.0),
),
Container(
margin: EdgeInsets.only(
@ -175,11 +175,11 @@ class _HomePageState extends State<HomePage> {
.withOpacity(0.3),
borderRadius: BorderRadius.all(
Radius.circular(5))),
// child: SvgPicture.asset(
// projectViewModel.isArabic
// ? 'assets/images/new-design/livecare_arabic_logo.svg'
// : 'assets/images/new-design/liveCare_white_logo.svg',
// ),
child: SvgPicture.asset(
projectViewModel.isArabic
? 'assets/images/new-design/livecare_arabic_logo.svg'
: 'assets/images/new-design/liveCare_white_logo.svg',
),
),
),
),

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

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

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

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

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

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

@ -0,0 +1,54 @@
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/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
class SmartWatchIntegrationService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
Future<Map> getLastPatientRecord(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));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authUser.outSA,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"License": true
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_LAST_RECORD,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -35,7 +35,7 @@ dependencies:
giffy_dialog: ^1.8.0
# Flutter Html View
flutter_html: 1.0.2
flutter_html: 1.0.0
# Native
flutter_device_type: ^0.2.0
@ -87,7 +87,7 @@ dependencies:
table_calendar: ^2.2.3
# SVG Images
flutter_svg: ^0.18.0
flutter_svg: ^0.17.0
# Location Helper
map_launcher: ^0.8.1

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Loading…
Cancel
Save