Ambulance Service second step

merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
parent 3d6eafe473
commit 1ce55e687f

@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 30 compileSdkVersion 28
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' 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). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.cloud.diplomaticquarterapp" applicationId "com.cloud.diplomaticquarterapp"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 28
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true multiDexEnabled true

@ -17,6 +17,9 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" /> <uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<application <application
android:name="io.flutter.app.FlutterApplication" android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
@ -69,6 +72,9 @@
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCiD4YqVqLNYbt8-htvFy4Wp8XSph9E3wM"/>
</application> </application>
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />

@ -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';
}
}

@ -1,3 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'get_all_transportation_method_list_model.dart';
class PatientER { class PatientER {
double versionID; double versionID;
int channel; int channel;
@ -46,7 +50,8 @@ class PatientER {
dynamic appointmentDoctorName; dynamic appointmentDoctorName;
dynamic appointmentBranch; dynamic appointmentBranch;
dynamic appointmentTime; dynamic appointmentTime;
PatientERTransportationMethod patientERTransportationMethod;
Ambulate ambulate;
PatientER( PatientER(
{this.versionID, {this.versionID,
this.channel, this.channel,
@ -94,7 +99,9 @@ class PatientER {
this.appointmentClinicName, this.appointmentClinicName,
this.appointmentDoctorName, this.appointmentDoctorName,
this.appointmentBranch, this.appointmentBranch,
this.appointmentTime}); this.appointmentTime,
this.patientERTransportationMethod,
this.ambulate});
PatientER.fromJson(Map<String, dynamic> json) { PatientER.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];

@ -5,9 +5,14 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
class MedicalService extends BaseService { class MedicalService extends BaseService {
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List(); List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List();
getAppointmentHistory() async { getAppointmentHistory({bool isActiveAppointment = false}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map();
if(isActiveAppointment) {
body['IsActiveAppointment'] = true;
body['isDentalAllowedBackend'] = false;
}
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
@ -19,6 +24,6 @@ class MedicalService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: Map()); }, body: body);
} }
} }

@ -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/model/er/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; import 'package:diplomaticquarterapp/core/service/er/am_service.dart';
import 'package:diplomaticquarterapp/core/service/hospital_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/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
import '../../../locator.dart'; import '../../../locator.dart';
class AmRequestViewModel extends BaseViewModel { class AmRequestViewModel extends BaseViewModel {
AmService _amService = locator<AmService>(); AmService _amService = locator<AmService>();
HospitalService _hospitalService = locator<HospitalService>(); HospitalService _hospitalService = locator<HospitalService>();
MedicalService _medicalService = locator<MedicalService>();
List<PatientERTransportationMethod> List<PatientERTransportationMethod>
get amRequestModeList => _amService.amModelList; get amRequestModeList => _amService.amModelList;
List<PatientAllPresOrders> get patientAllPresOrdersList =>_amService.patientAllPresOrdersList; List<PatientAllPresOrders> get patientAllPresOrdersList =>_amService.patientAllPresOrdersList;
List<AppoitmentAllHistoryResultList> 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 { Future getAmRequestOrders() async {
setState(ViewState.Busy); setState(ViewState.Busy);

@ -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<AppoitmentAllHistoryResultList> 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],),
),
)
],
),
),
),
);
}
}

@ -1,41 +1,334 @@
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BillAmount extends StatefulWidget { class BillAmount extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
final PatientER patientER; final PatientER patientER;
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
BillAmount({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); BillAmount(
{Key key,
this.changeCurrentTab,
this.patientER,
this.amRequestViewModel});
@override @override
_BillAmountState createState() => _BillAmountState(); _BillAmountState createState() => _BillAmountState();
} }
class _BillAmountState extends State<BillAmount> { class _BillAmountState extends State<BillAmount> {
Ambulate _ambulate = Ambulate.None;
String note ="";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return SingleChildScrollView(
children: [ physics: BouncingScrollPhysics(),
Texts('BillAmount 3'), child: Container(
SizedBox(height: 45,), margin: EdgeInsets.only(left: 12, right: 12),
Container( child: Column(
padding: EdgeInsets.all(15), crossAxisAlignment: CrossAxisAlignment.start,
width: double.maxFinite, children: [
height: 76, Texts('Bill Amount '),
child:SecondaryButton( SizedBox(
color: Colors.grey[800], height: 10,
textColor: Colors.white, ),
onTap: ()=> widget.changeCurrentTab(3), Table(
label: 'Next', 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',
),
)
],
),
),
); );
} }
} }

@ -1,16 +1,29 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.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 } enum HaveAppointment { YES, NO }
class PickupLocation extends StatefulWidget { class PickupLocation extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
final PatientER patientER; final PatientER patientER;
final AmRequestViewModel amRequestViewModel;
PickupLocation( PickupLocation(
{Key key, {Key key,
@ -18,8 +31,6 @@ class PickupLocation extends StatefulWidget {
this.patientER, this.patientER,
this.amRequestViewModel}); this.amRequestViewModel});
final AmRequestViewModel amRequestViewModel;
@override @override
_PickupLocationState createState() => _PickupLocationState(); _PickupLocationState createState() => _PickupLocationState();
} }
@ -27,6 +38,26 @@ class PickupLocation extends StatefulWidget {
class _PickupLocationState extends State<PickupLocation> { class _PickupLocationState extends State<PickupLocation> {
bool _isInsideHome = false; bool _isInsideHome = false;
HaveAppointment _haveAppointment = HaveAppointment.NO; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -111,9 +142,12 @@ class _PickupLocationState extends State<PickupLocation> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() { if(myAppointment == null) {
_haveAppointment = HaveAppointment.YES; getAppointment();
}); setState(() {
_haveAppointment = HaveAppointment.YES;
});
}
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -130,9 +164,13 @@ class _PickupLocationState extends State<PickupLocation> {
groupValue: _haveAppointment, groupValue: _haveAppointment,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { if(myAppointment == null) {
_haveAppointment = value; getAppointment();
}); setState(() {
_haveAppointment = value;
});
}
}, },
), ),
), ),
@ -144,6 +182,7 @@ class _PickupLocationState extends State<PickupLocation> {
onTap: () { onTap: () {
setState(() { setState(() {
_haveAppointment = HaveAppointment.NO; _haveAppointment = HaveAppointment.NO;
myAppointment = null;
}); });
}, },
child: Container( child: Container(
@ -163,6 +202,7 @@ class _PickupLocationState extends State<PickupLocation> {
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_haveAppointment = value; _haveAppointment = value;
myAppointment = null;
}); });
}, },
), ),
@ -172,6 +212,18 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
], ],
), ),
if(myAppointment!=null)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
AppointmentCard(appointment: myAppointment,)
],
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -209,24 +261,43 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 15, height: 15,
), ),
Container( InkWell(
padding: EdgeInsets.all(12), onTap: () {
decoration: BoxDecoration( Navigator.push(
shape: BoxShape.rectangle, context,
borderRadius: BorderRadius.circular(8), MaterialPageRoute(
border: Border.all(color: Colors.grey, width: 0.5), builder: (context) => PlacePicker(
color: Colors.white, apiKey: 'AIzaSyCiD4YqVqLNYbt8-htvFy4Wp8XSph9E3wM',
), // Put YOUR OWN KEY here.
child: Row( onPlacePicked: (PickResult result) {
mainAxisAlignment: MainAxisAlignment.spaceBetween, print(result.adrAddress);
children: [ Navigator.of(context).pop();
Texts('Pickup Location'), },
Icon( initialPosition: LatLng(_latitude, _longitude),
Icons.arrow_drop_down, useCurrentLocation: true,
size: 24, ),
color: Colors.black, ),
) );
], },
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( SizedBox(
@ -270,7 +341,12 @@ class _PickupLocationState extends State<PickupLocation> {
child: SecondaryButton( child: SecondaryButton(
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
onTap: () => widget.changeCurrentTab(2), onTap: () {
setState(() {
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2);
});
},
label: 'Next', label: 'Next',
), ),
) )
@ -279,4 +355,37 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
); );
} }
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');
}
});
}
} }

@ -42,6 +42,10 @@ class _SelectTransportationMethodState
_way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays; _way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays;
_erTransportationMethod = widget.amRequestViewModel _erTransportationMethod = widget.amRequestViewModel
.amRequestModeList[(widget.patientER.selectedAmbulate - 1)]; .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 .amRequestViewModel.amRequestModeList
.indexOf(_erTransportationMethod) + .indexOf(_erTransportationMethod) +
1); 1);
widget.patientER.patientERTransportationMethod =
_erTransportationMethod;
widget.changeCurrentTab(1); widget.changeCurrentTab(1);
}); });
}, },

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
class Summary extends StatefulWidget { class Summary extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
@ -19,23 +20,86 @@ class Summary extends StatefulWidget {
class _SummaryState extends State<Summary> { class _SummaryState extends State<Summary> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return SingleChildScrollView(
children: [ child: Container(
Texts('Summary 4'), margin: EdgeInsets.only(left: 12, right: 12),
SizedBox(height: 45,), child: Column(
Container( crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.all(15), children: [
width: double.maxFinite, Texts('Summary'),
height: 76, SizedBox(height: 5,),
child:SecondaryButton( Container(
color: Colors.grey[800], width: double.infinity,
textColor: Colors.white,
label: 'Next', padding: EdgeInsets.all(10),
decoration: BoxDecoration(
// onTap: ()=> widget.changeCurrentTab(2), 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),
),
)
],
),
),
); );
} }
} }

@ -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))),
],
),
),
)
],
),
);
}
}

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class StepsWidget extends StatelessWidget { class StepsWidget extends StatelessWidget {
final int index; final int index;
@ -10,7 +12,8 @@ class StepsWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Stack( ProjectViewModel projectViewModel = Provider.of(context);
return projectViewModel.isArabic? Stack(
children: [ children: [
Container( Container(
height: 50, 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],
),
),
),
),
),
],
); );
} }
} }

@ -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..." )),
],),
);
}

@ -5,7 +5,7 @@ description: A new Flutter application.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.2.2 <3.0.0" sdk: ">=2.6.0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
@ -128,6 +128,10 @@ dependencies:
#Handle Geolocation #Handle Geolocation
geolocator: ^6.0.0+1 geolocator: ^6.0.0+1
#google maps places
google_maps_place_picker: ^0.10.0
#Dependencies for video call implementation #Dependencies for video call implementation
native_device_orientation: ^0.3.0 native_device_orientation: ^0.3.0
enum_to_string: ^1.0.9 enum_to_string: ^1.0.9

Loading…
Cancel
Save