Merge branches 'SOAP' and 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into SOAP

 Conflicts:
	lib/config/localized_values.dart
pull/190/head
Elham Rababah 4 years ago
commit 518c30bdeb

@ -201,6 +201,7 @@ const Map<String, Map<String, String>> localizedValues = {
'routine': {'en': 'Routine', 'ar': 'روتيني'}, 'routine': {'en': 'Routine', 'ar': 'روتيني'},
'send': {'en': 'Send', 'ar': 'ارسال'}, 'send': {'en': 'Send', 'ar': 'ارسال'},
'referralFrequency': {'en': 'Referral Frequency:', 'ar': 'تواتر الحالة:'}, 'referralFrequency': {'en': 'Referral Frequency:', 'ar': 'تواتر الحالة:'},
'selectReferralFrequency': {'en': 'Select Referral Frequency:', 'ar': 'اختار تواتر الحالة:'},
'clinicalDetailsAndRemarks': { 'clinicalDetailsAndRemarks': {
'en': 'Clinical Details and Remarks', 'en': 'Clinical Details and Remarks',
'ar': 'التفاصيل السرسرية والملاحظات' 'ar': 'التفاصيل السرسرية والملاحظات'
@ -229,6 +230,7 @@ const Map<String, Map<String, String>> localizedValues = {
'beingBad': {'en': 'being bad', 'ar': 'سيء'}, 'beingBad': {'en': 'being bad', 'ar': 'سيء'},
'beingGreat': {'en': 'being great', 'ar': 'رائع'}, 'beingGreat': {'en': 'being great', 'ar': 'رائع'},
'cancel': {'en': 'CANCEL', 'ar': 'الغاء'}, 'cancel': {'en': 'CANCEL', 'ar': 'الغاء'},
'ok': {'en': 'OK', 'ar': 'موافق'},
'done': {'en': 'DONE', 'ar': 'تأكيد'}, 'done': {'en': 'DONE', 'ar': 'تأكيد'},
'resumecall': {'en': 'Resume call', 'ar': 'استئناف المكالمة'}, 'resumecall': {'en': 'Resume call', 'ar': 'استئناف المكالمة'},
'endcallwithcharge': {'en': 'End with charge', 'ar': 'ينتهي مع الشحن'}, 'endcallwithcharge': {'en': 'End with charge', 'ar': 'ينتهي مع الشحن'},
@ -275,4 +277,6 @@ const Map<String, Map<String, String>> localizedValues = {
'bed': {'en': 'BED:', 'ar': 'السرير'}, 'bed': {'en': 'BED:', 'ar': 'السرير'},
'next': {'en': 'Next', 'ar': 'التالي'}, 'next': {'en': 'Next', 'ar': 'التالي'},
'healthRecordInformation': {'en': 'HEALTH RECORD INFORMATION', 'ar': 'معلومات السجل الصحي'}, 'healthRecordInformation': {'en': 'HEALTH RECORD INFORMATION', 'ar': 'معلومات السجل الصحي'},
'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'},
'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'},
}; };

@ -42,10 +42,10 @@ class PatientViewModel extends BaseViewModel {
get patientProgressNoteList => _patientService.patientProgressNoteList; get patientProgressNoteList => _patientService.patientProgressNoteList;
get clinicsList => _patientService.clinicsList; List<dynamic> get clinicsList => _patientService.clinicsList;
get doctorsList => _patientService.doctorsList; List<dynamic> get doctorsList => _patientService.doctorsList;
List<dynamic> get referralFrequencyList => _patientService.referalFrequancyList;
get referalFrequancyList => _patientService.referalFrequancyList;
Future getPatientList(PatientModel patient, patientType, Future getPatientList(PatientModel patient, patientType,
{bool isBusyLocal = false}) async { {bool isBusyLocal = false}) async {
if(isBusyLocal) { if(isBusyLocal) {
@ -167,6 +167,7 @@ class PatientViewModel extends BaseViewModel {
} }
} }
} }
Future getDoctorsList(String clinicId) async { Future getDoctorsList(String clinicId) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _patientService.getDoctorsList(clinicId); await _patientService.getDoctorsList(clinicId);

@ -6,9 +6,11 @@ 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/util/translations_delegate_base.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_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -34,26 +36,18 @@ class ReferPatientScreen extends StatefulWidget {
} }
class _ReferPatientState extends State<ReferPatientScreen> { class _ReferPatientState extends State<ReferPatientScreen> {
var doctorsList; dynamic _selectedClinic;
final _remarksController = TextEditingController(); dynamic _selectedDoctor;
final _extController = TextEditingController(); final _extController = TextEditingController();
var _isInit = true;
bool isValid;
var clinicId;
var doctorId;
var freqId;
String _selectedClinic;
String _selectedDoctor;
String _selectedReferralFrequancy;
int _activePriority = 1; int _activePriority = 1;
dynamic _selectedFrequency;
FocusNode myFocusNode = FocusNode(); final _remarksController = TextEditingController();
bool isValid;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -62,399 +56,255 @@ class _ReferPatientState extends State<ReferPatientScreen> {
body: model.clinicsList == null body: model.clinicsList == null
? DrAppEmbeddedError(error: 'Something Wrong!') ? DrAppEmbeddedError(error: 'Something Wrong!')
: SingleChildScrollView( : SingleChildScrollView(
child: Column( child: Container(
mainAxisAlignment: MainAxisAlignment.start, margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.start,
AppText( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).clinic, children: <Widget>[
fontSize: 18, Container(
fontWeight: FontWeight.bold, height: screenSize.height * 0.070,
marginLeft: 15, child: InkWell(
marginTop: 15, onTap: model.clinicsList != null &&
), model.clinicsList.length > 0
RoundedContainer( ? () {
margin: 10, ListSelectDialog dialog = ListSelectDialog(
showBorder: true, list: model.clinicsList,
raduis: 30, attributeName: 'ClinicDescription',
borderColor: Color(0xff707070), attributeValueId: 'ClinicID',
width: double.infinity, okText: TranslationBase.of(context).ok,
child: Padding( okFunction: (selectedValue) {
padding: EdgeInsets.only( setState(() {
top: SizeConfig.widthMultiplier * 0.9, _selectedDoctor = null;
bottom: SizeConfig.widthMultiplier * 0.9, _selectedClinic = selectedValue;
right: SizeConfig.widthMultiplier * 3, model.getDoctorsList(
left: SizeConfig.widthMultiplier * 3), _selectedClinic['ClinicID']
child: Row( .toString());
mainAxisSize: MainAxisSize.max, });
children: <Widget>[ },
Expanded( );
// add Expanded to have your dropdown button fill remaining space showDialog(
child: DropdownButton( barrierDismissible: false,
isExpanded: true, context: context,
value: _selectedClinic, builder: (BuildContext context) {
iconSize: 40, return dialog;
elevation: 16, },
selectedItemBuilder: );
(BuildContext context) { }
return model : null,
.getClinicNameList() child: TextField(
.map((item) { decoration: textFieldSelectorDecoration(
return Row( TranslationBase.of(context).clinicSelect,
mainAxisSize: MainAxisSize.max, _selectedClinic != null
children: <Widget>[ ? _selectedClinic['ClinicDescription']
AppText( : null,
item, true),
fontSize: enabled: false,
SizeConfig.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (newValue) => {
setState(() {
_selectedDoctor = null;
_selectedClinic = newValue;
var clinicInfo = model
.clinicsList
.where((i) =>
i['ClinicDescription']
.toString()
.contains(
_selectedClinic))
.toList();
clinicId = clinicInfo[0]['ClinicID']
.toString();
model.getDoctorsList(clinicId);
})
},
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
value: item.toString(),
child: Text(
item,
textAlign: TextAlign.end,
),
);
}).toList(),
),
),
],
),
),
),
//--------------------------------------------------------------------//
AppText(
TranslationBase.of(context).doctor,
fontSize: 18,
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
RoundedContainer(
margin: 10,
showBorder: true,
raduis: 30,
borderColor: Color(0xff707070),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButton(
isExpanded: true,
value: _selectedDoctor,
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model
.getDoctorNameList()
.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
AppText(
item,
fontSize:
SizeConfig.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (newValue) => {
setState(() {
_selectedDoctor = newValue;
doctorsList =
model.doctorsList;
var doctorInfo = doctorsList
.where((i) => i['DoctorName']
.toString()
.contains(_selectedDoctor))
.toList();
doctorId = doctorInfo[0]['DoctorID']
.toString();
})
},
items: model
.getDoctorNameList()
.map((item) {
return DropdownMenuItem(
value: item.toString(),
child: Text(
item,
textAlign: TextAlign.end,
),
);
}).toList(),
),
),
],
),
),
), //-----------------------------///
AppText(
TranslationBase.of(context).ext,
fontSize: 18,
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: AppTextFormField(
hintText: TranslationBase.of(context).ext,
controller: _extController,
inputFormatter: ONLY_NUMBERS,
textInputType: TextInputType.number,
onChanged: (value) => {},
),
),
AppText(
TranslationBase.of(context).priority,
fontSize: 18,
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
priorityBar(context),
AppText(
TranslationBase.of(context).referralFrequency +
getPriority(),
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
), ),
),
AppText( ),
TranslationBase.of(context).referralFrequency, SizedBox(
fontSize: 18, height: 10,
fontWeight: FontWeight.bold, ),
marginLeft: 15, Container(
marginTop: 15, height: screenSize.height * 0.070,
child: InkWell(
onTap: 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).doctorSelect,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
), ),
RoundedContainer( ),
margin: 10, ),
showBorder: true, SizedBox(
raduis: 30, height: 10,
borderColor: Color(0xff707070), ),
width: double.infinity, Container(
child: Padding( height: screenSize.height * 0.070,
padding: EdgeInsets.only( child: TextField(
top: SizeConfig.widthMultiplier * 0.9, decoration: textFieldSelectorDecoration(
bottom: SizeConfig.widthMultiplier * 0.9, TranslationBase.of(context).ext, null, false),
right: SizeConfig.widthMultiplier * 3, enabled: true,
left: SizeConfig.widthMultiplier * 3), controller: _extController,
child: Row( inputFormatters: [
mainAxisSize: MainAxisSize.max, FilteringTextInputFormatter.allow(
children: <Widget>[ RegExp(ONLY_NUMBERS))
Expanded( ],
// add Expanded to have your dropdown button fill remaining space keyboardType: TextInputType.number,
child: DropdownButton( )),
isExpanded: true, SizedBox(
value: _selectedReferralFrequancy, height: 10,
iconSize: 40, ),
elevation: 16, priorityBar(context, screenSize),
selectedItemBuilder: SizedBox(
(BuildContext context) { height: 20,
return model ),
.getReferralNamesList() AppText(
.map((item) { "${TranslationBase.of(context).referralFrequency} ${getPriority()}",
return Row( fontWeight: FontWeight.bold,
mainAxisSize: MainAxisSize.max, fontSize: 16,
children: <Widget>[ ),
AppText( SizedBox(
item, height: 20,
fontSize: ),
SizeConfig.textMultiplier * Container(
2.1, height: screenSize.height * 0.070,
), child: InkWell(
], onTap: model.referralFrequencyList != null &&
); model.referralFrequencyList.length > 0
}).toList(); ? () {
}, ListSelectDialog dialog = ListSelectDialog(
onChanged: (newValue) => { list: model.referralFrequencyList,
setState(() { attributeName: 'Description',
_selectedReferralFrequancy = newValue; attributeValueId: 'ParameterCode',
var freqInfo = model okText: TranslationBase.of(context).ok,
.referalFrequancyList okFunction: (selectedValue) {
.singleWhere((i) => i[ setState(() {
'Description'] _selectedFrequency = selectedValue;
.toString() });
.contains( },
_selectedReferralFrequancy)); );
freqId = freqInfo['ParameterCode'] showDialog(
.toString(); barrierDismissible: false,
myFocusNode.requestFocus(); context: context,
}) builder: (BuildContext context) {
}, return dialog;
items: model },
.getReferralNamesList() );
.map((item) { }
return DropdownMenuItem( : null,
value: item.toString(), child: TextField(
child: Text( decoration: textFieldSelectorDecoration(
item, TranslationBase.of(context)
textAlign: TextAlign.end, .selectReferralFrequency,
), _selectedFrequency != null
); ? _selectedFrequency['Description']
}).toList(), : null,
), true),
), enabled: false,
],
),
),
), ),
AppText( ),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinicDetailsandRemarks, TranslationBase.of(context).clinicDetailsandRemarks,
fontSize: 18, null,
fontWeight: FontWeight.bold, false),
marginLeft: 15, enabled: true,
marginTop: 15, controller: _remarksController,
), inputFormatters: [
Padding( FilteringTextInputFormatter.allow(
padding: const EdgeInsets.all(10.0), RegExp(ONLY_LETTERS))
child: AppTextFormField( ],
hintText: TranslationBase.of(context).remarks, keyboardType: TextInputType.text,
focusNode: myFocusNode, minLines: 4,
controller: _remarksController, maxLines: 6,
inputFormatter: ONLY_LETTERS, )),
textInputType: TextInputType.text, SizedBox(
onChanged: (value) => {}, height: 10,
),
Container(
child: Column(
children: <Widget>[
AppText(
TranslationBase.of(context).pleaseFill,
color: HexColor("#B8382B"),
fontWeight: FontWeight.bold,
margin: 10,
visibility: isValid == null ? false : !isValid,
), ),
), // TODO replace AppButton with secondary button and add loading
Padding( AppButton(
padding: const EdgeInsets.all(20.0), title: TranslationBase.of(context).send,
child: Column( color: HexColor("#B8382B"),
children: <Widget>[ onPressed: () => {referToDoctor(context, model)},
AppText( )
TranslationBase.of(context).pleaseFill, ],
color: Colors.red, ),
fontWeight: FontWeight.bold, ),
margin: 10, ],
visibility: ),
isValid == null ? false : !isValid, ),
),
// TODO replace AppButton with secondary button and add loading
AppButton(
title: TranslationBase
.of(context)
.send,
color: Color(PRIMARY_COLOR),
onPressed: () =>
{
referToDoctor(context, model)
},
)
],
))
],
), ),
), ),
),); );
} }
Widget priorityBar(BuildContext _context) { Widget priorityBar(BuildContext _context, Size screenSize) {
List<String> _priorities = [ List<String> _priorities = [
TranslationBase.of(context).veryUrgent, TranslationBase.of(context).veryUrgent,
TranslationBase.of(context).urgent, TranslationBase.of(context).urgent,
TranslationBase.of(context).routine, TranslationBase.of(context).routine,
]; ];
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.065, height: screenSize.height * 0.070,
width: SizeConfig.screenWidth * 0.9, decoration:
margin: EdgeInsets.only(top: 10), containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
decoration: BoxDecoration(
color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item) { children: _priorities.map((item) {
bool _isActive = _priorities[_activePriority] == item ? true : false; bool _isActive = _priorities[_activePriority] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[ return Expanded(
InkWell( child: InkWell(
child: Center( child: Center(
child: Container( child: Container(
height: 40, height: screenSize.height * 0.070,
width: 90, decoration: containerBorderDecoration(
decoration: BoxDecoration( _isActive ? HexColor("#B8382B") : Colors.white,
borderRadius: BorderRadius.circular(50), _isActive ? HexColor("#B8382B") : Colors.white),
color: _isActive ? HexColor("#B8382B") : Colors.white, child: Center(
), child: Text(
child: Center( item,
child: Text( style: TextStyle(
item, fontSize: 12,
style: TextStyle( color: _isActive
fontSize: 12, ? Colors.white
color: _isActive : Colors.black, //Colors.black,
? Colors.white fontWeight: FontWeight.bold,
: Colors.black, //Colors.black,
// backgroundColor:_isActive
// ? Hexcolor("#B8382B")
// : Colors.white,//sideColor,
fontWeight: FontWeight.bold,
),
), ),
)), ),
), )),
onTap: () { ),
print(_priorities.indexOf(item)); onTap: () {
setState(() { print(_priorities.indexOf(item));
_activePriority = _priorities.indexOf(item); setState(() {
}); _activePriority = _priorities.indexOf(item);
}), });
_isActive },
? Container( ),
decoration: BoxDecoration( );
borderRadius: BorderRadius.circular(10),
color: Colors.white),
alignment: Alignment.center,
height: 3,
width: 90,
)
: Container()
]);
}).toList(), }).toList(),
), ),
); );
@ -484,10 +334,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
return; return;
} }
final routeArgs = ModalRoute final routeArgs = ModalRoute.of(context).settings.arguments as Map;
.of(context)
.settings
.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
try { try {
@ -495,17 +342,16 @@ class _ReferPatientState extends State<ReferPatientScreen> {
extension: _extController.value.text, extension: _extController.value.text,
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient.admissionNo),
referringDoctorRemarks: _remarksController.value.text, referringDoctorRemarks: _remarksController.value.text,
frequency: freqId, frequency: _selectedFrequency['ParameterCode'].toString(),
patientID: patient.patientId, patientID: patient.patientId,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
priority: (_activePriority + 1).toString(), priority: (_activePriority + 1).toString(),
roomID: patient.roomId, roomID: patient.roomId,
selectedClinicID: clinicId.toString(), selectedClinicID: _selectedClinic['ClinicID'].toString(),
selectedDoctorID: doctorId.toString(), selectedDoctorID: _selectedDoctor['DoctorID'].toString(),
projectID: patient.projectId); projectID: patient.projectId);
// TODO: Add Translation // TODO: Add Translation
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast('Reply Successfully');
'Reply Successfully');
Navigator.pop(context); Navigator.pop(context);
} catch (e) { } catch (e) {
DrAppToastMsg.showErrorToast(e); DrAppToastMsg.showErrorToast(e);
@ -516,10 +362,47 @@ class _ReferPatientState extends State<ReferPatientScreen> {
setState(() { setState(() {
isValid = !_extController.value.text.isNullOrEmpty() && isValid = !_extController.value.text.isNullOrEmpty() &&
!_remarksController.value.text.isNullOrEmpty() && !_remarksController.value.text.isNullOrEmpty() &&
freqId != null && _selectedClinic != null &&
clinicId != null && _selectedDoctor != null &&
doctorId != null; _selectedFrequency != null;
}); });
return isValid; return isValid;
} }
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
} }

@ -106,6 +106,8 @@ class TranslationBase {
String get profile => localizedValues['profile'][locale.languageCode]; String get profile => localizedValues['profile'][locale.languageCode];
String get gender => localizedValues['gender'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode];
String get clinic => localizedValues['clinic'][locale.languageCode]; String get clinic => localizedValues['clinic'][locale.languageCode];
String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode];
String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode];
String get hospital => localizedValues['hospital'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode];
String get speciality => localizedValues['speciality'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode];
String get errorMessage => String get errorMessage =>
@ -220,8 +222,8 @@ class TranslationBase {
String get urgent => localizedValues['urgent'][locale.languageCode]; String get urgent => localizedValues['urgent'][locale.languageCode];
String get routine => localizedValues['routine'][locale.languageCode]; String get routine => localizedValues['routine'][locale.languageCode];
String get send => localizedValues['send'][locale.languageCode]; String get send => localizedValues['send'][locale.languageCode];
String get referralFrequency => String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode];
localizedValues['referralFrequency'][locale.languageCode]; String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode];
String get clinicalDetailsAndRemarks => String get clinicalDetailsAndRemarks =>
localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; localizedValues['clinicalDetailsAndRemarks'][locale.languageCode];
String get remarks => localizedValues['remarks'][locale.languageCode]; String get remarks => localizedValues['remarks'][locale.languageCode];
@ -252,6 +254,8 @@ class TranslationBase {
String get cancel => localizedValues['cancel'][locale.languageCode]; String get cancel => localizedValues['cancel'][locale.languageCode];
String get ok => localizedValues['ok'][locale.languageCode];
String get done => localizedValues['done'][locale.languageCode]; String get done => localizedValues['done'][locale.languageCode];
String get searchMedicineImageCaption => String get searchMedicineImageCaption =>

@ -8,7 +8,7 @@ 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/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.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/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -35,279 +35,276 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CardWithBgWidgetNew( return Container(
widget: Container( width: double.infinity,
child: Column( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 10),
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.only(left: 0, top: 8, right: 0, bottom: 0),
children: <Widget>[ decoration: BoxDecoration(
Row( shape: BoxShape.rectangle,
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.circular(8),
children: <Widget>[ border: Border.fromBorderSide(BorderSide(
AppText( color: Color(0xffCCCCCC),
'${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}', width: 2,
fontSize: 2.5 * SizeConfig.textMultiplier, )),
fontWeight: FontWeight.bold, color: Color(0xffffffff),
), ),
InkWell( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
HeaderBodyExpandableNotifier(
headerWidget: Container(
margin: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
AppText(
'${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}',
fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
_showDetails = !_showDetails; _showDetails = !_showDetails;
}); });
}, },
child: Icon(_showDetails child: Image.asset(
? Icons.keyboard_arrow_up "assets/images/ic_circle_arrow.png",
: Icons.keyboard_arrow_down)), width: 25,
], height: 25,
color: Colors.black,
),
),
],
),
), ),
!_showDetails bodyWidget: Column(
? Container() crossAxisAlignment: CrossAxisAlignment.start,
: AnimatedContainer( children: <Widget>[
duration: Duration(milliseconds: 200), Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ SizedBox(
Column( height: 5,
crossAxisAlignment: CrossAxisAlignment.start, ),
children: <Widget>[ Divider(
SizedBox( color: Color(0xFF000000),
height: 5, height: 0.5,
), ),
Divider( Table(
color: Color(0xFF000000), border: TableBorder.symmetric(
height: 0.5, inside: BorderSide(width: 0.5),
), ),
Table( children: [
border: TableBorder.symmetric( TableRow(children: [
inside: BorderSide(width: 0.5), Container(
), margin: EdgeInsets.all(2.5),
children: [ padding: EdgeInsets.all(5),
TableRow(children: [ decoration: BoxDecoration(),
Container( child: Column(
margin: EdgeInsets.all(2.5), crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.all(5), children: <Widget>[
decoration: BoxDecoration(), AppText(
child: Column( TranslationBase.of(context).fileNo,
crossAxisAlignment: fontSize: 1.7 * SizeConfig.textMultiplier,
CrossAxisAlignment.start, fontWeight: FontWeight.bold,
children: <Widget>[
AppText(
TranslationBase.of(context).fileNo,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.patientId}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4,
top: 2.5,
right: 2.5,
bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).referralDoctor,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
Texts(
widget.myReferredPatientModel
.referralDoctorName,
maxLength: 80,
readMore: true,
),
],
),
),
]),
TableRow(
children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).referringClinic,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.referralClinicDescription}',
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4,
top: 2.5,
right: 2.5,
bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).frequency,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
widget.myReferredPatientModel
.frequencyDescription,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
],
), ),
TableRow(children: [ AppText(
Container( '${widget.myReferredPatientModel.patientId}',
margin: EdgeInsets.all(2.5), fontSize: 1.7 * SizeConfig.textMultiplier,
padding: EdgeInsets.all(5), fontWeight: FontWeight.w300,
child: Column( )
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).priority,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.priorityDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4,
top: 2.5,
right: 2.5,
bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).maxResponseTime,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
Helpers.getDateFormatted(widget
.myReferredPatientModel
.maxResponseTime),
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
])
], ],
), ),
Divider( ),
color: Color(0xFF000000), Container(
height: 0.5, margin: EdgeInsets.only(
), left: 4, top: 2.5, right: 2.5, bottom: 2.5),
SizedBox( padding: EdgeInsets.all(5),
height: 5, child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
AppText( children: <Widget>[
TranslationBase.of(context).clinicDetailsandRemarks, AppText(
fontSize: 1.7 * SizeConfig.textMultiplier, TranslationBase.of(context).referralDoctor,
fontWeight: FontWeight.bold, fontSize: 1.7 * SizeConfig.textMultiplier,
textAlign: TextAlign.start, fontWeight: FontWeight.bold,
), ),
SizedBox( Texts(
height: 5, widget.myReferredPatientModel
), .referralDoctorName,
Texts( maxLength: 80,
'${widget.myReferredPatientModel.referringDoctorRemarks}', readMore: true,
style: "bodyText1", ),
readMore: true, ],
textAlign: TextAlign.start,
maxLength: 100),
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(context).answerSuggestions,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
), ),
Texts( ),
'${widget.myReferredPatientModel.referredDoctorRemarks}', ]),
style: "bodyText1", TableRow(
readMore: true, children: [
textAlign: TextAlign.start, Container(
maxLength: 100), margin: EdgeInsets.all(2.5),
SizedBox( padding: EdgeInsets.all(5),
height: 5, child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).referringClinic,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.referralClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
), ),
SizedBox(height: 10.0),
Container( Container(
width: double.infinity, margin: EdgeInsets.only(
child: Button( left: 4, top: 2.5, right: 2.5, bottom: 2.5),
onTap: () async { padding: EdgeInsets.all(5),
try { child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
await widget.model.verify(widget.myReferredPatientModel); children: <Widget>[
AppText(
DrAppToastMsg.showSuccesToast('Verify Successfully'); TranslationBase.of(context).frequency,
} catch (e) { fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
DrAppToastMsg.showErrorToast(e); ),
} AppText(
}, widget.myReferredPatientModel
title: TranslationBase.of(context).verify, .frequencyDescription,
loading: widget.model.state == ViewState.BusyLocal, fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
) )
], ],
) ),
TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).priority,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferredPatientModel.priorityDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
margin: EdgeInsets.only(
left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).maxResponseTime,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
Helpers.getDateFormatted(widget
.myReferredPatientModel.maxResponseTime),
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
])
], ],
), ),
) Divider(
], color: Color(0xFF000000),
), height: 0.5,
),
SizedBox(
height: 5,
),
Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).clinicDetailsandRemarks,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Texts(
'${widget.myReferredPatientModel.referringDoctorRemarks}',
style: "bodyText1",
readMore: true,
textAlign: TextAlign.start,
maxLength: 100),
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(context).answerSuggestions,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Texts(
'${widget.myReferredPatientModel.referredDoctorRemarks}',
style: "bodyText1",
readMore: true,
textAlign: TextAlign.start,
maxLength: 100),
],
),
),
SizedBox(
height: 5,
),
SizedBox(height: 10.0),
Container(
margin: EdgeInsets.all(10),
width: double.infinity,
child: Button(
onTap: () async {
try {
await widget.model
.verify(widget.myReferredPatientModel);
DrAppToastMsg.showSuccesToast(
'Verify Successfully');
} catch (e) {
DrAppToastMsg.showErrorToast(e);
}
},
title: TranslationBase.of(context).verify,
loading: widget.model.state == ViewState.BusyLocal,
),
)
],
)
],
),
isExpand: _showDetails,
)
],
), ),
); );
} }

@ -4,9 +4,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import './profile_medical_info_widget.dart'; import './profile_medical_info_widget.dart';
/* /*
@ -34,17 +33,13 @@ class PatientProfileWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(boxShadow: <BoxShadow>[
boxShadow: <BoxShadow>[ BoxShadow(
BoxShadow( color: Colors.grey.shade300,
color: Colors.grey.shade300, blurRadius: 10.0,
blurRadius: 10.0, spreadRadius: 0,
spreadRadius: 0, offset: Offset(0, 10)),
offset: Offset(0, 10) ], color: Colors.white),
),
],
color: Colors.white
),
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@ -103,7 +98,8 @@ class PatientProfileWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -130,7 +126,8 @@ class PatientProfileWidget extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -157,7 +154,8 @@ class PatientProfileWidget extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -188,203 +186,249 @@ class PatientProfileWidget extends StatelessWidget {
), ),
]), ]),
), ),
Container( if (patient.admissionNo != null)
margin: EdgeInsets.all(16), Container(
child: Column( margin: EdgeInsets.all(16),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
AppText( children: [
TranslationBase.of(context).admissionDetail, AppText(
color: Colors.black, TranslationBase.of(context).admissionDetail,
fontWeight: FontWeight.bold, color: Colors.black,
fontSize: 1.8 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold,
), fontSize: 1.8 * SizeConfig.textMultiplier,
SizedBox(
height: 4,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
width: 1,
)),
), ),
child: Column( SizedBox(
children: [ height: 4,
Padding( ),
padding: EdgeInsets.all(16), Container(
child: Column( decoration: BoxDecoration(
children: [ color: Colors.white,
Row( shape: BoxShape.rectangle,
children: [ borderRadius: BorderRadius.circular(8),
Container( border: Border.fromBorderSide(BorderSide(
width: 14 * SizeConfig.textMultiplier, color: Color(0xffBBBBBB),
child: AppText( width: 1,
TranslationBase.of(context).dateTime, )),
color: Colors.black, ),
fontWeight: FontWeight.bold, child: Column(
fontSize: 1.6 * SizeConfig.textMultiplier, children: [
Padding(
padding: EdgeInsets.all(16),
child: Column(
children: [
Row(
children: [
Container(
width:
14 * SizeConfig.textMultiplier,
child: AppText(
TranslationBase.of(context)
.dateTime,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 1.6 *
SizeConfig.textMultiplier,
),
), ),
), AppText(
AppText( patient.admissionDate != null
"${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}", ? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}"
color: Colors.black, : "",
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Container(
width: 14 * SizeConfig.textMultiplier,
child: AppText(
TranslationBase.of(context).admissionNo,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize:
1.6 * SizeConfig.textMultiplier,
), ),
), ],
AppText( ),
patient.admissionNo, SizedBox(
color: Colors.black, height: 4,
fontWeight: FontWeight.normal, ),
fontSize: 1.6 * SizeConfig.textMultiplier, Row(
), children: [
], Container(
), width:
SizedBox( 14 * SizeConfig.textMultiplier,
height: 4, child: AppText(
), TranslationBase.of(context)
Row( .admissionNo,
children: [ color: Colors.black,
Container( fontWeight: FontWeight.bold,
width: 14 * SizeConfig.textMultiplier, fontSize: 1.6 *
child: AppText( SizeConfig.textMultiplier,
TranslationBase.of(context).losNo, ),
),
AppText(
patient.admissionNo != null
? patient.admissionNo
: '',
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize:
1.6 * SizeConfig.textMultiplier,
), ),
), ],
AppText( ),
DateUtils.differenceBetweenServerDateAndCurrent(patient.admissionDate), SizedBox(
color: Colors.black, height: 4,
fontWeight: FontWeight.normal, ),
fontSize: 1.6 * SizeConfig.textMultiplier, Row(
), children: [
], Container(
), width:
], 14 * SizeConfig.textMultiplier,
), child: AppText(
), TranslationBase.of(context).losNo,
const Divider( color: Colors.black,
color: Color(0xffCCCCCC),
height: 5,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
height: 10 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).area,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 *
), SizeConfig.textMultiplier,
SizedBox(
height: 4,
), ),
AppText( ),
patient.clinicDescription, AppText(
fontWeight: FontWeight.normal, patient.admissionDate != null
fontSize: 1.6 * SizeConfig.textMultiplier, ? DateUtils
), .differenceBetweenServerDateAndCurrent(
], patient.admissionDate)
: "",
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize:
1.6 * SizeConfig.textMultiplier,
),
],
),
],
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 5,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
height: 10 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.area,
fontWeight: FontWeight.bold,
fontSize: 1.6 *
SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient.clinicDescription,
fontWeight: FontWeight.normal,
fontSize: 1.6 *
SizeConfig.textMultiplier,
),
],
),
), ),
), ),
), Container(
Container( width: 1,
width: 1, color: Color(0xffCCCCCC),
color: Color(0xffCCCCCC), ),
), Expanded(
Expanded( child: Padding(
child: Padding( padding: const EdgeInsets.fromLTRB(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), 16.0, 8.0, 8.0, 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
mainAxisAlignment: MainAxisAlignment.spaceEvenly, CrossAxisAlignment.start,
children: [ mainAxisAlignment:
Expanded( MainAxisAlignment.spaceEvenly,
child: Row( children: [
crossAxisAlignment: CrossAxisAlignment.start, Expanded(
children: [ child: Row(
AppText( crossAxisAlignment:
TranslationBase.of(context).room, CrossAxisAlignment.start,
fontWeight: FontWeight.bold, children: [
fontSize: 1.6 * SizeConfig.textMultiplier, AppText(
), TranslationBase.of(
SizedBox( context)
width: 4, .room,
), fontWeight:
AppText( FontWeight.bold,
"${patient.nursingStationName}\n${patient.roomId}", fontSize: 1.6 *
fontWeight: FontWeight.normal, SizeConfig
fontSize: 1.4 * SizeConfig.textMultiplier, .textMultiplier,
), ),
], SizedBox(
width: 4,
),
AppText(
"${patient.nursingStationName}\n${patient.roomId}",
fontWeight:
FontWeight.normal,
fontSize: 1.4 *
SizeConfig
.textMultiplier,
),
],
),
), ),
), SizedBox(
SizedBox( height: 4,
height: 4,
),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).bed,
fontWeight: FontWeight.bold,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
SizedBox(
width: 4,
),
AppText(
"${patient.bedId}",
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
],
), ),
), Expanded(
], child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(
context)
.bed,
fontWeight:
FontWeight.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
SizedBox(
width: 4,
),
AppText(
"${patient.bedId}",
fontWeight:
FontWeight.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
],
),
),
],
),
), ),
), ),
), ],
], ),
), )
) ],
], ),
), )
) ],
], ),
), ),
),
], ],
), ),
], ],

@ -37,7 +37,7 @@ class AppTextFormField extends FormField<String> {
child: TextFormField( child: TextFormField(
focusNode: focusNode, focusNode: focusNode,
keyboardType: textInputType, keyboardType: textInputType,
inputFormatters: [WhitelistingTextInputFormatter(RegExp(inputFormatter)), inputFormatters: [FilteringTextInputFormatter.allow(RegExp(inputFormatter)),
],onChanged: onChanged?? (value){ ],onChanged: onChanged?? (value){
state.didChange(value); state.didChange(value);
}, },

@ -0,0 +1,89 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class ListSelectDialog extends StatefulWidget {
final List<dynamic> list;
final String attributeName;
final String attributeValueId;
final okText;
final Function(dynamic) okFunction;
dynamic selectedValue;
ListSelectDialog(
{@required this.list,
@required this.attributeName,
@required this.attributeValueId,
@required this.okText,
@required this.okFunction});
@override
_ListSelectDialogState createState() => _ListSelectDialogState();
}
class _ListSelectDialogState extends State<ListSelectDialog> {
@override
void initState() {
super.initState();
widget.selectedValue = widget.selectedValue ?? widget.list[0];
}
@override
Widget build(BuildContext context) {
return showAlertDialog(context);
}
showAlertDialog(BuildContext context) {
// set up the buttons
Widget cancelButton = FlatButton(
child: Text(TranslationBase.of(context).cancel),
onPressed: () {
Navigator.of(context).pop();
});
Widget continueButton = FlatButton(
child: Text(this.widget.okText),
onPressed: () {
this.widget.okFunction(widget.selectedValue);
Navigator.of(context).pop();
});
// set up the AlertDialog
AlertDialog alert = AlertDialog(
// title: Text(widget.title),
content: createDialogList(),
actions: [
cancelButton,
continueButton,
],
);
return alert;
}
Widget createDialogList() {
return Container(
height: MediaQuery.of(context).size.height * 0.5,
child: SingleChildScrollView(
child: Column(
children: [
...widget.list
.map((item) => RadioListTile(
title: Text("${item[widget.attributeName].toString()}"),
groupValue: widget.selectedValue[widget.attributeValueId].toString(),
value: item[widget.attributeValueId].toString(),
activeColor: Colors.blue.shade700,
selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;
});
},
))
.toList()
],
),
),
);
}
static closeAlertDialog(BuildContext context) {
Navigator.of(context).pop();
}
}
Loading…
Cancel
Save