Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into patient_app_services

merge-requests/468/head
Mohammad Aljammal 5 years ago
commit d0f5217c7c

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -43,7 +43,7 @@ const Map<String, Map<String, String>> localizedValues = {
'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'}, 'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'},
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'}, 'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'االإحالة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'},
'inPatient': {'en': 'In Patient', 'ar': 'المريض الداخلي'}, 'inPatient': {'en': 'In Patient', 'ar': 'المريض الداخلي'},
'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
@ -51,7 +51,7 @@ const Map<String, Map<String, String>> localizedValues = {
'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'},
'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'},
'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'},
'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, 'myReferredPatient': {'en': 'Referred', 'ar': 'المحالين'},
'referredPatient': {'en': 'Referred Patient', 'ar': 'المرضى المحالين'}, 'referredPatient': {'en': 'Referred Patient', 'ar': 'المرضى المحالين'},
'referredOn': {'en': 'referred On : ', 'ar': ' : تمت الإحالة في'}, 'referredOn': {'en': 'referred On : ', 'ar': ' : تمت الإحالة في'},
'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'},

@ -119,7 +119,7 @@ class _LoginsreenState extends State<Loginsreen> {
children: <Widget>[ children: <Widget>[
AuthHeader(loginType.knownUser), AuthHeader(loginType.knownUser),
SizedBox( SizedBox(
height: 60, height: 40,
), ),
LoginForm( LoginForm(
changeLoadingStata: changeLoadingStata, changeLoadingStata: changeLoadingStata,

@ -8,10 +8,12 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; import 'package:doctor_app_flutter/models/SOAP/order-procedure.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/screens/patients/profile/UCAF/page-stepper-widget.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/util/helpers.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/PatientHeaderWidgetNoAvatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
@ -45,6 +47,9 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBarTitle: TranslationBase.of(context).ucaf, appBarTitle: TranslationBase.of(context).ucaf,
body: Column( body: Column(
children: [ children: [
@ -54,7 +59,32 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
PatientHeaderWidgetNoAvatar(patient), // PatientHeaderWidgetNoAvatar(patient),
Container(
margin: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).ucaf}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
),
),
PageStepperWidget(
stepsCount: 2,
currentStepIndex: 2,
screenSize: screenSize,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -80,48 +110,60 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
), ),
Container( Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16), margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: BorderedButton( child: Row(
TranslationBase.of(context).save, children: [
hasBorder: true, Expanded(
vPadding: 8, child: Container(
hPadding: 8, child: BorderedButton(
borderColor: HexColor("#B8382B"), TranslationBase.of(context).cancel,
backgroundColor: HexColor("#B8382B"), hasBorder: true,
textColor: Colors.white, vPadding: 8,
fontSize: SizeConfig.textMultiplier * 2.0, hPadding: 8,
handler: () async { borderColor: Colors.white,
await model.postUCAF(patient); backgroundColor: Colors.white,
if (model.state == ViewState.Idle) { textColor: HexColor("#B8382B"),
DrAppToastMsg.showSuccesToast( fontSize: SizeConfig.textMultiplier * 2.2,
TranslationBase.of(context).postUcafSuccessMsg); handler: () {
Navigator.of(context).popUntil((route) { Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE; return route.settings.name == PATIENTS_PROFILE;
}); });
} else { },
DrAppToastMsg.showErrorToast(model.error); ),
} ),
}, ),
), SizedBox(
), width: 8,
Container( ),
margin: EdgeInsets.only( Expanded(
left: 16, right: 16, top: 0.0, bottom: 8), child: Container(
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).save,
hasBorder: true, hasBorder: true,
vPadding: 8, vPadding: 8,
hPadding: 8, hPadding: 8,
borderColor: Colors.white, borderColor: HexColor("#B8382B"),
backgroundColor: Colors.white, backgroundColor: HexColor("#B8382B"),
textColor: HexColor("#B8382B"), textColor: Colors.white,
fontSize: SizeConfig.textMultiplier * 2.2, fontSize: SizeConfig.textMultiplier * 2.0,
handler: () { handler: () async {
Navigator.of(context).popUntil((route) { await model.postUCAF(patient);
return route.settings.name == PATIENTS_PROFILE; if (model.state == ViewState.Idle) {
}); DrAppToastMsg.showSuccesToast(
}, TranslationBase.of(context).postUcafSuccessMsg);
Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE;
});
} else {
DrAppToastMsg.showErrorToast(model.error);
}
},
),
),
),
],
), ),
), ),
], ],
), ),
)); ));

@ -366,7 +366,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.1, height: screenSize.height * 0.1,
hintText: TranslationBase.of(context).specifyPossibleLineManagement, hintText: TranslationBase.of(context)
.specifyPossibleLineManagement,
dropDownText: "None", dropDownText: "None",
enabled: false, enabled: false,
minLines: 4, minLines: 4,
@ -385,7 +386,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.1, height: screenSize.height * 0.1,
hintText: TranslationBase.of(context).backAbdomen, hintText:
TranslationBase.of(context).backAbdomen,
dropDownText: "BackLNeck", dropDownText: "BackLNeck",
enabled: false, enabled: false,
), ),
@ -403,7 +405,11 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
color: HexColor("#D02127"), color: HexColor("#D02127"),
onPressed: () { onPressed: () {
Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL,
arguments: {'patient': patient}); arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType
});
}, },
), ),
), ),

@ -13,7 +13,7 @@ class PageStepperWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double dividerWidth = (screenSize.width / stepsCount) - (10 * stepsCount); double dividerWidth = (screenSize.width / stepsCount) - (5 * stepsCount);
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0), margin: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0),
@ -68,8 +68,8 @@ class StepWidget extends StatelessWidget {
Container( Container(
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
margin: EdgeInsets.symmetric(horizontal: 1), margin: EdgeInsets.symmetric(horizontal: 1),
width: 25, width: 30,
height: 25, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isInProgress ? Color(0xFFCC9B14) : Color(0xFFC9C9C9), color: isInProgress ? Color(0xFFCC9B14) : Color(0xFFC9C9C9),
shape: BoxShape.circle, shape: BoxShape.circle,

@ -44,12 +44,12 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
child: Container( child: Container(
height: 60.0, height: 60.0,
// margin: EdgeInsets.only(top: 10.0), // margin: EdgeInsets.only(top: 10.0),
width: MediaQuery.of(context).size.width * 0.92, // 0.9, width: MediaQuery.of(context).size.width * 1, // 0.92,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: Theme.of(context).dividerColor, color: Theme.of(context).dividerColor,
width: 0.9), //width: 0.7 width: 1), //width: 0.7
), ),
color: Colors.white), color: Colors.white),
child: Center( child: Center(
@ -68,7 +68,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen>
width: MediaQuery.of(context).size.width * 0.30, width: MediaQuery.of(context).size.width * 0.30,
child: Center( child: Center(
child: child:
AppText(TranslationBase.of(context).myReferral), AppText(TranslationBase.of(context).referral),
), ),
), ),
Container( Container(

@ -69,231 +69,232 @@ class _LoginFormState extends State<LoginForm> {
return Form( return Form(
key: loginFormKey, key: loginFormKey,
child: Container( child: Column(
width: SizeConfig.realScreenWidth * 0.90, mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Column( children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, Container(
children: <Widget>[ width: SizeConfig.realScreenWidth * 0.90,
buildSizedBox(), height: SizeConfig.realScreenHeight * 0.65,
Padding( child:
child: AppText( Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
TranslationBase.of(context).enterCredentials, buildSizedBox(),
fontSize: 18, Padding(
fontWeight: FontWeight.bold, child: AppText(
), TranslationBase.of(context).enterCredentials,
padding: EdgeInsets.only(top: 10, bottom: 10)), fontSize: 18,
Container( fontWeight: FontWeight.bold,
decoration: BoxDecoration( ),
borderRadius: BorderRadius.all(Radius.circular(6.0)), padding: EdgeInsets.only(top: 10, bottom: 10)),
border: Border.all( Container(
width: 1.0, decoration: BoxDecoration(
color: HexColor("#CCCCCC"), borderRadius: BorderRadius.all(Radius.circular(6.0)),
), border: Border.all(
color: Colors.white), width: 1.0,
child: Column( color: HexColor("#CCCCCC"),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ color: Colors.white),
Padding( child: Column(
padding: EdgeInsets.only(left: 10, top: 10), crossAxisAlignment: CrossAxisAlignment.start,
child: AppText( children: [
TranslationBase.of(context).enterId, Padding(
fontWeight: FontWeight.w800, padding: EdgeInsets.only(left: 10, top: 10),
fontSize: 14, child: AppText(
)), TranslationBase.of(context).enterId,
AppTextFormField( fontWeight: FontWeight.w800,
labelText: '', fontSize: 14,
borderColor: Colors.white, )),
// keyboardType: TextInputType.number, AppTextFormField(
textInputAction: TextInputAction.next, labelText: '',
// decoration: buildInputDecoration( borderColor: Colors.white,
// context, // keyboardType: TextInputType.number,
// TranslationBase.of(context).enterId, textInputAction: TextInputAction.next,
// 'assets/images/user_id_icon.png'), // decoration: buildInputDecoration(
validator: (value) { // context,
if (value != null && value.isEmpty) { // TranslationBase.of(context).enterId,
return TranslationBase.of(context) // 'assets/images/user_id_icon.png'),
.pleaseEnterYourID; validator: (value) {
} if (value != null && value.isEmpty) {
return null; return TranslationBase.of(context)
}, .pleaseEnterYourID;
onSaved: (value) { }
if (value != null) userInfo.userID = value.trim(); return null;
}, },
onChanged: (value) { onSaved: (value) {
if (value != null) userInfo.userID = value.trim(); if (value != null) userInfo.userID = value.trim();
}, },
onFieldSubmitted: (_) { onChanged: (value) {
focusPass.nextFocus(); if (value != null) userInfo.userID = value.trim();
}, },
// onEditingComplete: () {}, onFieldSubmitted: (_) {
// autofocus: false, focusPass.nextFocus();
) },
])), // onEditingComplete: () {},
buildSizedBox(), // autofocus: false,
Container( )
decoration: BoxDecoration( ])),
borderRadius: BorderRadius.all(Radius.circular(6.0)), buildSizedBox(),
border: Border.all( Container(
width: 1.0, decoration: BoxDecoration(
color: HexColor("#CCCCCC"), borderRadius: BorderRadius.all(Radius.circular(6.0)),
), border: Border.all(
color: Colors.white), width: 1.0,
child: Column( color: HexColor("#CCCCCC"),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ color: Colors.white),
Padding( child: Column(
padding: EdgeInsets.only(left: 10, top: 10), crossAxisAlignment: CrossAxisAlignment.start,
child: AppText( children: [
TranslationBase.of(context).enterPassword, Padding(
fontWeight: FontWeight.w800, padding: EdgeInsets.only(left: 10, top: 10),
fontSize: 14, child: AppText(
)), TranslationBase.of(context).enterPassword,
AppTextFormField( fontWeight: FontWeight.w800,
focusNode: focusPass, fontSize: 14,
obscureText: true, )),
borderColor: Colors.white, AppTextFormField(
textInputAction: TextInputAction.next, focusNode: focusPass,
// decoration: buildInputDecoration( obscureText: true,
// context, borderColor: Colors.white,
// TranslationBase.of(context).enterPassword, textInputAction: TextInputAction.next,
// 'assets/images/password_icon.png'), // decoration: buildInputDecoration(
validator: (value) { // context,
if (value != null && value.isEmpty) { // TranslationBase.of(context).enterPassword,
return TranslationBase.of(context) // 'assets/images/password_icon.png'),
.pleaseEnterPassword; validator: (value) {
} if (value != null && value.isEmpty) {
return null; return TranslationBase.of(context)
}, .pleaseEnterPassword;
onSaved: (value) { }
userInfo.password = value; return null;
}, },
onFieldSubmitted: (_) { onSaved: (value) {
focusPass.nextFocus(); userInfo.password = value;
helpers.showCupertinoPicker(context, projectsList, },
'facilityName', onSelectProject); onFieldSubmitted: (_) {
}, focusPass.nextFocus();
onTap: () { helpers.showCupertinoPicker(context, projectsList,
this.getProjects(userInfo.userID); 'facilityName', onSelectProject);
}, },
) onTap: () {
])), this.getProjects(userInfo.userID);
buildSizedBox(), },
projectsList.length > 0 )
? Container( ])),
decoration: BoxDecoration( buildSizedBox(),
borderRadius: BorderRadius.all(Radius.circular(6.0)), projectsList.length > 0
border: Border.all( ? Container(
width: 1.0, decoration: BoxDecoration(
color: HexColor("#CCCCCC"), borderRadius: BorderRadius.all(Radius.circular(6.0)),
), border: Border.all(
color: Colors.white), width: 1.0,
child: Column( color: HexColor("#CCCCCC"),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ color: Colors.white),
Padding( child: Column(
padding: EdgeInsets.only(left: 10, top: 10), crossAxisAlignment: CrossAxisAlignment.start,
child: AppText( children: [
TranslationBase.of(context).selectYourProject, Padding(
fontWeight: FontWeight.w600, padding: EdgeInsets.only(left: 10, top: 10),
)), child: AppText(
AppTextFormField( TranslationBase.of(context).selectYourProject,
focusNode: focusProject, fontWeight: FontWeight.w600,
controller: projectIdController, )),
borderColor: Colors.white, AppTextFormField(
suffixIcon: Icons.arrow_drop_down, focusNode: focusProject,
onTap: () { controller: projectIdController,
helpers.showCupertinoPicker( borderColor: Colors.white,
context, suffixIcon: Icons.arrow_drop_down,
projectsList, onTap: () {
'facilityName', helpers.showCupertinoPicker(
onSelectProject); context,
}, projectsList,
// showCursor: false, 'facilityName',
// //readOnly: true, onSelectProject);
},
// showCursor: false,
// //readOnly: true,
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).selectYourProject,
// 'assets/images/password_icon.png'),
validator: (value) {
if (value != null && value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterYourProject;
}
return null;
})
]))
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).selectYourProject,
fontWeight: FontWeight.w800,
fontSize: 14,
)),
AppTextFormField(
readOnly: true, borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons.arrow_drop_down),
iconSize: 30,
padding: EdgeInsets.only(bottom: 30),
),
// decoration: buildInputDecoration( // decoration: buildInputDecoration(
// context, // context,
// TranslationBase.of(context).selectYourProject, // TranslationBase.of(context)
// 'assets/images/password_icon.png'), // .pleaseEnterYourProject,
validator: (value) { // 'assets/images/password_icon.png')
if (value != null && value.isEmpty) { )
return TranslationBase.of(context) ])),
.pleaseEnterYourProject; ]),
} ),
return null; Row(
}) mainAxisAlignment: MainAxisAlignment.end,
])) children: <Widget>[
: Container( Expanded(
decoration: BoxDecoration( child: Button(
borderRadius: BorderRadius.all(Radius.circular(6.0)), title: TranslationBase.of(context).login,
border: Border.all( color: HexColor('#D02127'),
width: 1.0, onTap: () {
color: HexColor("#CCCCCC"), login(context, authProv, widget.changeLoadingStata);
), },
color: Colors.white), )),
child: Column( ],
crossAxisAlignment: CrossAxisAlignment.start, )
children: [ // Row(
Padding( // mainAxisAlignment: MainAxisAlignment.end,
padding: EdgeInsets.only(left: 10, top: 10), // children: <Widget>[
child: AppText( // RaisedButton(
TranslationBase.of(context).selectYourProject, // onPressed: () {
fontWeight: FontWeight.w800, // login(context, authProv, widget.changeLoadingStata);
fontSize: 14, // },
)), // textColor: Colors.white,
AppTextFormField( // elevation: 0.0,
readOnly: true, borderColor: Colors.white, // padding: const EdgeInsets.all(0.0),
prefix: IconButton( // shape: RoundedRectangleBorder(
icon: Icon(Icons.arrow_drop_down), // borderRadius: BorderRadius.circular(10),
iconSize: 30, // side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
padding: EdgeInsets.only(bottom: 30), // child: Container(
), // padding: const EdgeInsets.all(10.0),
// height: 50,
// decoration: buildInputDecoration( // width: SizeConfig.realScreenWidth * 0.35,
// context, // child: ),
// TranslationBase.of(context) // )
// .pleaseEnterYourProject, // ],
// 'assets/images/password_icon.png') // ),
) ],
])),
SizedBox(
height: 100,
),
Row(
children: <Widget>[
Expanded(
child: Button(
title: TranslationBase.of(context).login,
color: Colors.red[700],
onTap: () {
login(context, authProv, widget.changeLoadingStata);
},
)),
],
)
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// RaisedButton(
// onPressed: () {
// login(context, authProv, widget.changeLoadingStata);
// },
// textColor: Colors.white,
// elevation: 0.0,
// padding: const EdgeInsets.all(0.0),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
// child: Container(
// padding: const EdgeInsets.all(10.0),
// height: 50,
// width: SizeConfig.realScreenWidth * 0.35,
// child: ),
// )
// ],
// ),
],
),
), ),
); );
} }

@ -60,20 +60,8 @@ class SMSOTP {
builder: (context) { builder: (context) {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return AlertDialog( return AlertDialog(
contentPadding: EdgeInsets.fromLTRB(24.0, 20.0, 0.0, 24.0), contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 0.0, 24.0),
title: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
IconButton(
icon: Icon(Icons.close),
onPressed: () {
this.isClosed = true;
Navigator.pop(context);
this.onFailure();
},
)
],
),
// shape: RoundedRectangleBorder( // shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.all(Radius.circular(10.0))), // borderRadius: BorderRadius.all(Radius.circular(10.0))),
content: StatefulBuilder(builder: (context, setState) { content: StatefulBuilder(builder: (context, setState) {
@ -89,21 +77,44 @@ class SMSOTP {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
type == 1 Padding(
? Padding( padding: EdgeInsets.all(10),
child: Icon( child: Row(
DoctorApp.verify_sms_1, mainAxisAlignment: MainAxisAlignment.spaceBetween,
size: 40, children: [
), type == 1
padding: EdgeInsets.only(bottom: 20), ? Padding(
) child: Icon(
: Padding( DoctorApp.verify_sms_1,
child: Icon( size: 40,
DoctorApp.verify_whtsapp, ),
size: 40, padding: EdgeInsets.only(bottom: 20),
), )
padding: EdgeInsets.only(bottom: 20), : Padding(
), child: Icon(
DoctorApp.verify_whtsapp,
size: 40,
),
padding: EdgeInsets.only(bottom: 20),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
left: 10, right: 10, bottom: 20),
child: IconButton(
icon: Icon(Icons.close),
iconSize: 40,
onPressed: () {
this.isClosed = true;
Navigator.pop(context);
this.onFailure();
},
))
],
)
])),
Padding( Padding(
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppText( child: AppText(

@ -282,48 +282,38 @@ class PatientReferralItemWidget extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
RichText( AppText(
text: new TextSpan( referralStatus != null ? referralStatus : "",
style: new TextStyle( fontFamily: 'Poppins',
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
color: Colors.black), fontWeight: FontWeight.w700,
children: <TextSpan>[ color: referralStatus != null
new TextSpan( ? referralStatus == 'Pending'
text: referralStatus != null ? Color(0xffc4aa54)
? referralStatus : referralStatus == 'Accepted'
: "", ? Colors.green[700]
style: TextStyle( : Colors.red[700]
color: referralStatus != null : Colors.grey[500],
? referralStatus == 'Pending'
? Color(0xffc4aa54)
: referralStatus == 'Accepted'
? Colors.green[700]
: Colors.red[700]
: Colors.grey[500],
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize:
2.0 * SizeConfig.textMultiplier)),
],
),
), ),
//TODO :ask backend to return in the standard format
AppText( AppText(
referredOn, referredOn,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.1 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,
color: Color(0XFF28353E),
) )
], ],
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
patientInfo.patientName, patientInfo.patientName,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backGroundcolor: Colors.white, backGroundcolor: Colors.white,
color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
), ),
@ -339,64 +329,68 @@ class PatientReferralItemWidget extends StatelessWidget {
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
SizedBox(
width: 4,
),
AppText(
referredOn,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
)
], ],
), ),
SizedBox(
width: 10,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Column( Expanded(
children: [ child: Column(
RichText( children: [
text: new TextSpan( Row(
style: new TextStyle( mainAxisAlignment: MainAxisAlignment.start,
fontSize: 2.0 * SizeConfig.textMultiplier, children: [
color: Colors.black), AppText(
children: <TextSpan>[ TranslationBase.of(context).fileNumber,
new TextSpan( fontFamily: 'Poppins',
text: TranslationBase.of(context) fontWeight: FontWeight.w600,
.fileNumber, fontSize: 1.7 * SizeConfig.textMultiplier,
style: TextStyle( color: Color(0XFF575757),
fontSize: 14, fontFamily: 'Poppins')), ),
new TextSpan( AppText(
text: patientInfo.patientID.toString(), patientInfo.patientID.toString(),
style: TextStyle( fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 15)), color: Color(0XFF2E303A),
),
], ],
), ),
), Row(
Container( mainAxisAlignment: MainAxisAlignment.start,
child: RichText( children: [
text: new TextSpan( AppText(
style: new TextStyle( TranslationBase.of(context).referredFrom,
fontSize: 2.0 * SizeConfig.textMultiplier, fontFamily: 'Poppins',
color: Colors.black), fontWeight: FontWeight.w600,
children: <TextSpan>[ fontSize: 1.7 * SizeConfig.textMultiplier,
new TextSpan( color: Color(0XFF575757),
text: TranslationBase.of(context) ),
.referredFrom, AppText(
style: TextStyle( isSameBranch
fontSize: 14, ? TranslationBase.of(context).sameBranch
fontFamily: 'Poppins')), : TranslationBase.of(context)
new TextSpan( .otherBranch,
text: isSameBranch fontFamily: 'Poppins',
? TranslationBase.of(context) fontWeight: FontWeight.w700,
.sameBranch fontSize: 1.8 * SizeConfig.textMultiplier,
: TranslationBase.of(context) color: Color(0XFF2E303A),
.otherBranch, ),
style: TextStyle( ],
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
],
),
), ),
), ],
], ),
), ),
Row( Row(
children: [ children: [
@ -405,7 +399,8 @@ class PatientReferralItemWidget extends StatelessWidget {
patient.nationality*/ patient.nationality*/
"Saudi", "Saudi",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, color: Color(0xFF2E303A),
fontSize: 1.4 * SizeConfig.textMultiplier,
), ),
/* patient.nationality != null /* patient.nationality != null
? ClipRRect( ? ClipRRect(
@ -434,48 +429,68 @@ class PatientReferralItemWidget extends StatelessWidget {
) )
], ],
), ),
Container( Row(
child: RichText( mainAxisAlignment: MainAxisAlignment.start,
text: new TextSpan( crossAxisAlignment: CrossAxisAlignment.start,
style: new TextStyle( children: [
fontSize: 2.0 * SizeConfig.textMultiplier, AppText(
color: Colors.black), TranslationBase.of(context).remarks + " : ",
children: <TextSpan>[ fontFamily: 'Poppins',
new TextSpan( fontWeight: FontWeight.w600,
text: fontSize: 1.7 * SizeConfig.textMultiplier,
TranslationBase.of(context).remarks + " : ", color: Color(0XFF575757),
style: TextStyle( ),
fontSize: 14, fontFamily: 'Poppins')), Expanded(
new TextSpan( child: AppText(
text: patientInfo.remarksFromSource, patientInfo.remarksFromSource,
style: TextStyle( fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 15)), color: Color(0XFF2E303A),
], ),
), ),
), ],
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: 30, width: 2,
height: 30, height: 30,
margin: EdgeInsets.only( color: Color(0xFFD9D9D9),
left:
projectViewModel.isArabic ? 10 : 10 /*10:85*/, /*
right: decoration: BoxDecoration(
projectViewModel.isArabic ? 10 : 10 /*85:10*/,
top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.grey[400], width: 2.5), color: Color(0xFFD9D9D9), width: 2.5),
left: BorderSide( left: BorderSide(
color: Colors.grey[400], width: 2.5), color: Color(0xFFD9D9D9), width: 2.5),
)), )),
*/
),
Container(
margin: EdgeInsets.only(
left: 0, top: 20, right: 0, bottom: 0),
child: Icon(
Icons.arrow_forward,
color: Color(0xFFD9D9D9),
size: 30,
),
),
Container(
margin: EdgeInsets.only(
left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: Container(
width: 40,
height: 40,
child: Image.asset(
'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
), ),
Expanded( Expanded(
flex: 4, flex: 4,

@ -1,5 +1,4 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/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/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
@ -10,12 +9,14 @@ 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/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-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.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:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -120,17 +121,20 @@ class _AddMedicationState extends State<AddMedication> {
String hintText, String selectedText, bool isDropDown, String hintText, String selectedText, bool isDropDown,
{IconData icon}) { {IconData icon}) {
return InputDecoration( return InputDecoration(
filled: true,
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0), borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0), borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0), borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
hintText: selectedText != null ? selectedText : hintText, hintText: selectedText != null ? selectedText : hintText,
@ -152,7 +156,6 @@ class _AddMedicationState extends State<AddMedication> {
.of(context) .of(context)
.size; .size;
return FractionallySizedBox( return FractionallySizedBox(
heightFactor: 0.7,
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.medicationStrengthList.length == 0) { if (model.medicationStrengthList.length == 0) {
@ -172,388 +175,402 @@ class _AddMedicationState extends State<AddMedication> {
}, },
builder: (_, model, w) => builder: (_, model, w) =>
AppScaffold( AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: Center(
child: Center( child: Container(
child: FractionallySizedBox( child: Column(
widthFactor: 0.9, crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Container(
padding:
EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
height: 115,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10),
margin: EdgeInsets.only(top: 40),
child: Column(
children: [ children: [
Row(
SizedBox( mainAxisAlignment: MainAxisAlignment.spaceBetween,
height: 16, children: [
), RichText(
AppText( text: TextSpan(
TranslationBase style: TextStyle(
.of(context) fontSize: 20, color: Colors.black),
.addMedication, children: <TextSpan>[
fontWeight: FontWeight.bold, new TextSpan(
fontSize: 16, text: TranslationBase.of(context)
), .addMedication,
SizedBox( style: TextStyle(
height: 16, color: Color(0xFF2B353E),
), fontWeight: FontWeight.bold,
Container( fontFamily: 'Poppins',
height: screenSize.height * 0.070, fontSize: 20)),
child: InkWell( ],
onTap: model.allMedicationList != null ),
? () {
setState(() {
_selectedMedication = null;
});
}
: null,
child: _selectedMedication == null
? AutoCompleteTextField<
GetMedicationResponseModel>(
decoration: textFieldSelectorDecoration(
TranslationBase
.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication.genericName
: null,
true,
icon: EvaIcons.search),
itemSubmitted: (item) =>
setState(
() => _selectedMedication = item),
key: key,
suggestions: model.allMedicationList,
itemBuilder: (context, suggestion) =>
new Padding(
child: Texts(
suggestion.description + '/' +
suggestion.genericName),
padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.genericName
.toLowerCase()
.startsWith(input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(input.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(input.toLowerCase()),
)
: TextField(
minLines: 2,
maxLines: 2,
decoration: textFieldSelectorDecoration(
TranslationBase
.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication.description +
(' (${_selectedMedication
.genericName} )')
: null,
true,
icon: EvaIcons.search),
enabled: false,
), ),
), InkWell(
), onTap: () {
if(isFormSubmitted && _selectedMedication == null) Navigator.pop(context);
CustomValidationError(),
SizedBox(
height: 5,
),
TextFields(
onTapTextFields: model.medicationDoseTimeList !=
null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.medicationDoseTimeList,
okText: TranslationBase
.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationDose =
selectedValue;
doseController.text =
projectViewModel.isArabic
? _selectedMedicationDose
.nameAr
: _selectedMedicationDose
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hasLabelText: doseController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.doseTime,
//TODO add translation
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: doseController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
SizedBox(
height: 5,
),
if(isFormSubmitted &&
_selectedMedicationDose == null)
CustomValidationError(), SizedBox(
height: 5,
),
TextFields(
onTapTextFields: model
.medicationStrengthList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.medicationStrengthList,
okText: TranslationBase
.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationStrength =
selectedValue;
strengthController.text =
projectViewModel.isArabic
? _selectedMedicationStrength
.nameAr
: _selectedMedicationStrength
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
}, },
); child: Icon(FontAwesomeIcons.times,
} size: 30, color: Color(0xFF2B353E)))
: null, ],
hasLabelText: strengthController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.strength,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: strengthController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}), SizedBox(
height: 5,
), ),
if(isFormSubmitted && ],
_selectedMedicationStrength == null) ),
CustomValidationError(), ),
),
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
SizedBox(
height: 16,
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allMedicationList != null
? () {
setState(() {
_selectedMedication = null;
});
}
: null,
child: _selectedMedication == null
? AutoCompleteTextField<
GetMedicationResponseModel>(
decoration:
textFieldSelectorDecoration(
SizedBox( TranslationBase.of(context)
height: 5, .searchMedicineNameHere,
), _selectedMedication != null
? _selectedMedication
.genericName
: null,
true,
icon: EvaIcons.search),
itemSubmitted: (item) => setState(
() =>
_selectedMedication = item),
key: key,
suggestions:
model.allMedicationList,
itemBuilder: (context,
suggestion) =>
new Padding(
child: Texts(suggestion
.description +
'/' +
suggestion.genericName),
padding:
EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.genericName
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(
input.toLowerCase()),
)
: AppTextFieldCustom(
hintText: _selectedMedication != null
? _selectedMedication
.description +
(' (${_selectedMedication.genericName} )')
: TranslationBase.of(context)
.searchMedicineNameHere,
minLines: 2,
maxLines: 2,
enabled: false,
),
),
),
if (isFormSubmitted &&
_selectedMedication == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
enabled: false,
onClick: model.medicationDoseTimeList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationDoseTimeList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationDose =
selectedValue;
TextFields( doseController
onTapTextFields: model .text = projectViewModel
.medicationRouteList != null .isArabic
? () { ? _selectedMedicationDose
MasterKeyDailog dialog = MasterKeyDailog( .nameAr
list: model.medicationRouteList, : _selectedMedicationDose
okText: TranslationBase .nameEn;
.of(context) });
.ok, },
okFunction: (selectedValue) { );
setState(() { showDialog(
_selectedMedicationRoute = barrierDismissible: false,
selectedValue; context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).doseTime,
//TODO add translation
maxLines: 2,
minLines: 2,
isDropDown: true,
controller: doseController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationDose == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom(
enabled: false,
isDropDown: true,
onClick: model.medicationStrengthList != null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: model.medicationStrengthList,
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationStrength =
selectedValue;
routeController.text = strengthController
projectViewModel.isArabic .text = projectViewModel
? _selectedMedicationRoute .isArabic
.nameAr ? _selectedMedicationStrength
: _selectedMedicationRoute .nameAr
.nameEn; : _selectedMedicationStrength
}); .nameEn;
}, });
); },
showDialog( );
barrierDismissible: false, showDialog(
context: context, barrierDismissible: false,
builder: (BuildContext context) { context: context,
return dialog; builder: (BuildContext context) {
}, return dialog;
); },
} );
: null, }
hasLabelText: routeController.text != : null,
'' ? true : false, hintText:
showLabelText: true, TranslationBase.of(context).strength,
hintText: TranslationBase // hintColor: Colors.black,
.of(context) // fontWeight: FontWeight.w600,
.route, maxLines: 2,
fontSize: 13.5, minLines: 2,
readOnly: true, controller: strengthController,
// hintColor: Colors.black, ),
fontWeight: FontWeight.w600, SizedBox(
maxLines: 2, height: 5,
minLines: 1, ),
controller: routeController, if (isFormSubmitted &&
validator: (value) { _selectedMedicationStrength == null)
if (value == null) CustomValidationError(),
return TranslationBase SizedBox(
.of(context) height: 5,
.emptyMessage; ),
else AppTextFieldCustom(
return null; enabled: false,
}), isDropDown: true,
SizedBox( onClick: model.medicationRouteList != null
height: 5, ? () {
), MasterKeyDailog dialog =
if(isFormSubmitted && MasterKeyDailog(
_selectedMedicationRoute == null) list: model.medicationRouteList,
CustomValidationError(), okText:
SizedBox( TranslationBase.of(context).ok,
height: 5, okFunction: (selectedValue) {
), setState(() {
TextFields( _selectedMedicationRoute =
onTapTextFields: model selectedValue;
.medicationFrequencyList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.medicationFrequencyList,
okText: TranslationBase
.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedMedicationFrequency =
selectedValue;
frequencyController.text = routeController
projectViewModel.isArabic .text = projectViewModel
? _selectedMedicationFrequency .isArabic
.nameAr ? _selectedMedicationRoute
: _selectedMedicationFrequency .nameAr
.nameEn; : _selectedMedicationRoute
}); .nameEn;
}, });
); },
showDialog( );
barrierDismissible: false, showDialog(
context: context, barrierDismissible: false,
builder: (BuildContext context) { context: context,
return dialog; builder: (BuildContext context) {
}, return dialog;
); },
} );
: null, }
hasLabelText: frequencyController.text != : null,
'' ? true : false, hintText: TranslationBase.of(context).route,
showLabelText: true, maxLines: 2,
hintText: TranslationBase minLines: 2,
.of(context) controller: routeController,
.frequency, ),
//TODO add translation SizedBox(
fontSize: 13.5, height: 5,
readOnly: true, ),
// hintColor: Colors.black, if (isFormSubmitted &&
fontWeight: FontWeight.w600, _selectedMedicationRoute == null)
maxLines: 2, CustomValidationError(),
minLines: 1, SizedBox(
controller: frequencyController, height: 5,
validator: (value) { ),
if (value == null) AppTextFieldCustom(
return TranslationBase onClick: model.medicationFrequencyList != null
.of(context) ? () {
.emptyMessage; MasterKeyDailog dialog =
else MasterKeyDailog(
return null; list: model.medicationFrequencyList,
}), okText:
SizedBox( TranslationBase.of(context).ok,
height: 5, okFunction: (selectedValue) {
), setState(() {
if(isFormSubmitted && _selectedMedicationFrequency =
_selectedMedicationFrequency == null) selectedValue;
CustomValidationError(),
SizedBox(
height: 30,
),
AppButton(
title: TranslationBase
.of(context)
.add
.toUpperCase(),
onPressed: () {
setState(() {
isFormSubmitted = true;
});
if (_selectedMedication != null &&
_selectedMedicationDose !=
null &&
_selectedMedicationStrength != null &&
_selectedMedicationRoute != null &&
_selectedMedicationFrequency != null) {
widget.medicationController.text =
widget.medicationController.text +
'${_selectedMedication
.description } (${TranslationBase
.of(context)
.doseTime} ) ${doseController
.text} (${TranslationBase
.of(context)
.strength}) ${strengthController
.text} (${TranslationBase
.of(context)
.route }) ${routeController
.text} (${TranslationBase
.of(context)
.frequency }) ${frequencyController
.text} \n \n';
Navigator.of(context).pop();
}
},
),
]
frequencyController
.text = projectViewModel
.isArabic
? _selectedMedicationFrequency
.nameAr
: _selectedMedicationFrequency
.nameEn;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText:
TranslationBase.of(context).frequency,
//TODO add translation
enabled: false,
// hintColor: Colors.black,
maxLines: 2,
minLines: 2,
isDropDown: true,
controller: frequencyController,
),
SizedBox(
height: 5,
),
if (isFormSubmitted &&
_selectedMedicationFrequency == null)
CustomValidationError(),
SizedBox(
height: 30,
),
],
)),
),
),
]),
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: HexColor('#707070'), width: 0.30),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context).addMedication.toUpperCase(),
color: Color(0xFF359846),
onPressed: () {
setState(() {
isFormSubmitted = true;
});
if (_selectedMedication != null &&
_selectedMedicationDose != null &&
_selectedMedicationStrength != null &&
_selectedMedicationRoute != null &&
_selectedMedicationFrequency != null) {
widget.medicationController.text = widget
.medicationController.text +
'${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
Navigator.of(context).pop();
}
},
), ),
), ),
), ),
),), ),
SizedBox(
height: 5,
),
],
),
),
),
), ),
); );
} }

@ -640,7 +640,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
{IconData icon}) { {IconData icon}) {
return InputDecoration( return InputDecoration(
fillColor: Colors.white, fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -763,6 +764,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
.mySelectedAssessment.selectedICD == .mySelectedAssessment.selectedICD ==
null null
? AutoCompleteTextField<MasterKeyModel>( ? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.nameOrICD, .nameOrICD,

Loading…
Cancel
Save