|
|
|
|
@ -2,10 +2,12 @@ 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/core/viewModel/sick_leave_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/Text.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';
|
|
|
|
|
@ -55,219 +57,236 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
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),
|
|
|
|
|
builder: (_, model, w) => BaseView<SickLeaveViewModel>(
|
|
|
|
|
onModelReady: (model2) => model2.preSickLeaveStatistics(),
|
|
|
|
|
builder: (_, model2, 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).clinicName,
|
|
|
|
|
TranslationBase.of(context).doctorName,
|
|
|
|
|
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(),
|
|
|
|
|
))),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
readOnly: true,
|
|
|
|
|
hintText: profile['DoctorName'],
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
onSaved: (value) {},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_NUMBERS)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
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)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
|
SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context).submit,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// _validateInputs();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
onSaved: (value) {},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// return TextValidator().validateName(value);
|
|
|
|
|
// },
|
|
|
|
|
inputFormatter: ONLY_NUMBERS)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Texts(TranslationBase.of(context)
|
|
|
|
|
.previousSickLeaveIssue +
|
|
|
|
|
' ')
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context).submit,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// _validateInputs();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getProfile() async {
|
|
|
|
|
@ -281,7 +300,6 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
|
|
|
|
|
var clinicInfo = model.clinicsList
|
|
|
|
|
.where((i) => i['ClinicID'] == this.profile['ClinicID'])
|
|
|
|
|
.toList();
|
|
|
|
|
print(clinicInfo);
|
|
|
|
|
return clinicInfo[0]['ClinicDescription'];
|
|
|
|
|
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|