Done Prescription Details Screen

merge-requests/111/head
Mohammad ALjammal 6 years ago
parent c1b21dc1c3
commit 0c94188405

@ -3,7 +3,6 @@ import 'package:doctor_app_flutter/models/request_doctor_reply.dart';
import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart';
import 'package:flutter/cupertino.dart';
class DoctorReplyProvider with ChangeNotifier {
List<ListGtMyPatientsQuestions> listDoctorWorkingHoursTable = [];
@ -18,20 +17,21 @@ class DoctorReplyProvider with ChangeNotifier {
getDoctorReply() async {
try {
await BaseAppClient.post('DoctorApplication.svc/REST/GtMyPatientsQuestions',
body: _requestDoctorReply.toJson(),
onSuccess: (dynamic response, int statusCode) {
response['List_GtMyPatientsQuestions'].forEach((v) {
listDoctorWorkingHoursTable.add(ListGtMyPatientsQuestions.fromJson(v));
isError = false;
isLoading = false;
});
},
onFailure: (String error, int statusCode) {
isError = true;
await BaseAppClient.post(
'DoctorApplication.svc/REST/GtMyPatientsQuestions',
body: _requestDoctorReply.toJson(),
onSuccess: (dynamic response, int statusCode) {
response['List_GtMyPatientsQuestions'].forEach((v) {
listDoctorWorkingHoursTable
.add(ListGtMyPatientsQuestions.fromJson(v));
isError = false;
isLoading = false;
this.error= error;
});
}, onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
});
notifyListeners();
} catch (error) {

@ -1,11 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/prescription_report.dart';
import 'package:doctor_app_flutter/models/request_prescription_report.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
@ -67,181 +64,4 @@ class _OutPatientPrescriptionDetailsScreenState
}
}
class OutPatientPrescriptionDetailsItem extends StatefulWidget {
final PrescriptionReport prescriptionReport;
OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport});
@override
_OutPatientPrescriptionDetailsItemState createState() =>
_OutPatientPrescriptionDetailsItemState();
}
class _OutPatientPrescriptionDetailsItemState
extends State<OutPatientPrescriptionDetailsItem> {
bool _showDetails = false;
@override
Widget build(BuildContext context) {
return Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 5,
child: AppText(
'${widget.prescriptionReport.itemDescription} ',
fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
_showDetails = !_showDetails;
});
},
child: Icon(_showDetails
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down)),
),
],
),
!_showDetails
? Container()
: AnimatedContainer(
duration: Duration(milliseconds: 200),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 5,
),
Divider(
color: Color(0xFF000000),
height: 0.5,
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 0.5),
),
children: [
TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Route',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.prescriptionReport.route}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Frequency Timing',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
widget.prescriptionReport.frequency,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
]),
TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Insurance Covered',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Duration Days',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.prescriptionReport.days}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
]),
TableRow(
children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Doctor Remarks',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.prescriptionReport.remarks}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container()
],
),
],
),
],
),
)
],
),
);
}
}

@ -1,12 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
@ -23,8 +17,6 @@ class InpatientPrescriptionDetailsScreen extends StatefulWidget {
class _InpatientPrescriptionDetailsScreenState
extends State<InpatientPrescriptionDetailsScreen> {
bool _showDetails = false;
bool _isLoading = false;
final _formKey = GlobalKey<FormState>();
String error;
TextEditingController answerController;
bool _isInit = true;
@ -32,7 +24,6 @@ class _InpatientPrescriptionDetailsScreenState
@override
void initState() {
// answerController = new TextEditingController(text: widget.myReferralPatientModel.referredDoctorRemarks ?? '');
super.initState();
}
@ -49,7 +40,7 @@ class _InpatientPrescriptionDetailsScreenState
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: 'perscription info',
appBarTitle: 'Prescription info',
body: CardWithBgWidgetNew(
widget: Container(
child: ListView(
@ -99,23 +90,23 @@ class _InpatientPrescriptionDetailsScreenState
des: '${prescription.refillID}',
key: 'Refill'),
buildTableRow(
des: '${prescription.dose}',
key: 'Dose'),
des: '${prescription.dose}', key: 'Dose'),
buildTableRow(
des: '${prescription.unitofMeasurement}',
key: 'UOM'),
buildTableRow(
des: '${Helpers.getDate(prescription.startDatetime) }',
des:
'${Helpers.getDate(prescription.startDatetime)}',
key: 'Start Date'),
buildTableRow(
des: '${Helpers.getDate(prescription.stopDatetime)}',
des:
'${Helpers.getDate(prescription.stopDatetime)}',
key: 'Stop Date'),
buildTableRow(
des: '${prescription.noOfDoses}',
key: 'No of Doses'),
buildTableRow(
des: '${prescription.route}',
key: 'Route'),
des: '${prescription.route}', key: 'Route'),
buildTableRow(
des: '${prescription.comments}',
key: 'Comments'),
@ -123,7 +114,8 @@ class _InpatientPrescriptionDetailsScreenState
des: '${prescription.pharmacyRemarks}',
key: 'Pharmacy Remarks'),
buildTableRow(
des: '${Helpers.getDate(prescription.prescriptionDatetime)}',
des:
'${Helpers.getDate(prescription.prescriptionDatetime)}',
key: 'Prescription Date'),
buildTableRow(
des: '${prescription.refillID}',

@ -0,0 +1,138 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/prescription_report.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class OutPatientPrescriptionDetailsItem extends StatefulWidget {
final PrescriptionReport prescriptionReport;
OutPatientPrescriptionDetailsItem({Key key, this.prescriptionReport});
@override
_OutPatientPrescriptionDetailsItemState createState() =>
_OutPatientPrescriptionDetailsItemState();
}
class _OutPatientPrescriptionDetailsItemState
extends State<OutPatientPrescriptionDetailsItem> {
bool _showDetails = false;
@override
Widget build(BuildContext context) {
return Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 5,
child: AppText(
'${widget.prescriptionReport.itemDescription} ',
fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
_showDetails = !_showDetails;
});
},
child: Icon(_showDetails
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down)),
),
],
),
!_showDetails
? Container()
: AnimatedContainer(
duration: Duration(milliseconds: 200),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 5,
),
Divider(
color: Color(0xFF000000),
height: 0.5,
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 0.5),
),
children: [
buildTableRow(
key: 'Route',
des: widget.prescriptionReport.route),
buildTableRow(
key: 'Frequency Timing',
des: widget.prescriptionReport.frequency),
buildTableRow(key: 'Insurance Covered', des: ''),
buildTableRow(
key: 'Duration Days',
des: widget.prescriptionReport.days),
buildTableRow(
key: 'IDoctor Remarks',
des: widget.prescriptionReport.remarks),
],
),
Divider(
color: Color(0xFF000000),
height: 0.5,
),
],
),
)
],
),
);
}
TableRow buildTableRow({des, key}) {
print('$key: $des');
return TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Row(
children: <Widget>[
Expanded(
child: Container(
child: AppText(
key,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
AppText(
'${des}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
textAlign: TextAlign.center,
)
],
),
),
),
],
),
),
]);
}
}
Loading…
Cancel
Save