merge-requests/465/head
Sultan Khan 5 years ago
commit 7f557adeae

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
@ -44,8 +45,7 @@ class UpdatePlanPage extends StatefulWidget {
} }
class _UpdatePlanPageState extends State<UpdatePlanPage> { class _UpdatePlanPageState extends State<UpdatePlanPage> {
bool isProgressNoteExpand = false; bool isAddProgress = true;
TextEditingController progressNoteController = TextEditingController progressNoteController =
TextEditingController(text: null); TextEditingController(text: null);
@ -62,7 +62,17 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
)), )),
); );
} }
TextEditingController typeController = TextEditingController();
@override
void initState() {
super.initState();
if(widget.patientProgressNote.planNote !=null ){
setState(() {
isAddProgress = false;
});
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -83,7 +93,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn;
widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn;
widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName;
setState(() {
isAddProgress = false;
});
} }
widget.changeLoadingState(false); widget.changeLoadingState(false);
}, },
@ -111,50 +123,15 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox(
height: 10,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Row(
children: [
Texts(TranslationBase
.of(context)
.progressNoteSOAP,
variant: isProgressNoteExpand ? "bodyText" : '',
bold: isProgressNoteExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: Colors.black,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isProgressNoteExpand = !isProgressNoteExpand;
});
},
child: Icon(isProgressNoteExpand
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 2,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if(widget.patientProgressNote.planNote == null)
Container( Container(
margin: margin: EdgeInsets.only(left: 5, right: 5),
EdgeInsets.only(left: 10, right: 10, top: 15), child: Texts(TranslationBase.of(context).progressNote)),
if( isAddProgress)
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context).progressNote, hintText: TranslationBase.of(context).progressNote,
controller: progressNoteController, controller: progressNoteController,
@ -162,115 +139,82 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
maxLines: 4, maxLines: 4,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onChanged: (value){ onChanged: (value){
// examination.remark = value; widget.patientProgressNote.planNote = value;
}, },
), ),
), ),
SizedBox( SizedBox(
height: 20, height: 9,
), ),
if ( widget.patientProgressNote.planNote != null) if ( widget.patientProgressNote.planNote != null && !isAddProgress)
Container( Container(
margin: margin:
EdgeInsets.only(left: 5, right: 5, top: 15), EdgeInsets.only(left: 5, right: 5,),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: 8,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Texts('Appointment No: '), Texts('Appointment No: ',fontSize: 12,),
Texts(widget.patientProgressNote.appointmentNo.toString()), Texts(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,),
], ],
), ),
AppText( Texts(
widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight fontWeight: FontWeight.w600,
.bold, fontSize: 14,
fontSize: 16,
) )
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts('Condition: '),
Texts(widget.patientProgressNote.mName.toString()),
],
),
if(widget.patientProgressNote.createdByName !=null)
Row( Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
AppText( Texts('Condition: ',fontSize: 12,),
TranslationBase.of(context).createdBy, Texts(widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600),
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.patientProgressNote.createdByName??"",
fontSize: 10,
color: Colors.grey,
),
], ],
), ),
if(widget.patientProgressNote.editedByName !=null) Texts(
Row( widget.patientProgressNote.createdOn !=null?DateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getHour(DateTime.now()),
mainAxisAlignment: fontWeight: FontWeight.w600,
MainAxisAlignment.start, fontSize: 14,
children: [ )
AppText(
TranslationBase.of(context).editedBy,
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.patientProgressNote.editedByName??"",
fontSize: 10,
color: Colors.grey,
),
], ],
), ),
SizedBox(height: 8,),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
SizedBox( Expanded(
height: 6,
),
Padding(
padding: const EdgeInsets.all(0.0),
child: Container(
width: MediaQuery.of(context)
.size
.width *
0.6,
child: Texts( child: Texts(
progressNoteController.text, progressNoteController.text,
fontSize: 10, fontSize: 10,
color: Colors.grey,
),
), ),
), ),
InkWell(
onTap: (){
setState(() {
isAddProgress = true;
widget.changePageViewIndex(3,isChangeState:false);
});
},
child: Icon(DoctorApp.edit,size: 18,))
], ],
), ),
], ],
), ),
) )
], ],
)
]),
isExpand: isProgressNoteExpand,
), ),
], ],
@ -281,20 +225,21 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.maxFinite, width: double.maxFinite,
height: 70, height: 90,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
margin: EdgeInsets.all(6), margin: EdgeInsets.all(6),
child: Column( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
Expanded( Expanded(
child: AppButton( child: AppButton(
title: 'Previous', title: 'Previous',
color: Colors.white38, color: Colors.grey[300],
fontColor: Colors.black, fontColor: Colors.black,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w400,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
setState(() { setState(() {
@ -306,13 +251,14 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
SizedBox(width: 5,), SizedBox(width: 5,),
Expanded( Expanded(
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: isAddProgress? TranslationBase.of(context).next: "Finish",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w400,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
color: Colors.red[700],
disabled: progressNoteController.text.isEmpty, disabled: progressNoteController.text.isEmpty,
onPressed: () async { onPressed: () async {
if(widget.patientProgressNote.planNote.isEmpty) { if(isAddProgress) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
setState(() { setState(() {
@ -320,10 +266,13 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
widget.patientProgressNote.editedByName = doctorProfile.doctorName; widget.patientProgressNote.editedByName = doctorProfile.doctorName;
widget.patientProgressNote.createdOn = DateTime.now().toString(); widget.patientProgressNote.createdOn = DateTime.now().toString();
widget.patientProgressNote.planNote = progressNoteController.text; widget.patientProgressNote.planNote = progressNoteController.text;
isAddProgress = !isAddProgress;
}); });
} else
submitPlan(model); submitPlan(model);
} else{
Navigator.of(context).pop();
}
}, },
), ),
), ),
@ -335,6 +284,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
), ),
), ),
),
); );
} }
@ -361,7 +311,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
} else { } else {
Navigator.of(context).pop(); widget.changePageViewIndex(4,isChangeState:false);
} }
} else { } else {
helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);

@ -38,9 +38,13 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel(); GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex) { changePageViewIndex(pageIndex,{isChangeState = true}) {
if (pageIndex != _currentIndex) changeLoadingState(true); if (pageIndex != _currentIndex && isChangeState)
changeLoadingState(true);
_controller.jumpToPage(pageIndex); _controller.jumpToPage(pageIndex);
setState(() {
_currentIndex = pageIndex;
});
} }
bool _isLoading = true; bool _isLoading = true;

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -89,7 +90,7 @@ class DoctorCardInsurance extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: Texts( child: Texts(
'$patientOut', '$patientOut'.replaceAll(" ", ""),
color: Colors.white, color: Colors.white,
fontSize: 13.0, fontSize: 13.0,
), ),
@ -102,7 +103,7 @@ class DoctorCardInsurance extends StatelessWidget {
Expanded( Expanded(
child: Texts( child: Texts(
doctorName, doctorName,
bold: true, fontWeight: FontWeight.w700,
)), )),
], ],
), ),
@ -153,11 +154,13 @@ class DoctorCardInsurance extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Texts( Texts(
'Clinic: ', 'Clinic: ',
color: Colors.grey[500], //fontWeight: FontWeight.w600,
//color: Colors.grey[500],
), ),
Expanded( Expanded(
child: Texts( child: Texts(
clinic, clinic,
fontWeight: FontWeight.w700,
), ),
) )
], ],
@ -167,19 +170,24 @@ class DoctorCardInsurance extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Texts( Texts(
'Approval No: ', 'Approval No: ',
color: Colors.grey[500], //color: Colors.grey[500],
), ),
Texts( Texts(
branch, branch,
fontWeight: FontWeight.w700,
) )
], ],
) )
]), ]),
), ),
), ),
Icon( Padding(
EvaIcons.eye, padding:
size: 38.0, const EdgeInsets.symmetric(horizontal: 15.0),
child: Icon(
DoctorApp.view,
size: 22.0,
),
) )
], ],
), ),

@ -18,14 +18,14 @@ class HeaderBodyExpandableNotifier extends StatefulWidget {
class _HeaderBodyExpandableNotifierState class _HeaderBodyExpandableNotifierState
extends State<HeaderBodyExpandableNotifier> { extends State<HeaderBodyExpandableNotifier> {
@override @override
Widget build(BuildContext context) { void initState() {
setState(() { super.initState();
if (widget.isExpand == true) {
widget.expandFlag = widget.isExpand;
widget.controller.expanded = true;
} }
}); @override
Widget build(BuildContext context) {
return ExpandableNotifier( return ExpandableNotifier(
child: Padding( child: Padding(

Loading…
Cancel
Save