diff --git a/android/app/build.gradle b/android/app/build.gradle
index 1f71421f..9640ea61 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 30
+ compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@@ -41,7 +41,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.cloud.diplomaticquarterapp"
minSdkVersion 21
- targetSdkVersion 30
+ targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index f1a5a3f8..8c32edfd 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -17,6 +17,9 @@
+
+
+
+
+
diff --git a/android/gradle.properties b/android/gradle.properties
index 3f45ee5b..9c0729c9 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -2,4 +2,4 @@
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
-org.gradle.jvmargs=-Xmx4608m
\ No newline at end of file
+org.gradle.jvmargs=-Xmx4608m
diff --git a/lib/core/enum/Ambulate.dart b/lib/core/enum/Ambulate.dart
new file mode 100644
index 00000000..059a281c
--- /dev/null
+++ b/lib/core/enum/Ambulate.dart
@@ -0,0 +1,27 @@
+import 'package:flutter/cupertino.dart';
+
+enum Ambulate { Wheelchair, Walker, Stretcher, None }
+
+extension SelectedAmbulate on Ambulate {
+ String getAmbulateTitle(BuildContext context) {
+ switch (this) {
+ case Ambulate.Wheelchair:
+ // TODO: Handle this case.
+ return 'Wheelchair';
+ break;
+ case Ambulate.Walker:
+ // TODO: Handle this case.
+ return 'Walker';
+ break;
+ case Ambulate.Stretcher:
+ // TODO: Handle this case.
+ return 'Stretcher';
+ break;
+ case Ambulate.None:
+ // TODO: Handle this case.
+ return 'None';
+ break;
+ }
+ return 'None';
+ }
+}
diff --git a/lib/core/model/er/PatientER.dart b/lib/core/model/er/PatientER.dart
index 9c2d660e..d0827311 100644
--- a/lib/core/model/er/PatientER.dart
+++ b/lib/core/model/er/PatientER.dart
@@ -1,3 +1,7 @@
+import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
+
+import 'get_all_transportation_method_list_model.dart';
+
class PatientER {
double versionID;
int channel;
@@ -46,7 +50,8 @@ class PatientER {
dynamic appointmentDoctorName;
dynamic appointmentBranch;
dynamic appointmentTime;
-
+ PatientERTransportationMethod patientERTransportationMethod;
+ Ambulate ambulate;
PatientER(
{this.versionID,
this.channel,
@@ -94,7 +99,9 @@ class PatientER {
this.appointmentClinicName,
this.appointmentDoctorName,
this.appointmentBranch,
- this.appointmentTime});
+ this.appointmentTime,
+ this.patientERTransportationMethod,
+ this.ambulate});
PatientER.fromJson(Map json) {
versionID = json['VersionID'];
diff --git a/lib/core/service/medical/medical_service.dart b/lib/core/service/medical/medical_service.dart
index 90230f6d..572e5096 100644
--- a/lib/core/service/medical/medical_service.dart
+++ b/lib/core/service/medical/medical_service.dart
@@ -5,9 +5,14 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
class MedicalService extends BaseService {
List appoitmentAllHistoryResultList = List();
- getAppointmentHistory() async {
+ getAppointmentHistory({bool isActiveAppointment = false}) async {
hasError = false;
super.error = "";
+ Map body = Map();
+ if(isActiveAppointment) {
+ body['IsActiveAppointment'] = true;
+ body['isDentalAllowedBackend'] = false;
+ }
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
onSuccess: (response, statusCode) async {
@@ -19,6 +24,6 @@ class MedicalService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
- }, body: Map());
+ }, body: body);
}
}
diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart
index 9045ee90..a5261456 100644
--- a/lib/core/viewModels/er/am_request_view_model.dart
+++ b/lib/core/viewModels/er/am_request_view_model.dart
@@ -3,19 +3,36 @@ import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/service/er/am_service.dart';
import 'package:diplomaticquarterapp/core/service/hospital_service.dart';
+import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import '../base_view_model.dart';
import '../../../locator.dart';
class AmRequestViewModel extends BaseViewModel {
AmService _amService = locator();
HospitalService _hospitalService = locator();
+ MedicalService _medicalService = locator();
List
get amRequestModeList => _amService.amModelList;
List get patientAllPresOrdersList =>_amService.patientAllPresOrdersList;
+ List get appoitmentAllHistoryResultList =>
+ _medicalService.appoitmentAllHistoryResultList;
+
+ Future getAppointmentHistory() async {
+ setState(ViewState.BusyLocal);
+ await _medicalService.getAppointmentHistory(isActiveAppointment: true);
+ if (_medicalService.hasError) {
+ error = _medicalService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
+
+
Future getAmRequestOrders() async {
setState(ViewState.Busy);
diff --git a/lib/pages/ErService/AvailableAppointmentsPage.dart b/lib/pages/ErService/AvailableAppointmentsPage.dart
new file mode 100644
index 00000000..7180d5dd
--- /dev/null
+++ b/lib/pages/ErService/AvailableAppointmentsPage.dart
@@ -0,0 +1,45 @@
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
+import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.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';
+
+class AvailableAppointmentsPage extends StatelessWidget {
+ final List appointmentsAllHistoryList;
+
+ const AvailableAppointmentsPage({Key key, this.appointmentsAllHistoryList})
+ : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return AppScaffold(
+ isShowAppBar: true,
+ appBarTitle: 'Available Appointments',
+ body: SingleChildScrollView(
+ child: Container(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Texts('Available Appointments'),
+ SizedBox(
+ height: 12,
+ ),
+ ...List.generate(
+ appointmentsAllHistoryList.length,
+ (index) => InkWell(
+ onTap: (){
+ Navigator.pop(context, appointmentsAllHistoryList[index]);
+ },
+ child: AppointmentCard(appointment: appointmentsAllHistoryList[index],),
+ ),
+ )
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
+
+
diff --git a/lib/pages/ErService/BillAmount.dart b/lib/pages/ErService/BillAmount.dart
index 3dca195f..44e17c3a 100644
--- a/lib/pages/ErService/BillAmount.dart
+++ b/lib/pages/ErService/BillAmount.dart
@@ -1,41 +1,334 @@
+import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
+import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+
class BillAmount extends StatefulWidget {
final Function changeCurrentTab;
final PatientER patientER;
final AmRequestViewModel amRequestViewModel;
- BillAmount({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel});
+ BillAmount(
+ {Key key,
+ this.changeCurrentTab,
+ this.patientER,
+ this.amRequestViewModel});
@override
_BillAmountState createState() => _BillAmountState();
}
class _BillAmountState extends State {
+ Ambulate _ambulate = Ambulate.None;
+ String note ="";
@override
Widget build(BuildContext context) {
- return Column(
- children: [
- Texts('BillAmount 3'),
- SizedBox(height: 45,),
- Container(
- padding: EdgeInsets.all(15),
- width: double.maxFinite,
- height: 76,
- child:SecondaryButton(
- color: Colors.grey[800],
- textColor: Colors.white,
- onTap: ()=> widget.changeCurrentTab(3),
- label: 'Next',
+ return SingleChildScrollView(
+ physics: BouncingScrollPhysics(),
+ child: Container(
+ margin: EdgeInsets.only(left: 12, right: 12),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Texts('Bill Amount '),
+ SizedBox(
+ height: 10,
+ ),
+ Table(
+ border: TableBorder.symmetric(
+ inside: BorderSide(width: 1.0, color: Colors.grey[300]),
+ outside: BorderSide(width: 1.0, color: Colors.grey[300])),
+ children: [
+ TableRow(
+ children: [
+ Container(
+ height: MediaQuery.of(context).size.height * 0.09,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.only(
+ topLeft: Radius.circular(10.0),
+ ),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Texts(
+ 'Amount before tax: ',
+ textAlign: TextAlign.start,
+ color: Colors.black,
+ fontSize: 15,
+ ),
+ ),
+ ),
+ Container(
+ height: MediaQuery.of(context).size.height * 0.09,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.only(
+ topRight: Radius.circular(10.0),
+ ),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Texts(
+ 'SR ${widget.patientER.patientERTransportationMethod.price}',
+ color: Colors.black,
+ textAlign: TextAlign.start,
+ fontSize: 15,
+ ),
+ ),
+ ),
+ ],
+ ),
+ TableRow(
+ children: [
+ Container(
+ color: Colors.white,
+ height: MediaQuery.of(context).size.height * 0.09,
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Texts(
+ 'Tax amount :',
+ color: Colors.black,
+ fontSize: 15,
+ textAlign: TextAlign.start,
+ ),
+ ),
+ ),
+ Container(
+ height: MediaQuery.of(context).size.height * 0.09,
+ color: Colors.white,
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Texts(
+ 'SR ${widget.patientER.patientERTransportationMethod.vAT}',
+ color: Colors.black,
+ fontSize: 15,
+ textAlign: TextAlign.start,
+ ),
+ ),
+ ),
+ ],
+ ),
+ TableRow(
+ children: [
+ Container(
+ height: MediaQuery.of(context).size.height * 0.09,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.only(
+ bottomLeft: Radius.circular(10.0),
+ ),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Texts(
+ 'Total amount payable',
+ color: Colors.black,
+ fontSize: 15,
+ textAlign: TextAlign.start,
+ bold: true,
+ ),
+ ),
+ ),
+ Container(
+ height: MediaQuery.of(context).size.height * 0.09,
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.only(
+ bottomRight: Radius.circular(10.0),
+ ),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Texts(
+ 'SR ${widget.patientER.patientERTransportationMethod.totalPrice}',
+ color: Colors.black,
+ fontSize: 15,
+ textAlign: TextAlign.start,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ SizedBox(
+ height: 10,
+ ),
+ Texts('Select Ambulate',bold: true,),
+ SizedBox(height: 5,),
+ Row(
+ children: [
+ Expanded(
+ child: InkWell(
+ onTap: () {
+ setState(() {
+ _ambulate = Ambulate.Wheelchair;
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.rectangle,
+ borderRadius: BorderRadius.circular(8),
+ border:
+ Border.all(color: Colors.grey, width: 0.5),
+ color: Colors.white,
+ ),
+ child: ListTile(
+ title: Text('Wheelchair'),
+ leading: Radio(
+ value: Ambulate.Wheelchair,
+ groupValue: _ambulate,
+ activeColor: Colors.red[800],
+ onChanged: (value) {
+ setState(() {
+ _ambulate = value;
+ });
+ },
+ ),
+ ),
+ ),
+ ),
+ ),
+ Expanded(
+ child: InkWell(
+ onTap: () {
+ setState(() {
+ _ambulate = Ambulate.Walker;
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.rectangle,
+ borderRadius: BorderRadius.circular(8),
+ border:
+ Border.all(color: Colors.grey, width: 0.5),
+ color: Colors.white,
+ ),
+ child: ListTile(
+ title: Text('Walker'),
+ leading: Radio(
+ value: Ambulate.Walker,
+ groupValue: _ambulate,
+ activeColor: Colors.red[800],
+ onChanged: (value) {
+ setState(() {
+ _ambulate = value;
+ });
+ },
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(height: 5,),
+ Row(
+ children: [
+ Expanded(
+ child: InkWell(
+ onTap: () {
+ setState(() {
+ _ambulate = Ambulate.Stretcher;
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.rectangle,
+ borderRadius: BorderRadius.circular(8),
+ border:
+ Border.all(color: Colors.grey, width: 0.5),
+ color: Colors.white,
+ ),
+ child: ListTile(
+ title: Text('Stretcher'),
+ leading: Radio(
+ value: Ambulate.Stretcher,
+ groupValue: _ambulate,
+ activeColor: Colors.red[800],
+ onChanged: (value) {
+ setState(() {
+ _ambulate = value;
+ });
+ },
+ ),
+ ),
+ ),
+ ),
+ ),
+ Expanded(
+ child: InkWell(
+ onTap: () {
+ setState(() {
+ _ambulate = Ambulate.None;
+ });
+ },
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.rectangle,
+ borderRadius: BorderRadius.circular(8),
+ border:
+ Border.all(color: Colors.grey, width: 0.5),
+ color: Colors.white,
+ ),
+ child: ListTile(
+ title: Text('Walker'),
+ leading: Radio(
+ value: Ambulate.None,
+ groupValue: _ambulate,
+ activeColor: Colors.red[800],
+ onChanged: (value) {
+ setState(() {
+ _ambulate = value;
+ });
+ },
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ SizedBox(height: 12,),
+ NewTextFields(
+ hintText: 'Note',
+ initialValue: note,
+ onChanged: (value){
+ setState(() {
+ note = value;
+ });
+ },
+ ),
- ),
- )
- ],
+ SizedBox(
+ height: 15,
+ ),
+ Container(
+ padding: EdgeInsets.all(15),
+ width: double.maxFinite,
+ height: 76,
+ child: SecondaryButton(
+ color: Colors.grey[800],
+ textColor: Colors.white,
+ onTap: () {
+ setState(() {
+ widget.patientER.ambulate = _ambulate;
+ widget.patientER.requesterNote = note;
+ widget.changeCurrentTab(3);
+ });
+ },
+ label: 'Next',
+ ),
+ )
+ ],
+ ),
+ ),
);
}
}
diff --git a/lib/pages/ErService/PickupLocation.dart b/lib/pages/ErService/PickupLocation.dart
index 46a8928b..4b32c9bb 100644
--- a/lib/pages/ErService/PickupLocation.dart
+++ b/lib/pages/ErService/PickupLocation.dart
@@ -1,16 +1,29 @@
+import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
+import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
+import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
+import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
+import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
+import 'package:geolocator/geolocator.dart';
+import 'package:google_maps_place_picker/google_maps_place_picker.dart';
+import 'package:google_maps_flutter/google_maps_flutter.dart';
+
+import 'AmbulanceReq.dart';
+import 'AvailableAppointmentsPage.dart';
enum HaveAppointment { YES, NO }
class PickupLocation extends StatefulWidget {
final Function changeCurrentTab;
final PatientER patientER;
+ final AmRequestViewModel amRequestViewModel;
PickupLocation(
{Key key,
@@ -18,8 +31,6 @@ class PickupLocation extends StatefulWidget {
this.patientER,
this.amRequestViewModel});
- final AmRequestViewModel amRequestViewModel;
-
@override
_PickupLocationState createState() => _PickupLocationState();
}
@@ -27,6 +38,26 @@ class PickupLocation extends StatefulWidget {
class _PickupLocationState extends State {
bool _isInsideHome = false;
HaveAppointment _haveAppointment = HaveAppointment.NO;
+ double _latitude;
+ double _longitude;
+ AppoitmentAllHistoryResultList myAppointment;
+
+ @override
+ void initState() {
+ super.initState();
+ _getCurrentLocation();
+ }
+
+ _getCurrentLocation() async {
+ await getLastKnownPosition().then((value) {
+ _latitude = value.latitude;
+ _longitude = value.longitude;
+ }).catchError((e) {
+ _longitude = 0;
+ _latitude = 0;
+ });
+ // currentLocation = LatLng(position.latitude, position.longitude);
+ }
@override
Widget build(BuildContext context) {
@@ -111,9 +142,12 @@ class _PickupLocationState extends State {
Expanded(
child: InkWell(
onTap: () {
- setState(() {
- _haveAppointment = HaveAppointment.YES;
- });
+ if(myAppointment == null) {
+ getAppointment();
+ setState(() {
+ _haveAppointment = HaveAppointment.YES;
+ });
+ }
},
child: Container(
decoration: BoxDecoration(
@@ -130,9 +164,13 @@ class _PickupLocationState extends State {
groupValue: _haveAppointment,
activeColor: Colors.red[800],
onChanged: (value) {
- setState(() {
- _haveAppointment = value;
- });
+ if(myAppointment == null) {
+ getAppointment();
+ setState(() {
+ _haveAppointment = value;
+ });
+ }
+
},
),
),
@@ -144,6 +182,7 @@ class _PickupLocationState extends State {
onTap: () {
setState(() {
_haveAppointment = HaveAppointment.NO;
+ myAppointment = null;
});
},
child: Container(
@@ -163,6 +202,7 @@ class _PickupLocationState extends State {
onChanged: (value) {
setState(() {
_haveAppointment = value;
+ myAppointment = null;
});
},
),
@@ -172,6 +212,18 @@ class _PickupLocationState extends State {
),
],
),
+
+ if(myAppointment!=null)
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ SizedBox(
+ height: 12,
+ ),
+ AppointmentCard(appointment: myAppointment,)
+ ],
+ ),
+
SizedBox(
height: 12,
),
@@ -209,24 +261,43 @@ class _PickupLocationState extends State {
SizedBox(
height: 15,
),
- Container(
- padding: EdgeInsets.all(12),
- decoration: BoxDecoration(
- shape: BoxShape.rectangle,
- borderRadius: BorderRadius.circular(8),
- border: Border.all(color: Colors.grey, width: 0.5),
- color: Colors.white,
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Texts('Pickup Location'),
- Icon(
- Icons.arrow_drop_down,
- size: 24,
- color: Colors.black,
- )
- ],
+ InkWell(
+ onTap: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) => PlacePicker(
+ apiKey: 'AIzaSyCiD4YqVqLNYbt8-htvFy4Wp8XSph9E3wM',
+ // Put YOUR OWN KEY here.
+ onPlacePicked: (PickResult result) {
+ print(result.adrAddress);
+ Navigator.of(context).pop();
+ },
+ initialPosition: LatLng(_latitude, _longitude),
+ useCurrentLocation: true,
+ ),
+ ),
+ );
+ },
+ child: Container(
+ padding: EdgeInsets.all(12),
+ decoration: BoxDecoration(
+ shape: BoxShape.rectangle,
+ borderRadius: BorderRadius.circular(8),
+ border: Border.all(color: Colors.grey, width: 0.5),
+ color: Colors.white,
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Texts('Pickup Location'),
+ Icon(
+ Icons.arrow_drop_down,
+ size: 24,
+ color: Colors.black,
+ )
+ ],
+ ),
),
),
SizedBox(
@@ -270,7 +341,12 @@ class _PickupLocationState extends State {
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
- onTap: () => widget.changeCurrentTab(2),
+ onTap: () {
+ setState(() {
+ widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
+ widget.changeCurrentTab(2);
+ });
+ },
label: 'Next',
),
)
@@ -279,4 +355,37 @@ class _PickupLocationState extends State {
),
);
}
+
+ getAppointment() {
+ widget.amRequestViewModel.getAppointmentHistory().then((value) {
+ if (widget.amRequestViewModel.state == ViewState.Error ||
+ widget.amRequestViewModel.state == ViewState.ErrorLocal) {
+ AppToast.showErrorToast(message: widget.amRequestViewModel.error);
+ } else if (widget.amRequestViewModel.appoitmentAllHistoryResultList.length > 0) {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) => AvailableAppointmentsPage(
+ appointmentsAllHistoryList:
+ widget.amRequestViewModel.appoitmentAllHistoryResultList,
+ ),
+ ),
+ ).then((value) {
+ if (value != null)
+ setState(() {
+ myAppointment = value;
+ });
+ else
+ setState(() {
+ _haveAppointment = HaveAppointment.NO;
+ });
+ });
+ } else {
+ setState(() {
+ _haveAppointment = HaveAppointment.NO;
+ });
+ AppToast.showErrorToast(message: 'You don\'t have any appointment');
+ }
+ });
+ }
}
diff --git a/lib/pages/ErService/SelectTransportationMethod.dart b/lib/pages/ErService/SelectTransportationMethod.dart
index 38eec5b4..261b9f83 100644
--- a/lib/pages/ErService/SelectTransportationMethod.dart
+++ b/lib/pages/ErService/SelectTransportationMethod.dart
@@ -42,6 +42,10 @@ class _SelectTransportationMethodState
_way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays;
_erTransportationMethod = widget.amRequestViewModel
.amRequestModeList[(widget.patientER.selectedAmbulate - 1)];
+ } else {
+ if (widget.amRequestViewModel.amRequestModeList.length != 0)
+ _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[
+ widget.amRequestViewModel.amRequestModeList.length - 1];
}
}
@@ -281,6 +285,8 @@ class _SelectTransportationMethodState
.amRequestViewModel.amRequestModeList
.indexOf(_erTransportationMethod) +
1);
+ widget.patientER.patientERTransportationMethod =
+ _erTransportationMethod;
widget.changeCurrentTab(1);
});
},
diff --git a/lib/pages/ErService/Summary.dart b/lib/pages/ErService/Summary.dart
index 13beee8c..4c189707 100644
--- a/lib/pages/ErService/Summary.dart
+++ b/lib/pages/ErService/Summary.dart
@@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
class Summary extends StatefulWidget {
final Function changeCurrentTab;
@@ -19,23 +20,86 @@ class Summary extends StatefulWidget {
class _SummaryState extends State {
@override
Widget build(BuildContext context) {
- return Column(
- children: [
- Texts('Summary 4'),
- SizedBox(height: 45,),
- Container(
- padding: EdgeInsets.all(15),
- width: double.maxFinite,
- height: 76,
- child:SecondaryButton(
- color: Colors.grey[800],
- textColor: Colors.white,
- label: 'Next',
-
- // onTap: ()=> widget.changeCurrentTab(2),
- ),
- )
- ],
+ return SingleChildScrollView(
+ child: Container(
+ margin: EdgeInsets.only(left: 12, right: 12),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Texts('Summary'),
+ SizedBox(height: 5,),
+ Container(
+ width: double.infinity,
+
+ padding: EdgeInsets.all(10),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Texts('Transportation Method',color: Colors.grey,),
+ Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,),
+ SizedBox(height: 8,),
+
+ Texts('Direction',color: Colors.grey,),
+ Texts('From Hospital',bold: true,),
+ SizedBox(height: 8,),
+
+ Texts('Pickup Location',color: Colors.grey,),
+ Texts('SZR Medical Center',bold: true,),
+ SizedBox(height: 8,),
+
+ Texts('Drop off location',color: Colors.grey,),
+ Texts('6199, Al Ameen wlfn nif',bold: true,),
+ SizedBox(height: 8,),
+
+ Texts('Select Ambulate',color: Colors.grey,),
+ Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,),
+ SizedBox(height: 8,),
+
+ Texts('Note',color: Colors.grey,),
+ Texts('${widget.patientER.requesterNote?? '---'}',bold: true,),
+ SizedBox(height: 8,),
+ ],
+ ),
+ ),
+ SizedBox(height: 20,),
+ Texts('Bill Amount',textAlign: TextAlign.start,),
+ SizedBox(height: 5,),
+ Container(
+ height: 55,
+ padding: EdgeInsets.all(10),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(8)
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Texts('Total amount payable:'),
+ Texts('SR ${widget.patientER.patientERTransportationMethod.totalPrice}')
+ ],
+ ),
+ ),
+
+ SizedBox(height: 45,),
+ Container(
+ padding: EdgeInsets.all(15),
+ width: double.maxFinite,
+ height: 76,
+ child:SecondaryButton(
+ color: Colors.grey[800],
+ textColor: Colors.white,
+ label: 'Next',
+
+ // onTap: ()=> widget.changeCurrentTab(2),
+ ),
+ )
+ ],
+ ),
+ ),
);
}
}
diff --git a/lib/pages/ErService/widgets/AppointmentCard.dart b/lib/pages/ErService/widgets/AppointmentCard.dart
new file mode 100644
index 00000000..0437c32f
--- /dev/null
+++ b/lib/pages/ErService/widgets/AppointmentCard.dart
@@ -0,0 +1,47 @@
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
+import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
+import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
+import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+
+class AppointmentCard extends StatelessWidget {
+ final AppoitmentAllHistoryResultList appointment;
+
+ const AppointmentCard({Key key, this.appointment}) : super(key: key);
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ width: double.infinity,
+ margin: EdgeInsets.all(8),
+ padding: EdgeInsets.all(10),
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.circular(8),
+ ),
+ child: Row(
+ children: [
+ LargeAvatar(
+ url: appointment.doctorImageURL,
+ name: appointment.doctorNameObj,
+ ),
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Texts(appointment.doctorNameObj,bold: true,),
+ SizedBox(height: 4,),
+ Texts(appointment.projectName),
+ Texts(appointment.clinicName),
+ Texts(DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointment.bookDate))),
+ ],
+ ),
+ ),
+ )
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/pages/ErService/widgets/StepsWidget.dart b/lib/pages/ErService/widgets/StepsWidget.dart
index 1e4077cb..c5864710 100644
--- a/lib/pages/ErService/widgets/StepsWidget.dart
+++ b/lib/pages/ErService/widgets/StepsWidget.dart
@@ -1,6 +1,8 @@
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
class StepsWidget extends StatelessWidget {
final int index;
@@ -10,7 +12,8 @@ class StepsWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Stack(
+ ProjectViewModel projectViewModel = Provider.of(context);
+ return projectViewModel.isArabic? Stack(
children: [
Container(
height: 50,
@@ -114,6 +117,110 @@ class StepsWidget extends StatelessWidget {
),
),
],
+ ):Stack(
+ children: [
+ Container(
+ height: 50,
+ width: MediaQuery.of(context).size.width,
+ color: Colors.transparent,
+ child: Center(
+ child: Divider(
+ color: Colors.grey,
+ height: 0.75,
+ thickness: 0.75,
+ ),
+ ),
+ ),
+ Positioned(
+ top: 10,
+ right: 0,
+ child: InkWell(
+ onTap: () => changeCurrentTab(0),
+ child: Container(
+ width: 35,
+ height: 35,
+ decoration: BoxDecoration(
+ border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
+ shape: BoxShape.circle,
+ color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
+ ),
+ child: Center(
+ child: Texts(
+ '1',
+ color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
+ ),
+ ),
+ ),
+ ),
+ ),
+ Positioned(
+ top: 10,
+ right: MediaQuery.of(context).size.width * 0.3,
+ child: InkWell(
+ onTap: () => index >= 2 ? changeCurrentTab(1) : null,
+ child: Container(
+ width: 35,
+ height: 35,
+ decoration: BoxDecoration(
+ border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
+ shape: BoxShape.circle,
+ color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
+ ),
+ child: Center(
+ child: Texts(
+ '2',
+ color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
+ ),
+ ),
+ ),
+ ),
+ ),
+ Positioned(
+ top: 10,
+ right: MediaQuery.of(context).size.width * 0.6,
+ child: InkWell(
+ onTap: () => index >= 3 ? changeCurrentTab(2) : null,
+ child: Container(
+ width: 35,
+ height: 35,
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
+ color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
+ ),
+ child: Center(
+ child: Texts(
+ '3',
+ color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
+ ),
+ ),
+ ),
+ ),
+ ),
+ Positioned(
+ top: 10,
+ left: 0,
+ child: InkWell(
+ onTap: () => index == 2 ?changeCurrentTab(3):null,
+ child: Container(
+ width: 35,
+ height: 35,
+ decoration: BoxDecoration(
+ border: Border.all(color: Colors.black,width: 0.75),
+
+ shape: BoxShape.circle,
+ color: index == 3 ? Colors.grey[800] : Colors.white,
+ ),
+ child: Center(
+ child: Texts(
+ '4',
+ color: index == 3 ? Colors.white : Colors.grey[800],
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
);
}
}
diff --git a/lib/uitl/ProgressDialog.dart b/lib/uitl/ProgressDialog.dart
new file mode 100644
index 00000000..728b27dd
--- /dev/null
+++ b/lib/uitl/ProgressDialog.dart
@@ -0,0 +1,12 @@
+import 'package:flutter/material.dart';
+
+class ProgressDialogUtil{
+
+ static AlertDialog alert = AlertDialog(
+ content: new Row(
+ children: [
+ CircularProgressIndicator(),
+ Container(margin: EdgeInsets.only(left: 7),child:Text("Loading..." )),
+ ],),
+ );
+}
\ No newline at end of file
diff --git a/pubspec.yaml b/pubspec.yaml
index 8bc2c52a..6e9349ab 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -5,7 +5,7 @@ description: A new Flutter application.
version: 1.0.0+1
environment:
- sdk: ">=2.2.2 <3.0.0"
+ sdk: ">=2.6.0 <3.0.0"
dependencies:
flutter:
@@ -128,6 +128,10 @@ dependencies:
#Handle Geolocation
geolocator: ^6.0.0+1
+
+ #google maps places
+ google_maps_place_picker: ^0.10.0
+
#Dependencies for video call implementation
native_device_orientation: ^0.3.0
enum_to_string: ^1.0.9