update the design on the progress note (SOAP)

merge-requests/463/head
Mohammad Aljammal 5 years ago
parent 76b80600c6
commit 0745d2d56e

@ -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);
@ -64,6 +64,17 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
} }
TextEditingController typeController = TextEditingController(); TextEditingController typeController = TextEditingController();
@override
void initState() {
super.initState();
if(widget.patientProgressNote.planNote !=null ){
setState(() {
isAddProgress = true;
});
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
@ -111,166 +122,97 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox( Column(
height: 10, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
HeaderBodyExpandableNotifier( Container(
headerWidget: Row( margin: EdgeInsets.only(left: 5, right: 5),
mainAxisAlignment: MainAxisAlignment.spaceAround, child: Texts(TranslationBase.of(context).progressNote)),
children: [ if( isAddProgress)
Row( Container(
children: [ margin: EdgeInsets.only(left: 10, right: 10, top: 15),
Texts(TranslationBase child: AppTextFieldCustom(
.of(context) hintText: TranslationBase.of(context).progressNote,
.progressNoteSOAP, controller: progressNoteController,
variant: isProgressNoteExpand ? "bodyText" : '', minLines: 2,
bold: isProgressNoteExpand ? true : false, maxLines: 4,
color: Colors.black), inputType: TextInputType.multiline,
Icon( onChanged: (value){
FontAwesomeIcons.asterisk, widget.patientProgressNote.planNote = value;
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( SizedBox(
height: 2, height: 9,
), ),
Column( if ( widget.patientProgressNote.planNote != null && !isAddProgress)
children: [ Container(
if(widget.patientProgressNote.planNote == null) margin:
Container( EdgeInsets.only(left: 5, right: 5,),
margin: child: Column(
EdgeInsets.only(left: 10, right: 10, top: 15), crossAxisAlignment:
CrossAxisAlignment.start,
child: AppTextFieldCustom( children: [
hintText: TranslationBase.of(context).progressNote, Row(
controller: progressNoteController, mainAxisAlignment: MainAxisAlignment.spaceBetween,
minLines: 2, crossAxisAlignment: CrossAxisAlignment.start,
maxLines: 4,
inputType: TextInputType.multiline,
onChanged: (value){
// examination.remark = value;
},
),
),
SizedBox(
height: 20,
),
if ( widget.patientProgressNote.planNote != null)
Container(
margin:
EdgeInsets.only(left: 5, right: 5, top: 15),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: 8,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Row( Texts('Appointment No: ',fontSize: 12,),
children: [ Texts(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,),
Texts('Appointment No: '),
Texts(widget.patientProgressNote.appointmentNo.toString()),
],
),
AppText(
widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight
.bold,
fontSize: 16,
)
], ],
), ),
Row( Texts(
children: [ widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()),
Texts('Condition: '), fontWeight: FontWeight.w600,
Texts(widget.patientProgressNote.mName.toString()), fontSize: 14,
)
], ],
), ),
if(widget.patientProgressNote.createdByName !=null) Row(
Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
MainAxisAlignment.start, children: [
children: [
AppText(
TranslationBase.of(context).createdBy,
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.patientProgressNote.createdByName??"",
fontSize: 10,
color: Colors.grey,
),
],
),
if(widget.patientProgressNote.editedByName !=null)
Row( Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
AppText( Texts('Condition: ',fontSize: 12,),
TranslationBase.of(context).editedBy, Texts(widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600),
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.patientProgressNote.editedByName??"",
fontSize: 10,
color: Colors.grey,
),
], ],
), ),
Row( Texts(
mainAxisAlignment: widget.patientProgressNote.createdOn !=null?DateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getHour(DateTime.now()),
MainAxisAlignment.start, fontWeight: FontWeight.w600,
children: [ fontSize: 14,
SizedBox( )
height: 6, ],
), ),
Padding( SizedBox(height: 8,),
padding: const EdgeInsets.all(0.0), Row(
child: Container( mainAxisAlignment: MainAxisAlignment.start,
width: MediaQuery.of(context) children: [
.size Expanded(
.width * child: Texts(
0.6, progressNoteController.text+"asdasd sdakfjhg gfadsfg dashkfgasd hgd sfnbsd,fbnsdafbasdnzb",
child: Texts( fontSize: 10,
progressNoteController.text,
fontSize: 10, ),
color: Colors.grey,
),
),
),
],
), ),
InkWell(
onTap: (){
setState(() {
isAddProgress = true;
});
},
child: Icon(DoctorApp.edit,size: 18,))
], ],
), ),
) ],
], ),
) )
]), ],
isExpand: isProgressNoteExpand,
), ),
], ],
@ -281,56 +223,62 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.maxFinite, width: double.maxFinite,
height: 70, height: 90,
child: Container( child: Padding(
margin: EdgeInsets.all(6), padding: const EdgeInsets.all(8.0),
child: Column( child: Container(
children: [ margin: EdgeInsets.all(6),
child: Column(
Row( children: [
children: [ Row(
Expanded( children: [
child: AppButton( Expanded(
title: 'Previous', child: AppButton(
color: Colors.white38, title: 'Previous',
fontColor: Colors.black, color: Colors.grey[300],
fontWeight: FontWeight.w700, fontColor: Colors.black,
loading: model.state == ViewState.BusyLocal, fontWeight: FontWeight.w400,
onPressed: () async { loading: model.state == ViewState.BusyLocal,
setState(() { onPressed: () async {
widget.changePageViewIndex(2); setState(() {
}); widget.changePageViewIndex(2);
}, });
},
),
), ),
), SizedBox(width: 5,),
SizedBox(width: 5,), Expanded(
Expanded( child: AppButton(
child: AppButton( title: isAddProgress? TranslationBase.of(context).next: "Finish",
title: TranslationBase.of(context).next, fontWeight: FontWeight.w400,
fontWeight: FontWeight.w700, 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(() {
widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName ?? doctorProfile.doctorName;
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 } else{
submitPlan(model); var asd ="";
}, // submitPlan(model);
}
},
),
), ),
), ],
], ),
),
], ],
),
), ),
), ),
), ),

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

Loading…
Cancel
Save