sick leave

merge-requests/197/head
Sultan Khan 5 years ago
parent 06f71a22fb
commit cc1a63786f

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -242,15 +242,17 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': 'لا يوجد اي نتائج' 'ar': 'لا يوجد اي نتائج'
}, },
'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'},
'moreThan3Letter': { 'moreThan3Letter': {
'en': 'Medicine Name Should Be More Than 3 letter', 'en': 'Medicine Name Should Be More Than 3 letter',
'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف'
}, },
'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '},
'age2': {'en': 'Age: ', 'ar': 'العمر: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '},
'replySuccessfully': { 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'},
'en': 'Reply Successfully', "sick-leaves": {"en": "Sick Leaves", "ar": "الاجازات المرضية"},
'ar': 'تم الرد بنجاح' "submit": {"en": "Submit", "ar": "ارسال"},
}, "doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"},
"clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"},
"sick-leave-date": {"en": "Sick leave date ", "ar": "تاريخ الاجازة."},
"sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."}
}; };

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen
import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart';
import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart';
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart';
import './screens/QR_reader_screen.dart'; import './screens/QR_reader_screen.dart';
import './screens/auth/change_password_screen.dart'; import './screens/auth/change_password_screen.dart';
@ -74,6 +75,7 @@ const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details';
// const String VIDEO_CALL = 'video-call'; // const String VIDEO_CALL = 'video-call';
const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; const String LIVECARE_PENDING_LIST = 'livecare-pendinglist';
// const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox';
const String PATIENT_SICKLEAVE = 'patients/patient_sickleave';
var routes = { var routes = {
ROOT: (_) => RootPage(), ROOT: (_) => RootPage(),
HOME: (_) => LandingPage(), HOME: (_) => LandingPage(),
@ -109,5 +111,6 @@ var routes = {
IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(),
// VIDEO_CALL: (_) => VideoCallPage(patientData: null), // VIDEO_CALL: (_) => VideoCallPage(patientData: null),
LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(), LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(),
// LIVECARE_END_DIALOG: (_) => EndCallDialogBox() // LIVECARE_END_DIALOG: (_) => EndCallDialogBox(),
PATIENT_SICKLEAVE: (_) => SickLeaveScreen()
}; };

@ -0,0 +1,286 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
Helpers helpers = Helpers();
class SickLeaveScreen extends StatefulWidget {
@override
_SickLeaveScreenState createState() => _SickLeaveScreenState();
}
class _SickLeaveScreenState extends State<SickLeaveScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
TextEditingController _toDateController = new TextEditingController();
String _selectedClinic;
Map profile = {};
void _presentDatePicker(id) {
showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(2019),
lastDate: DateTime.now(),
).then((pickedDate) {
if (pickedDate == null) {
return;
}
setState(() {
var selectedDate = DateFormat.yMd().format(pickedDate);
_toDateController.text = selectedDate;
});
});
}
@override
void initState() {
getProfile();
super.initState();
}
@override
Widget build(BuildContext context) {
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).sickleave,
body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).sickLeaveDays,
fontSize: 10,
),
AppTextFormField(
borderColor: Colors.white,
onSaved: (value) {},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_NUMBERS)
]),
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).sickLeaveDate,
fontSize: 10,
),
AppTextFormField(
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons.calendar_today)),
textInputType: TextInputType.number,
controller: _toDateController,
onTap: () {
_presentDatePicker('_selectedToDate');
},
inputFormatter: ONLY_DATE,
onSaved: (value) {}),
],
)),
RoundedContainer(
// margin: 10,
showBorder: true,
// raduis: 30,
borderColor: HexColor("#CCCCCC"),
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: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).clinicName,
fontSize: 10,
),
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: new IgnorePointer(
ignoring: true,
child: DropdownButton(
isExpanded: true,
value: getClinicName(model),
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model
.getClinicNameList()
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
item,
fontSize: SizeConfig
.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (newValue) => {},
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
value: item.toString(),
child: Text(
item,
textAlign:
TextAlign.end,
),
);
}).toList(),
))),
),
],
)
],
),
)),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).doctorName,
fontSize: 10,
),
AppTextFormField(
readOnly: true,
hintText: profile['DoctorName'],
borderColor: Colors.white,
onSaved: (value) {},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_NUMBERS)
],
),
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).remarks,
fontSize: 10,
),
AppTextFormField(
borderColor: Colors.white,
onSaved: (value) {},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_NUMBERS)
],
),
),
Container(
margin:
EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).submit,
onPressed: () {
// _validateInputs();
},
),
],
),
)
],
),
),
),
),
));
}
getProfile() async {
Map p = await sharedPref.getObj(DOCTOR_PROFILE);
setState(() {
this.profile = p;
});
}
getClinicName(model) {
var clinicInfo = model.clinicsList
.where((i) => i['ClinicID'] == this.profile['ClinicID'])
.toList();
print(clinicInfo);
return clinicInfo[0]['ClinicDescription'];
}
}

@ -33,7 +33,8 @@ class TranslationBase {
String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; String get mobileNo => localizedValues['mobileNo'][locale.languageCode];
String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; String get replySuccessfully =>
localizedValues['replySuccessfully'][locale.languageCode];
String get messagesScreenToolbarTitle => String get messagesScreenToolbarTitle =>
localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; localizedValues['messagesScreenToolbarTitle'][locale.languageCode];
@ -277,6 +278,14 @@ class TranslationBase {
localizedValues['moreThan3Letter'][locale.languageCode]; localizedValues['moreThan3Letter'][locale.languageCode];
String get gender2 => localizedValues['gender2'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode];
String get age2 => localizedValues['age2'][locale.languageCode]; String get age2 => localizedValues['age2'][locale.languageCode];
String get sickleave => localizedValues['sick-leaves'][locale.languageCode];
String get submit => localizedValues['submit'][locale.languageCode];
String get doctorName => localizedValues['doc-name'][locale.languageCode];
String get clinicName => localizedValues['clinicname'][locale.languageCode];
String get sickLeaveDate =>
localizedValues['sick-leave-date'][locale.languageCode];
String get sickLeaveDays =>
localizedValues['sick-leave-days'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -396,6 +396,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
Map<String, dynamic> profile, Function changeLoadingStata) { Map<String, dynamic> profile, Function changeLoadingStata) {
var doctor = DoctorProfileModel.fromJson(profile); var doctor = DoctorProfileModel.fromJson(profile);
authProv.setDoctorProfile(doctor); authProv.setDoctorProfile(doctor);
sharedPref.setObj(DOCTOR_PROFILE, profile);
this.getDashboard(doctor, changeLoadingStata); this.getDashboard(doctor, changeLoadingStata);
} }

@ -82,6 +82,14 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: PATIENT_ORDERS, route: PATIENT_ORDERS,
name: TranslationBase.of(context).orders, name: TranslationBase.of(context).orders,
icon: 'radiology-1.png')), icon: 'radiology-1.png')),
Visibility(
visible: selectedPatientType != 0 && selectedPatientType != 5,
child: PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_SICKLEAVE,
name: TranslationBase.of(context).sickleave,
icon: 'sick_leaves_icons.png')),
]); ]);
} }
} }

@ -24,6 +24,7 @@ class AppTextFormField extends FormField<String> {
ValueChanged<String> onFieldSubmitted, ValueChanged<String> onFieldSubmitted,
IconButton prefix, IconButton prefix,
String labelText, String labelText,
bool readOnly = false,
borderColor}) borderColor})
: super( : super(
onSaved: onSaved, onSaved: onSaved,
@ -33,44 +34,53 @@ class AppTextFormField extends FormField<String> {
return Column( return Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 40.0, height: 40.0,
child: TextFormField( child: TextFormField(
focusNode: focusNode, readOnly: readOnly,
keyboardType: textInputType, focusNode: focusNode,
inputFormatters: [WhitelistingTextInputFormatter(RegExp(inputFormatter)), keyboardType: textInputType,
],onChanged: onChanged?? (value){ inputFormatters: [
state.didChange(value); WhitelistingTextInputFormatter(RegExp(inputFormatter)),
}, ],
textInputAction: textInputAction, onChanged: onChanged ??
onFieldSubmitted: onFieldSubmitted, (value) {
decoration: InputDecoration( state.didChange(value);
hintText: hintText, },
suffixIcon: prefix, textInputAction: textInputAction,
hintStyle: TextStyle( onFieldSubmitted: onFieldSubmitted,
fontSize: SizeConfig.textMultiplier * 1.8,), decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), hintText: hintText,
labelText: labelText, suffixIcon: prefix,
labelStyle: TextStyle( hintStyle: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7,), fontSize: SizeConfig.textMultiplier * 1.8,
enabledBorder: OutlineInputBorder( ),
borderRadius: BorderRadius.all(Radius.circular(6)), contentPadding:
borderSide: BorderSide( EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
color: borderColor != null ? borderColor : HexColor( labelText: labelText,
"#CCCCCC")), labelStyle: TextStyle(
), fontSize: SizeConfig.textMultiplier * 1.7,
focusedBorder: OutlineInputBorder( ),
borderSide: BorderSide( enabledBorder: OutlineInputBorder(
color: borderColor != null ? borderColor : HexColor( borderRadius: BorderRadius.all(Radius.circular(6)),
"#CCCCCC")), borderSide: BorderSide(
borderRadius: BorderRadius.all(Radius.circular(6)), color: borderColor != null
) ? borderColor
//BorderRadius.all(Radius.circular(20)); : HexColor("#CCCCCC")),
), ),
onTap: onTap, focusedBorder: OutlineInputBorder(
controller: controller, borderSide: BorderSide(
), color: borderColor != null
), ? borderColor
state.hasError : HexColor("#CCCCCC")),
borderRadius: BorderRadius.all(Radius.circular(6)),
)
//BorderRadius.all(Radius.circular(20));
),
onTap: onTap,
controller: controller,
),
),
state.hasError
? Text( ? Text(
state.errorText, state.errorText,
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),

Loading…
Cancel
Save