fix patient card appbare bugs

merge-requests/432/head
mosazaid 4 years ago
parent c52866c596
commit 0528323e15

@ -20,296 +20,294 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return PreferredSize( return Container(
preferredSize: Size(double.infinity, 200), padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5,),
decoration: BoxDecoration(
color: Colors.white,
),
height: 200,
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5,), left: 10, right: 10, bottom: 10),
decoration: BoxDecoration( margin: EdgeInsets.only(top: 50),
color: Colors.white, child: Column(
), children: [
height: 200, Container(
child: Container( padding: EdgeInsets.only(left: 12.0),
padding: EdgeInsets.only( child: Row(children: [
left: 10, right: 10, bottom: 10), IconButton(
margin: EdgeInsets.only(top: 50), icon: Icon(Icons.arrow_back_ios),
child: Column( color: Colors.black, //Colors.black,
children: [ onPressed: () => Navigator.pop(context),
Container( ),
padding: EdgeInsets.only(left: 12.0), Expanded(
child: Row(children: [ child: AppText(
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
AppText(
patient.firstName != null ? patient.firstName != null ?
(Helpers.capitalize(patient.firstName) + (Helpers.capitalize(patient.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier *2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
patient.gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
patient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
), ),
SizedBox( patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
width: 10, ? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
), ),
Expanded( ]),
child: Column( ),
crossAxisAlignment: Row(children: [
CrossAxisAlignment.start, Padding(
children: [ padding: EdgeInsets.only(left: 12.0),
SERVICES_PATIANT2[ child: Container(
int.parse(patientType)] == width: 60,
"patientArrivalList" height: 60,
? Container( child: Image.asset(
child: Row( patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
mainAxisAlignment: ? 'assets/images/male_avatar.png'
MainAxisAlignment : 'assets/images/female_avatar.png',
.spaceBetween, fit: BoxFit.cover,
children: [ ),
patient.patientStatusType == ),
43 ),
? AppText( SizedBox(
TranslationBase.of( width: 10,
context) ),
.arrivedP, Expanded(
color: Colors.green, child: Column(
fontWeight: crossAxisAlignment:
FontWeight.bold, CrossAxisAlignment.start,
fontFamily: children: [
'Poppins', SERVICES_PATIANT2[
fontSize: 12, int.parse(patientType)] ==
) "patientArrivalList"
: AppText( ? Container(
TranslationBase.of( child: Row(
context) mainAxisAlignment:
.notArrived, MainAxisAlignment
color: .spaceBetween,
Colors.red[800], children: [
patient.patientStatusType ==
43
? AppText(
TranslationBase.of(
context)
.arrivedP,
color: Colors.green,
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(
context)
.notArrived,
color:
Colors.red[800],
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
),
arrivalType == '1'
? AppText(
patient.startTime !=
null
? patient
.startTime
: '',
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
: AppText(
DateUtils.convertStringToDateFormat(
patient
.arrivedOn,
'MM-dd-yyyy HH:mm'),
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
],
))
: SizedBox(),
if (SERVICES_PATIANT2[
int.parse(patientType)] ==
"List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.circular(
25),
color: HexColor(
"#20A169"),
),
child: AppText(
patient.startTime,
color: Colors.white,
fontSize: 1.5 *
SizeConfig
.textMultiplier,
textAlign: TextAlign
.center,
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
), ),
arrivalType == '1' )
? AppText( : SizedBox(),
patient.startTime != SizedBox(
null width: 3.5,
? patient ),
.startTime Container(
: '', child: AppText(
fontFamily: convertDateFormat2(patient.appointmentDate.toString()?? ''),
'Poppins', fontSize: 1.5 *
fontWeight: SizeConfig
FontWeight.w600, .textMultiplier,
)
: AppText(
DateUtils.convertStringToDateFormat(
patient
.arrivedOn,
'MM-dd-yyyy HH:mm'),
fontFamily:
'Poppins',
fontWeight: fontWeight:
FontWeight.w600, FontWeight.bold,
)
],
))
: SizedBox(),
if (SERVICES_PATIANT2[
int.parse(patientType)] ==
"List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.circular(
25),
color: HexColor(
"#20A169"),
),
child: AppText(
patient.startTime,
color: Colors.white,
fontSize: 1.5 *
SizeConfig
.textMultiplier,
textAlign: TextAlign
.center,
fontWeight:
FontWeight.bold,
),
)
: SizedBox(),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
),
), ),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(
top: 8,
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig
.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(
context)
.fileNumber,
style: TextStyle(
fontSize: 12,
fontFamily:
'Poppins')),
new TextSpan(
text: patient.patientId
.toString(),
style: TextStyle(
fontWeight:
FontWeight.w700,
fontFamily:
'Poppins',
fontSize: 14)),
],
), ),
), SizedBox(
Row( height: 0.5,
children: [ )
AppText( ],
patient.nationalityName ?? ),
patient.nationality, margin: EdgeInsets.only(
fontWeight: FontWeight.bold, top: 8,
fontSize: 12, ),
),
patient.nationality != null
? ClipRRect(
borderRadius:
BorderRadius
.circular(
20.0),
child: Image.network(
patient
.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder:
(BuildContext
context,
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))
: SizedBox()
],
)
],
), ),
Container( Row(
child: RichText( mainAxisAlignment:
text: new TextSpan( MainAxisAlignment.spaceBetween,
style: new TextStyle( children: [
fontSize: 1.6 * RichText(
SizeConfig.textMultiplier, text: TextSpan(
color: Colors.black, style: TextStyle(
fontFamily: 'Poppins', fontSize: 1.6 *
), SizeConfig
.textMultiplier,
color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text:
TranslationBase.of(
context) context)
.age + .fileNumber,
" : ",
style: TextStyle( style: TextStyle(
fontSize: 14)), fontSize: 12,
fontFamily:
'Poppins')),
new TextSpan( new TextSpan(
text: text: patient.patientId
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", .toString(),
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,
fontFamily:
'Poppins',
fontSize: 14)), fontSize: 14)),
], ],
), ),
), ),
Row(
children: [
AppText(
patient.nationalityName ??
patient.nationality,
fontWeight: FontWeight.bold,
fontSize: 12,
),
patient.nationality != null
? ClipRRect(
borderRadius:
BorderRadius
.circular(
20.0),
child: Image.network(
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder:
(BuildContext
context,
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))
: SizedBox()
],
)
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.age +
" : ",
style: TextStyle(
fontSize: 14)),
new TextSpan(
text:
"${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle(
fontWeight:
FontWeight.w700,
fontSize: 14)),
],
),
), ),
], ),
), ],
), ),
]), ),
], ]),
), ],
), ),
), ),
); );

@ -54,7 +54,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
), ),
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -72,7 +72,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -256,8 +256,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
.circular( .circular(
20.0), 20.0),
child: Image.network( child: Image.network(
patient patient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
@ -295,7 +294,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
fontSize: 14)), fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,

@ -63,17 +63,20 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
AppText( Expanded(
(Helpers.capitalize(patient.firstName) + child: AppText(
" " + patient.firstName != null ?
Helpers.capitalize( (Helpers.capitalize(patient.firstName) +
patient.lastName)), " " +
fontSize: SizeConfig.textMultiplier * 3, Helpers.capitalize(
fontWeight: FontWeight.bold, patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
backGroundcolor: Colors.white, fontSize: SizeConfig.textMultiplier *2.5,
fontFamily: 'Poppins', fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
fontFamily: 'Poppins',
),
), ),
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -91,7 +94,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -210,7 +213,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate??''), convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 * fontSize: 1.5 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -275,8 +278,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
.circular( .circular(
20.0), 20.0),
child: Image.network( child: Image.network(
patient patient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
@ -314,7 +316,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget {
fontSize: 14)), fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,

@ -63,18 +63,20 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
AppText( Expanded(
patient.firstName != null ? child: AppText(
(Helpers.capitalize(patient.firstName) + patient.firstName != null ?
" " + (Helpers.capitalize(patient.firstName) +
Helpers.capitalize( " " +
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), Helpers.capitalize(
fontSize: SizeConfig.textMultiplier * 2.5, patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier *2.5,
backGroundcolor: Colors.white, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', backGroundcolor: Colors.white,
fontFamily: 'Poppins',
),
), ),
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
@ -92,7 +94,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
patient.gender == 1 patient.patientDetails != null ? patient.patientDetails.gender == 1 : patient.gender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -211,7 +213,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate??''), convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 * fontSize: 1.5 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -276,8 +278,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
.circular( .circular(
20.0), 20.0),
child: Image.network( child: Image.network(
patient patient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder:
@ -315,7 +316,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre
fontSize: 14)), fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: fontWeight:
FontWeight.w700, FontWeight.w700,

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.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';
@ -13,6 +14,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.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/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
@ -25,6 +27,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.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:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class UpdateObjectivePage extends StatefulWidget { class UpdateObjectivePage extends StatefulWidget {
@ -33,8 +36,13 @@ class UpdateObjectivePage extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
UpdateObjectivePage( UpdateObjectivePage(
{Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo, this.changeLoadingState}); {Key key,
this.changePageViewIndex,
this.mySelectedExamination,
this.patientInfo,
this.changeLoadingState});
@override @override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState(); _UpdateObjectivePageState createState() => _UpdateObjectivePageState();
@ -55,6 +63,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
)), )),
); );
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
@ -97,350 +106,435 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
// baseViewModel: model, // baseViewModel: model,
body: Column(
body: SingleChildScrollView( mainAxisAlignment: MainAxisAlignment.spaceBetween,
physics: ScrollPhysics(), children: [
child: Center( Expanded(
child: FractionallySizedBox( child: SingleChildScrollView(
widthFactor: 0.9, physics: ScrollPhysics(),
child: Column( child: Container(
mainAxisAlignment: MainAxisAlignment.start, color: Color.fromRGBO(248, 248, 248, 1),
children: [ child: Center(
SizedBox( child: FractionallySizedBox(
height: 30, widthFactor: 0.95,
), child: Container(
HeaderBodyExpandableNotifier( margin: EdgeInsets.all(8.0),
headerWidget: Row( padding: EdgeInsets.all(12.0),
mainAxisAlignment: MainAxisAlignment.spaceBetween, decoration: BoxDecoration(
children: [ shape: BoxShape.rectangle,
Row( color: Colors.white,
children: [ borderRadius: BorderRadius.circular(12),
Texts(TranslationBase.of(context).physicalSystemExamination, border: Border.fromBorderSide(BorderSide(
variant: isSysExaminationExpand color: Colors.grey.shade400,
? "bodyText" width: 0.4,
: '', )),
bold: isSysExaminationExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
), ),
InkWell( child: Column(
onTap: () { mainAxisAlignment: MainAxisAlignment.start,
setState(() { children: [
isSysExaminationExpand = HeaderBodyExpandableNotifier(
!isSysExaminationExpand; headerWidget: Row(
}); mainAxisAlignment:
}, MainAxisAlignment.spaceBetween,
child: Icon(isSysExaminationExpand children: [
? EvaIcons.minus Row(
: EvaIcons.plus)) children: [
], AppText(
), "${TranslationBase.of(context).physicalSystemExamination}",
bodyWidget: Column(children: [ fontFamily: 'Poppins',
SizedBox( fontSize: SizeConfig.textMultiplier * 2.0,
height: 20, fontWeight: isSysExaminationExpand ? FontWeight.w700 : FontWeight.normal,
), ),
Column( /*Texts(
children: [ TranslationBase.of(context)
Container( .physicalSystemExamination,
margin: variant: isSysExaminationExpand
EdgeInsets.only(left: 10, right: 10, top: 15), ? "bodyText"
child: TextFields( : '',
hintText: TranslationBase.of(context).physicalSystemExamination, bold: isSysExaminationExpand
fontSize: 13.5, ? true
onTapTextFields: () { : false,
openExaminationList(context); color: Colors.black),*/
}, Icon(
readOnly: true, FontAwesomeIcons.asterisk,
// hintColor: Colors.black, color: AppGlobal.appPrimaryColor,
suffixIcon: EvaIcons.plusCircleOutline, size: 12,
suffixIconColor: AppGlobal.appPrimaryColor, )
fontWeight: FontWeight.w600, ],
// controller: messageController, ),
validator: (value) { InkWell(
if (value == null) onTap: () {
return TranslationBase.of(context) setState(() {
.emptyMessage; isSysExaminationExpand =
else !isSysExaminationExpand;
return null; });
}), },
), child: Icon(isSysExaminationExpand
SizedBox( ? Icons.keyboard_arrow_up
height: 20, : Icons.keyboard_arrow_down))
), ],
Column( ),
children: bodyWidget: Column(children: [
widget.mySelectedExamination.map((examination) {
TextEditingController remarksController= TextEditingController(text :examination.remark);
return Container(
margin: EdgeInsets.only(
left: 15, right: 15, top: 15),
child: Column(children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
( examination
.selectedExamination.nameEn )
.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black)
],
),
SizedBox( SizedBox(
height: 8, height: 20,
), ),
Row( Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Container(
children: [ margin: EdgeInsets.only(
InkWell( left: 10, right: 10, top: 15),
child: Center( child: TextFields(
child: Container( hintText: TranslationBase.of(context)
height: .physicalSystemExamination,
screenSize.height * fontSize: 13.5,
0.070, onTapTextFields: () {
decoration: openExaminationList(context);
containerBorderDecoration( },
examination readOnly: true,
.isNormal // hintColor: Colors.black,
? Color( suffixIcon:
0xFF515A5D) EvaIcons.plusCircleOutline,
: Colors suffixIconColor:
.white, AppGlobal.appPrimaryColor,
Colors.grey), fontWeight: FontWeight.w600,
child: Center( // controller: messageController,
child: Padding( validator: (value) {
padding: if (value == null)
const EdgeInsets return TranslationBase.of(context)
.all(8.0), .emptyMessage;
child: Text( else
TranslationBase.of(context).normal, return null;
style: TextStyle( }),
fontSize: 12, ),
color: SizedBox(
examination height: 20,
.isNormal ),
? Colors.white Column(
: Colors children: widget.mySelectedExamination
.black, .map((examination) {
//Colors.black, TextEditingController
fontWeight: remarksController =
FontWeight TextEditingController(
.bold, text: examination.remark);
),
), return Container(
), margin: EdgeInsets.only(
)), left: 15, right: 15, top: 15),
), child: Column(children: [
onTap: () { Row(
setState(() { mainAxisAlignment:
examination.isAbnormal = MainAxisAlignment
false; .spaceBetween,
examination.isNormal = children: [
true; Texts(
examination.notExamined = false; (examination
}); .selectedExamination
}), .nameEn)
SizedBox( .toUpperCase(),
width: 12, variant: "bodyText",
), bold: true,
InkWell( color: Colors.black)
child: Center( ],
child: Container( ),
height: SizedBox(
screenSize.height * height: 8,
0.070, ),
decoration: Row(
containerBorderDecoration( mainAxisAlignment:
examination MainAxisAlignment
.isAbnormal .spaceBetween,
? Color( children: [
0xFF515A5D) Row(
: Colors children: [
.white, InkWell(
Colors.black), child: Center(
child: Center( child: Container(
child: Padding( height: screenSize
padding: .height *
const EdgeInsets 0.070,
.all(8.0), decoration: containerBorderDecoration(
child: Text( examination
TranslationBase.of(context).abnormal, .isNormal
style: TextStyle( ? Color(
fontSize: 12, 0xFF515A5D)
color: : Colors
examination .white,
.isAbnormal Colors
? Colors.white .grey),
: Colors child: Center(
.black, child:
//Colors.black, Padding(
fontWeight: padding:
FontWeight const EdgeInsets.all(
.bold, 8.0),
), child: Text(
TranslationBase.of(
context)
.normal,
style:
TextStyle(
fontSize:
12,
color: examination.isNormal
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isAbnormal =
false;
examination
.isNormal =
true;
examination
.notExamined =
false;
});
}),
SizedBox(
width: 12,
), ),
), InkWell(
)), child: Center(
), child: Container(
onTap: () { height: screenSize
setState(() { .height *
examination.isNormal = 0.070,
false; decoration: containerBorderDecoration(
examination.isAbnormal = examination
true; .isAbnormal
examination.notExamined = false; ? Color(
}); 0xFF515A5D)
}),SizedBox( : Colors
width: 12, .white,
), Colors
InkWell( .black),
child: Center( child: Center(
child: Container( child:
height: Padding(
screenSize.height * padding:
0.070, const EdgeInsets.all(
decoration: 8.0),
containerBorderDecoration( child: Text(
examination TranslationBase.of(
.notExamined context)
? Color( .abnormal,
0xFF515A5D) style:
: Colors TextStyle(
.white, fontSize:
Colors.black), 12,
child: Center( color: examination.isAbnormal
child: Padding( ? Colors.white
padding: : Colors.black,
const EdgeInsets //Colors.black,
.all(8.0), fontWeight:
child: Text( FontWeight.bold,
"Not Examined", ),
style: TextStyle( ),
fontSize: 12, ),
color: )),
examination ),
.notExamined onTap: () {
? Colors.white setState(() {
: Colors examination
.black, .isNormal =
//Colors.black, false;
fontWeight: examination
FontWeight .isAbnormal =
.bold, true;
), examination
.notExamined =
false;
});
}),
SizedBox(
width: 12,
), ),
InkWell(
child: Center(
child: Container(
height: screenSize
.height *
0.070,
decoration: containerBorderDecoration(
examination
.notExamined
? Color(
0xFF515A5D)
: Colors
.white,
Colors
.black),
child: Center(
child:
Padding(
padding:
const EdgeInsets.all(
8.0),
child: Text(
"Not Examined",
style:
TextStyle(
fontSize:
12,
color: examination.notExamined
? Colors.white
: Colors.black,
//Colors.black,
fontWeight:
FontWeight.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination
.isAbnormal =
false;
examination
.isNormal =
false;
examination
.notExamined =
true;
});
}),
],
),
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
), ),
)), onTap: () => removeExamination(
), examination
onTap: () { .selectedExamination),
setState(() { )
examination.isAbnormal = ],
false; ),
examination.isNormal = SizedBox(
false; height: 20,
examination.notExamined = true; ),
}); Container(
}), margin: EdgeInsets.only(
], left: 0, right: 0, top: 15),
), child: TextFields(
InkWell( hasLabelText:
remarksController
child: Icon( .text !=
FontAwesomeIcons.trash, ''
color: Colors.grey, ? true
size: 20, : false,
), showLabelText: true,
onTap: () => removeExamination( hintText:
examination.selectedExamination), TranslationBase.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 4,
controller:
remarksController,
onChanged: (val) {
examination.remark = val;
},
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
]));
}).toList(),
) )
], ],
), )
SizedBox( ]),
height: 20, isExpand: isSysExaminationExpand,
), ),
Container( ],
margin: EdgeInsets.only( ),
left: 0, right: 0, top: 15), ),
child: TextFields( ),
hasLabelText: remarksController.text != ''?true:false, ),
showLabelText: true, ),
hintText: TranslationBase.of(context).remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 4,
controller: remarksController,
onChanged: (val) {
examination.remark = val;
},
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
]));
}).toList(),
)
],
)
]),
isExpand: isSysExaminationExpand,
), ),
DividerWithSpacesAround(height: 30,), ),
AppButton( Container(
title: TranslationBase.of(context).next, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
loading: model.state == ViewState.BusyLocal, child: Row(
onPressed: () async { children: [
await submitUpdateObjectivePage(model); Expanded(
}, child: AppButton(
title: TranslationBase.of(context).previous,
color: HexColor("#EAEAEA"),
fontColor: Colors.black,
onPressed: () {
widget.changePageViewIndex(0);
},
),
),
SizedBox(
width: 10,
), ),
SizedBox( Expanded(
height: 30, child: AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
color: HexColor("#A5A5A5"),
fontColor: HexColor("#5A5A5A"),
fontWeight: FontWeight.bold,
onPressed: () async {
await submitUpdateObjectivePage(model);
},
),
),
],
), ),
], ),
), ],
), )));
),
)));
} }
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (widget.mySelectedExamination.isNotEmpty) {
if(widget.mySelectedExamination.isNotEmpty){
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) { widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null) null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
ListHisProgNotePhysicalExaminationVM( .add(ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '', remarks: exam.remark ?? '',
createdBy: exam.createdBy??doctorProfile.doctorID, createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(), createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
@ -450,15 +544,20 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
isNormal: exam.isNormal, isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination, // masterDescription: exam.selectedExamination,
notExamined: exam.notExamined, notExamined: exam.notExamined,
examinationType: exam.isNormal?1:exam.isAbnormal?2:3, examinationType: exam.isNormal
examinationTypeName: exam.isNormal?"Normal":exam.isAbnormal?'AbNormal':"Not Examined", ? 1
isNew:exam.isNew : exam.isAbnormal
? 2
)); : 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew));
}); });
if(model.patientPhysicalExamList.isEmpty) { if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel); await model.postPhysicalExam(postPhysicalExamRequestModel);
} else { } else {
await model.patchPhysicalExam(postPhysicalExamRequestModel); await model.patchPhysicalExam(postPhysicalExamRequestModel);
@ -482,9 +581,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination Iterable<MySelectedExamination> history = widget.mySelectedExamination
.where( .where((element) =>
(element) => masterKey.id == element.selectedExamination.id &&
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0) if (history.length > 0)
@ -494,11 +592,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
openExaminationList(BuildContext context) { openExaminationList(BuildContext context) {
final screenSize = MediaQuery final screenSize = MediaQuery.of(context).size;
.of(context) InputDecoration textFieldSelectorDecoration(
.size; String hintText, String selectedText, bool isDropDown) {
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -533,7 +629,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
}, },
removeExamination: (masterKey) => removeExamination(masterKey),); removeExamination: (masterKey) => removeExamination(masterKey),
);
}); });
} }
} }
@ -541,10 +638,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
class AddExaminationDailog extends StatefulWidget { class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination; final Function addSelectedExamination;
final Function (MasterKeyModel) removeExamination; final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog( const AddExaminationDailog(
{Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) {Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key); : super(key: key);
@override @override
@ -559,71 +659,69 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup( await model
MasterKeysService.PhysicalExamination); .getMasterLookup(MasterKeysService.PhysicalExamination);
} }
}, },
builder: (_, model, w) => builder: (_, model, w) => AppScaffold(
AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: Center( body: Center(
child: Container( child: Container(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 16, height: 16,
), ),
AppText( AppText(
TranslationBase.of(context).physicalSystemExamination, TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
SizedBox( SizedBox(
height: 16, height: 16,
), ),
MasterKeyCheckboxSearchWidget( MasterKeyCheckboxSearchWidget(
model: model, model: model,
hintSearchText: TranslationBase.of(context).searchExamination, hintSearchText:
buttonName: TranslationBase.of(context).addExamination, TranslationBase.of(context).searchExamination,
masterList: model.physicalExaminationList, buttonName:
removeHistory: (history){ TranslationBase.of(context).addExamination,
setState(() { masterList: model.physicalExaminationList,
widget.removeExamination(history); removeHistory: (history) {
}); setState(() {
}, widget.removeExamination(history);
addHistory: (history){ });
setState(() { },
MySelectedExamination mySelectedExamination = new MySelectedExamination( addHistory: (history) {
selectedExamination: history setState(() {
); MySelectedExamination mySelectedExamination =
widget new MySelectedExamination(
.mySelectedExamination selectedExamination: history);
.add( widget.mySelectedExamination
mySelectedExamination); .add(mySelectedExamination);
}); });
}, },
addSelectedHistories: (){ addSelectedHistories: () {
widget.addSelectedExamination(); widget.addSelectedExamination();
}, },
isServiceSelected: (master) =>isServiceSelected(master), isServiceSelected: (master) =>
), isServiceSelected(master),
]), ),
))), ]),
))),
)), )),
); );
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
widget (element) =>
.mySelectedExamination masterKey.id == element.selectedExamination.id &&
.where((element) => masterKey.typeId == element.selectedExamination.typeId);
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) { if (exam.length > 0) {
return true; return true;
} }

Loading…
Cancel
Save