|
|
|
@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
|
|
|
|
@ -50,16 +51,21 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
patient = routeArgs['patient'];
|
|
|
|
|
|
|
|
|
|
referToList = List();
|
|
|
|
|
dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch};
|
|
|
|
|
dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch};
|
|
|
|
|
dynamic sameBranch = {
|
|
|
|
|
"id": 1,
|
|
|
|
|
"name": TranslationBase.of(context).sameBranch
|
|
|
|
|
};
|
|
|
|
|
dynamic otherBranch = {
|
|
|
|
|
"id": 2,
|
|
|
|
|
"name": TranslationBase.of(context).otherBranch
|
|
|
|
|
};
|
|
|
|
|
referToList.add(sameBranch);
|
|
|
|
|
referToList.add(otherBranch);
|
|
|
|
|
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
|
|
|
|
|
return BaseView<PatientReferralViewModel>(
|
|
|
|
|
onModelReady: (model) =>
|
|
|
|
|
model.getMasterLookup(MasterKeysService.physiotherapyGoals),
|
|
|
|
|
onModelReady: (model) => model.getPatientReferral(patient),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).referPatient,
|
|
|
|
@ -86,279 +92,50 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).referPatient,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: referToList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: referToList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_referTo = selectedValue;
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
_selectedClinic = null;
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
model
|
|
|
|
|
.getDoctorBranch()
|
|
|
|
|
.then((value) {
|
|
|
|
|
_selectedBranch = value;
|
|
|
|
|
if (_referTo['id'] == 1) {
|
|
|
|
|
model.getClinics(
|
|
|
|
|
_selectedBranch['ID']);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).referTo,
|
|
|
|
|
_referTo != null ? _referTo['name'] : null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.branchesList != null &&
|
|
|
|
|
model.branchesList.length > 0 &&
|
|
|
|
|
_referTo != null &&
|
|
|
|
|
_referTo['id'] == 2
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: model.branchesList,
|
|
|
|
|
attributeName: 'Desciption',
|
|
|
|
|
attributeValueId: 'ID',
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedBranch = selectedValue;
|
|
|
|
|
_selectedClinic = null;
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
model.getClinics(
|
|
|
|
|
_selectedBranch['ID']);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).branch,
|
|
|
|
|
_selectedBranch != null
|
|
|
|
|
? _selectedBranch['Desciption']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: _selectedBranch != null &&
|
|
|
|
|
model.clinicsList != null &&
|
|
|
|
|
model.clinicsList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: model.clinicsList,
|
|
|
|
|
attributeName: 'ClinicDescription',
|
|
|
|
|
attributeValueId: 'ClinicID',
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
_selectedClinic = selectedValue;
|
|
|
|
|
model.getClinicDoctors(
|
|
|
|
|
_selectedClinic['ClinicID']
|
|
|
|
|
.toString());
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).clinic,
|
|
|
|
|
_selectedClinic != null
|
|
|
|
|
? _selectedClinic['ClinicDescription']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: _selectedClinic != null &&
|
|
|
|
|
model.doctorsList != null &&
|
|
|
|
|
model.doctorsList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: model.doctorsList,
|
|
|
|
|
attributeName: 'DoctorName',
|
|
|
|
|
attributeValueId: 'DoctorID',
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedDoctor = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).doctor,
|
|
|
|
|
_selectedDoctor != null
|
|
|
|
|
? _selectedDoctor['DoctorName']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () => _selectDate(context, model),
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.chooseAppointment,
|
|
|
|
|
appointmentDate != null
|
|
|
|
|
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
Icons.calendar_today,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
)),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).remarks,
|
|
|
|
|
null,
|
|
|
|
|
false),
|
|
|
|
|
enabled: true,
|
|
|
|
|
controller: _remarksController,
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
FilteringTextInputFormatter.allow(
|
|
|
|
|
RegExp(ONLY_LETTERS))
|
|
|
|
|
],
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
minLines: 4,
|
|
|
|
|
maxLines: 6,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
model.patientReferral.length == 0
|
|
|
|
|
? ReferralForm(model, screenSize)
|
|
|
|
|
: PatientReferralItemWidget(
|
|
|
|
|
patientName: model.patientReferral[0].patientName,
|
|
|
|
|
referralStatus: "${model.patientReferral[0].referralStatus}",
|
|
|
|
|
isReferredTo: true,
|
|
|
|
|
isSameBranch: model.patientReferral[0]
|
|
|
|
|
.isReferralDoctorSameBranch,
|
|
|
|
|
referralDoctorName:
|
|
|
|
|
model.patientReferral[0].referredByDoctorInfo,
|
|
|
|
|
clinicDescription: null,
|
|
|
|
|
remark:
|
|
|
|
|
model.patientReferral[0].remarksFromSource
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: TranslationBase.of(context).refer,
|
|
|
|
|
color: HexColor("#B8382B"),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (appointmentDate == null ||
|
|
|
|
|
_selectedBranch == null ||
|
|
|
|
|
_selectedClinic == null ||
|
|
|
|
|
_selectedDoctor == null ||
|
|
|
|
|
_remarksController.text == null) return;
|
|
|
|
|
model
|
|
|
|
|
.makeReferral(
|
|
|
|
|
patient,
|
|
|
|
|
appointmentDate.toIso8601String(),
|
|
|
|
|
_selectedBranch['ID'],
|
|
|
|
|
_selectedClinic['ClinicID'],
|
|
|
|
|
_selectedDoctor['DoctorID'],
|
|
|
|
|
_remarksController.text)
|
|
|
|
|
.then((_) {
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
TranslationBase.of(context).referralSuccessMsg);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
if (model.patientReferral.length == 0)
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: TranslationBase.of(context).refer,
|
|
|
|
|
color: HexColor("#B8382B"),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (appointmentDate == null ||
|
|
|
|
|
_selectedBranch == null ||
|
|
|
|
|
_selectedClinic == null ||
|
|
|
|
|
_selectedDoctor == null ||
|
|
|
|
|
_remarksController.text == null) return;
|
|
|
|
|
model
|
|
|
|
|
.makeReferral(
|
|
|
|
|
patient,
|
|
|
|
|
appointmentDate.toIso8601String(),
|
|
|
|
|
_selectedBranch['ID'],
|
|
|
|
|
_selectedClinic['ClinicID'],
|
|
|
|
|
_selectedDoctor['DoctorID'],
|
|
|
|
|
_remarksController.text)
|
|
|
|
|
.then((_) {
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
TranslationBase.of(context).referralSuccessMsg);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -367,6 +144,239 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget ReferralForm(PatientReferralViewModel model, Size screenSize) {
|
|
|
|
|
return Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).referPatient,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: referToList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog = ListSelectDialog(
|
|
|
|
|
list: referToList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_referTo = selectedValue;
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
_selectedClinic = null;
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
model.getDoctorBranch().then((value) {
|
|
|
|
|
_selectedBranch = value;
|
|
|
|
|
if (_referTo['id'] == 1) {
|
|
|
|
|
model.getClinics(_selectedBranch['ID']);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).referTo,
|
|
|
|
|
_referTo != null ? _referTo['name'] : null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.branchesList != null &&
|
|
|
|
|
model.branchesList.length > 0 &&
|
|
|
|
|
_referTo != null &&
|
|
|
|
|
_referTo['id'] == 2
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog = ListSelectDialog(
|
|
|
|
|
list: model.branchesList,
|
|
|
|
|
attributeName: 'Desciption',
|
|
|
|
|
attributeValueId: 'ID',
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedBranch = selectedValue;
|
|
|
|
|
_selectedClinic = null;
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
model.getClinics(_selectedBranch['ID']);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).branch,
|
|
|
|
|
_selectedBranch != null
|
|
|
|
|
? _selectedBranch['Desciption']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: _selectedBranch != null &&
|
|
|
|
|
model.clinicsList != null &&
|
|
|
|
|
model.clinicsList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog = ListSelectDialog(
|
|
|
|
|
list: model.clinicsList,
|
|
|
|
|
attributeName: 'ClinicDescription',
|
|
|
|
|
attributeValueId: 'ClinicID',
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
_selectedClinic = selectedValue;
|
|
|
|
|
model.getClinicDoctors(
|
|
|
|
|
_selectedClinic['ClinicID'].toString());
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).clinic,
|
|
|
|
|
_selectedClinic != null
|
|
|
|
|
? _selectedClinic['ClinicDescription']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: _selectedClinic != null &&
|
|
|
|
|
model.doctorsList != null &&
|
|
|
|
|
model.doctorsList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog = ListSelectDialog(
|
|
|
|
|
list: model.doctorsList,
|
|
|
|
|
attributeName: 'DoctorName',
|
|
|
|
|
attributeValueId: 'DoctorID',
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedDoctor = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).doctor,
|
|
|
|
|
_selectedDoctor != null
|
|
|
|
|
? _selectedDoctor['DoctorName']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () => _selectDate(context, model),
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).chooseAppointment,
|
|
|
|
|
appointmentDate != null
|
|
|
|
|
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
Icons.calendar_today,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
)),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).remarks, null, false),
|
|
|
|
|
enabled: true,
|
|
|
|
|
controller: _remarksController,
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))
|
|
|
|
|
],
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
minLines: 4,
|
|
|
|
|
maxLines: 6,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_selectDate(BuildContext context, PatientReferralViewModel model) async {
|
|
|
|
|
// https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference
|
|
|
|
|
// https://stackoverflow.com/a/63147062/6246772 to customize a date picker
|
|
|
|
|