Merge branch 'master' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into pharmacy_module_feature_home_page
Conflicts: lib/config/config.dart lib/config/localized_values.dart lib/pages/landing/landing_page.dart lib/uitl/translations_delegate_base.dart lib/widgets/others/app_scaffold_widget.dart pubspec.yamlmerge-requests/176/head
@ -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);
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 154 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,165 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class NewCMCStepThreePage extends StatefulWidget {
|
||||
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final CMCViewModel model;
|
||||
|
||||
NewCMCStepThreePage(
|
||||
{Key key,
|
||||
this.changePageViewIndex,
|
||||
this.model,
|
||||
this.cmcInsertPresOrderRequestModel});
|
||||
|
||||
@override
|
||||
_NewCMCStepThreePageState createState() =>
|
||||
_NewCMCStepThreePageState();
|
||||
}
|
||||
|
||||
class _NewCMCStepThreePageState
|
||||
extends State<NewCMCStepThreePage> {
|
||||
Completer<GoogleMapController> _controller = Completer();
|
||||
|
||||
static CameraPosition _kGooglePlex = CameraPosition(
|
||||
target: LatLng(37.42796133580664, -122.085749655962),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
final Set<Marker> markers = new Set();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.cmcInsertPresOrderRequestModel.latitude != null) {
|
||||
markers.clear();
|
||||
markers.add(
|
||||
Marker(
|
||||
markerId: MarkerId(
|
||||
widget.cmcInsertPresOrderRequestModel.latitude.hashCode
|
||||
.toString(),
|
||||
),
|
||||
position: LatLng(
|
||||
widget.cmcInsertPresOrderRequestModel.latitude,
|
||||
widget.cmcInsertPresOrderRequestModel.longitude)),
|
||||
);
|
||||
_kGooglePlex = CameraPosition(
|
||||
target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude,
|
||||
widget.cmcInsertPresOrderRequestModel.longitude),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowDecPage: false,
|
||||
baseViewModel: widget.model,
|
||||
body: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
height: 400,
|
||||
width: double.maxFinite,
|
||||
margin: EdgeInsets.only(left: 12, right: 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts('Order Details'),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts('Location :'),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 200,
|
||||
child: GoogleMap(
|
||||
mapType: MapType.normal,
|
||||
markers: markers,
|
||||
initialCameraPosition: _kGooglePlex,
|
||||
onMapCreated: (GoogleMapController controller) {
|
||||
_controller.complete(controller);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Texts('Selected Service :'),
|
||||
...List.generate(
|
||||
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length,
|
||||
(index) => Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
'Service Name :',
|
||||
fontSize: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Texts(
|
||||
widget
|
||||
.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index]
|
||||
.selectedServiceName,
|
||||
fontSize: 15,
|
||||
bold: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.10,
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
child: SecondaryButton(
|
||||
label: "Confirm",
|
||||
onTap: () async {
|
||||
await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel);
|
||||
if (widget.model.state != ViewState.ErrorLocal) {
|
||||
widget.changePageViewIndex(0);
|
||||
}
|
||||
},
|
||||
textColor: Theme.of(context).backgroundColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class NewCMCStepTowPage extends StatefulWidget {
|
||||
final Function(PickResult) onPick;
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final CMCViewModel model;
|
||||
|
||||
const NewCMCStepTowPage(
|
||||
{Key key,
|
||||
this.onPick,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.cmcInsertPresOrderRequestModel,
|
||||
this.changePageViewIndex,
|
||||
this.model})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_NewCMCStepTowPageState createState() =>
|
||||
_NewCMCStepTowPageState();
|
||||
}
|
||||
|
||||
class _NewCMCStepTowPageState
|
||||
extends State<NewCMCStepTowPage> {
|
||||
double latitude = 0;
|
||||
double longitude = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.cmcInsertPresOrderRequestModel.latitude == null) {
|
||||
latitude = widget.latitude;
|
||||
longitude = widget.longitude;
|
||||
} else {
|
||||
latitude = widget.cmcInsertPresOrderRequestModel.latitude;
|
||||
longitude = widget.cmcInsertPresOrderRequestModel.longitude;
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return AppScaffold(
|
||||
isShowDecPage: false,
|
||||
body: PlacePicker(
|
||||
apiKey: GOOGLE_API_KEY,
|
||||
enableMyLocationButton: true,
|
||||
automaticallyImplyAppBarLeading: false,
|
||||
autocompleteOnTrailingWhitespace: true,
|
||||
selectInitialPosition: true,
|
||||
autocompleteLanguage: projectViewModel.currentLanguage,
|
||||
enableMapTypeButton: true,
|
||||
onPlacePicked: (PickResult result) {
|
||||
print(result.adrAddress);
|
||||
widget.changePageViewIndex(3);
|
||||
},
|
||||
selectedPlaceWidgetBuilder:
|
||||
(_, selectedPlace, state, isSearchBarFocused) {
|
||||
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
|
||||
return isSearchBarFocused
|
||||
? Container()
|
||||
: FloatingCard(
|
||||
bottomPosition: 0.0,
|
||||
leftPosition: 0.0,
|
||||
rightPosition: 0.0,
|
||||
width: 500,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
child: state == SearchingState.Searching
|
||||
? Center(child: CircularProgressIndicator())
|
||||
: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: SecondaryButton(
|
||||
color: Colors.grey[800],
|
||||
textColor: Colors.white,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.cmcInsertPresOrderRequestModel
|
||||
.latitude =
|
||||
selectedPlace.geometry.location.lat;
|
||||
widget.cmcInsertPresOrderRequestModel
|
||||
.longitude =
|
||||
selectedPlace.geometry.location.lng;
|
||||
});
|
||||
widget.changePageViewIndex(3);
|
||||
},
|
||||
label: TranslationBase.of(context).next,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
initialPosition: LatLng(latitude, longitude),
|
||||
useCurrentLocation: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,172 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class NewHomeHealthCareStepThreePage extends StatefulWidget {
|
||||
final PatientERInsertPresOrderRequestModel
|
||||
patientERInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final HomeHealthCareViewModel model;
|
||||
|
||||
NewHomeHealthCareStepThreePage(
|
||||
{Key key,
|
||||
this.patientERInsertPresOrderRequestModel,
|
||||
this.changePageViewIndex,
|
||||
this.model});
|
||||
|
||||
@override
|
||||
_NewHomeHealthCareStepThreePageState createState() =>
|
||||
_NewHomeHealthCareStepThreePageState();
|
||||
}
|
||||
|
||||
class _NewHomeHealthCareStepThreePageState
|
||||
extends State<NewHomeHealthCareStepThreePage> {
|
||||
Completer<GoogleMapController> _controller = Completer();
|
||||
|
||||
static CameraPosition _kGooglePlex = CameraPosition(
|
||||
target: LatLng(37.42796133580664, -122.085749655962),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
final Set<Marker> markers = new Set();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.patientERInsertPresOrderRequestModel.latitude != null) {
|
||||
markers.clear();
|
||||
markers.add(
|
||||
Marker(
|
||||
markerId: MarkerId(
|
||||
widget.patientERInsertPresOrderRequestModel.latitude.hashCode
|
||||
.toString(),
|
||||
),
|
||||
position: LatLng(
|
||||
widget.patientERInsertPresOrderRequestModel.latitude,
|
||||
widget.patientERInsertPresOrderRequestModel.longitude)),
|
||||
);
|
||||
_kGooglePlex = CameraPosition(
|
||||
target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude,
|
||||
widget.patientERInsertPresOrderRequestModel.longitude),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowDecPage: false,
|
||||
baseViewModel: widget.model,
|
||||
body: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
width: double.maxFinite,
|
||||
margin: EdgeInsets.only(left: 12, right: 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts('Order Details'),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts('Location :'),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 200,
|
||||
child: GoogleMap(
|
||||
mapType: MapType.normal,
|
||||
markers: markers,
|
||||
initialCameraPosition: _kGooglePlex,
|
||||
onMapCreated: (GoogleMapController controller) {
|
||||
_controller.complete(controller);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Texts('Selected Service :'),
|
||||
...List.generate(
|
||||
widget.patientERInsertPresOrderRequestModel
|
||||
.patientERHHCInsertServicesList.length,
|
||||
(index) => Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Texts(
|
||||
'Service Name :',
|
||||
fontSize: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Texts(
|
||||
widget
|
||||
.patientERInsertPresOrderRequestModel
|
||||
.patientERHHCInsertServicesList[index]
|
||||
.serviceName,
|
||||
fontSize: 15,
|
||||
bold: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 57,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.10,
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
child: SecondaryButton(
|
||||
label: "Confirm",
|
||||
disabled: widget.patientERInsertPresOrderRequestModel
|
||||
.patientERHHCInsertServicesList.length ==
|
||||
0,
|
||||
onTap: () async {
|
||||
await widget.model.insertPresPresOrder(
|
||||
order: widget.patientERInsertPresOrderRequestModel);
|
||||
if (widget.model.state != ViewState.ErrorLocal) {
|
||||
widget.changePageViewIndex(0);
|
||||
}
|
||||
},
|
||||
textColor: Theme.of(context).backgroundColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class NewHomeHealthCareStepTowPage extends StatefulWidget {
|
||||
final Function(PickResult) onPick;
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final PatientERInsertPresOrderRequestModel
|
||||
patientERInsertPresOrderRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
final HomeHealthCareViewModel model;
|
||||
|
||||
const NewHomeHealthCareStepTowPage(
|
||||
{Key key,
|
||||
this.onPick,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.patientERInsertPresOrderRequestModel,
|
||||
this.changePageViewIndex,
|
||||
this.model})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_NewHomeHealthCareStepTowPageState createState() =>
|
||||
_NewHomeHealthCareStepTowPageState();
|
||||
}
|
||||
|
||||
class _NewHomeHealthCareStepTowPageState
|
||||
extends State<NewHomeHealthCareStepTowPage> {
|
||||
double latitude = 0;
|
||||
double longitude = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
|
||||
latitude = widget.latitude;
|
||||
longitude = widget.longitude;
|
||||
} else {
|
||||
latitude = widget.patientERInsertPresOrderRequestModel.latitude;
|
||||
longitude = widget.patientERInsertPresOrderRequestModel.longitude;
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return AppScaffold(
|
||||
isShowDecPage: false,
|
||||
body: PlacePicker(
|
||||
apiKey: GOOGLE_API_KEY,
|
||||
enableMyLocationButton: true,
|
||||
automaticallyImplyAppBarLeading: false,
|
||||
autocompleteOnTrailingWhitespace: true,
|
||||
selectInitialPosition: true,
|
||||
autocompleteLanguage: projectViewModel.currentLanguage,
|
||||
enableMapTypeButton: true,
|
||||
onPlacePicked: (PickResult result) {
|
||||
print(result.adrAddress);
|
||||
widget.changePageViewIndex(3);
|
||||
},
|
||||
selectedPlaceWidgetBuilder:
|
||||
(_, selectedPlace, state, isSearchBarFocused) {
|
||||
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
|
||||
return isSearchBarFocused
|
||||
? Container()
|
||||
: FloatingCard(
|
||||
bottomPosition: 0.0,
|
||||
leftPosition: 0.0,
|
||||
rightPosition: 0.0,
|
||||
width: 500,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
child: state == SearchingState.Searching
|
||||
? Center(child: CircularProgressIndicator())
|
||||
: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: SecondaryButton(
|
||||
color: Colors.grey[800],
|
||||
textColor: Colors.white,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.patientERInsertPresOrderRequestModel
|
||||
.latitude =
|
||||
selectedPlace.geometry.location.lat;
|
||||
widget.patientERInsertPresOrderRequestModel
|
||||
.longitude =
|
||||
selectedPlace.geometry.location.lng;
|
||||
});
|
||||
widget.changePageViewIndex(3);
|
||||
},
|
||||
label: TranslationBase.of(context).next,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
initialPosition: LatLng(latitude, longitude),
|
||||
useCurrentLocation: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -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,131 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:diplomaticquarterapp/routes.dart';
|
||||
|
||||
class SymptomInfo extends StatefulWidget {
|
||||
@override
|
||||
_SymptomInfo createState() => new _SymptomInfo();
|
||||
}
|
||||
|
||||
class _SymptomInfo extends State<SymptomInfo> {
|
||||
bool checkValue = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).termsService,
|
||||
isShowAppBar: true,
|
||||
body: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
TranslationBase.of(context).beforeUsing,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
// textAlign: TextAlign.center,
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
),
|
||||
padding: EdgeInsets.all(30),
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
AppText(TranslationBase.of(context).remeberthat,
|
||||
fontSize: 16),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
AppText(
|
||||
'1. ' + TranslationBase.of(context).checkDiagnosis,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(TranslationBase.of(context).informational,
|
||||
fontSize: 16),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
AppText(
|
||||
'2. ' + TranslationBase.of(context).notUseInEmbergency,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context).notUseInEmbergencyDetails,
|
||||
fontSize: 16),
|
||||
AppText(
|
||||
TranslationBase.of(context).notUseInEmbergencyCall,
|
||||
underline: true,
|
||||
color: Colors.blue,
|
||||
fontSize: 16),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
AppText(
|
||||
'3.' + TranslationBase.of(context).dataSafe,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
AppText(TranslationBase.of(context).dataSafeInfo,
|
||||
fontSize: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: CheckboxListTile(
|
||||
title: AppText(TranslationBase.of(context).accept),
|
||||
value: checkValue,
|
||||
onChanged: (newValue) {
|
||||
setState(() {
|
||||
this.checkValue = newValue;
|
||||
});
|
||||
},
|
||||
controlAffinity: ListTileControlAffinity
|
||||
.leading, // <-- leading Checkbox
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: DefaultButton(
|
||||
TranslationBase.of(context).next,
|
||||
() => {
|
||||
if (checkValue == true)
|
||||
{
|
||||
Navigator.of(context).pushNamed(
|
||||
SELECT_GENDER,
|
||||
)
|
||||
}
|
||||
},
|
||||
color: checkValue == true
|
||||
? Colors.black
|
||||
: Colors.grey,
|
||||
textColor: Colors.white,
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
)));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,124 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:diplomaticquarterapp/routes.dart';
|
||||
import 'package:flutter_xlider/flutter_xlider.dart';
|
||||
|
||||
class SelectGender extends StatefulWidget {
|
||||
@override
|
||||
_SelectGender createState() => new _SelectGender();
|
||||
}
|
||||
|
||||
class _SelectGender extends State<SelectGender> {
|
||||
double slider = 22;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).gender,
|
||||
isShowAppBar: true,
|
||||
body: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
//TranslationBase.of(context).beforeUsing,
|
||||
TranslationBase.of(context).selectGender,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
// textAlign: TextAlign.center,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
AppText(TranslationBase.of(context).iAma, fontSize: 16),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 200,
|
||||
width: 150,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15.0),
|
||||
),
|
||||
shadowColor: Colors.red,
|
||||
child: Image.asset(
|
||||
'assets/images/female_face.png')))),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 200,
|
||||
width: 150,
|
||||
child: Card(
|
||||
shadowColor: Colors.red,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(15.0),
|
||||
),
|
||||
child: Image.asset(
|
||||
'assets/images/male_face.png'))))
|
||||
],
|
||||
),
|
||||
AppText(TranslationBase.of(context).selectAge,
|
||||
fontSize: 25),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context).iAm +
|
||||
' ' +
|
||||
slider.toString() +
|
||||
' ' +
|
||||
TranslationBase.of(context)
|
||||
.yearOld, //TranslationBase.of(context).remeberthat,
|
||||
fontSize: 16),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
FlutterSlider(
|
||||
values: [slider],
|
||||
max: 90,
|
||||
min: 14,
|
||||
onDragCompleted: (handlerIndex, lowerValue, upperValue) {
|
||||
print(lowerValue);
|
||||
print(upperValue);
|
||||
setState(() {
|
||||
slider = upperValue;
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: DefaultButton(
|
||||
TranslationBase.of(context).next,
|
||||
() => {
|
||||
Navigator.of(context).pushNamed(
|
||||
SYMPTOM_CHECKER,
|
||||
)
|
||||
},
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
)));
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.2 KiB |