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

sick_leave
Elham Rababh 4 years ago
commit 9c6cebcffd

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -1,13 +1,13 @@
class PrescriptionReport { class PrescriptionReport {
String address; String address;
int appointmentNo; dynamic appodynamicmentNo;
String clinic; String clinic;
String companyName; String companyName;
int days; dynamic days;
String doctorName; String doctorName;
var doseDailyQuantity; var doseDailyQuantity;
String frequency; String frequency;
int frequencyNumber; dynamic frequencyNumber;
String image; String image;
String imageExtension; String imageExtension;
String imageSRCUrl; String imageSRCUrl;
@ -15,30 +15,30 @@ class PrescriptionReport {
String imageThumbUrl; String imageThumbUrl;
String isCovered; String isCovered;
String itemDescription; String itemDescription;
int itemID; dynamic itemID;
String orderDate; String orderDate;
int patientID; dynamic patientID;
String patientName; String patientName;
String phoneOffice1; String phoneOffice1;
String prescriptionQR; String prescriptionQR;
int prescriptionTimes; dynamic prescriptionTimes;
String productImage; String productImage;
String productImageBase64; String productImageBase64;
String productImageString; String productImageString;
int projectID; dynamic projectID;
String projectName; String projectName;
String remarks; String remarks;
String route; String route;
String sKU; String sKU;
int scaleOffset; dynamic scaleOffset;
String startDate; String startDate;
String patientAge; String patientAge;
String patientGender; String patientGender;
String phoneOffice; String phoneOffice;
int doseTimingID; dynamic doseTimingID;
int frequencyID; dynamic frequencyID;
int routeID; dynamic routeID;
String name; String name;
String itemDescriptionN; String itemDescriptionN;
String routeN; String routeN;
@ -46,7 +46,7 @@ class PrescriptionReport {
PrescriptionReport({ PrescriptionReport({
this.address, this.address,
this.appointmentNo, this.appodynamicmentNo,
this.clinic, this.clinic,
this.companyName, this.companyName,
this.days, this.days,
@ -92,7 +92,7 @@ class PrescriptionReport {
PrescriptionReport.fromJson(Map<String, dynamic> json) { PrescriptionReport.fromJson(Map<String, dynamic> json) {
address = json['Address']; address = json['Address'];
appointmentNo = json['AppointmentNo']; appodynamicmentNo = json['AppodynamicmentNo'];
clinic = json['Clinic']; clinic = json['Clinic'];
companyName = json['CompanyName']; companyName = json['CompanyName'];
days = json['Days']; days = json['Days'];
@ -141,7 +141,7 @@ class PrescriptionReport {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['Address'] = this.address; data['Address'] = this.address;
data['AppointmentNo'] = this.appointmentNo; data['AppodynamicmentNo'] = this.appodynamicmentNo;
data['Clinic'] = this.clinic; data['Clinic'] = this.clinic;
data['CompanyName'] = this.companyName; data['CompanyName'] = this.companyName;
data['Days'] = this.days; data['Days'] = this.days;

@ -1,41 +1,41 @@
class PrescriptionReportEnh { class PrescriptionReportEnh {
String address; String address;
int appointmentNo; dynamic appodynamicmentNo;
String clinic; String clinic;
Null companyName; dynamic companyName;
int days; dynamic days;
String doctorName; String doctorName;
int doseDailyQuantity; dynamic doseDailyQuantity;
String frequency; String frequency;
int frequencyNumber; dynamic frequencyNumber;
Null image; dynamic image;
Null imageExtension; dynamic imageExtension;
String imageSRCUrl; String imageSRCUrl;
Null imageString; dynamic imageString;
String imageThumbUrl; String imageThumbUrl;
String isCovered; String isCovered;
String itemDescription; String itemDescription;
int itemID; dynamic itemID;
String orderDate; String orderDate;
int patientID; dynamic patientID;
String patientName; String patientName;
String phoneOffice1; String phoneOffice1;
Null prescriptionQR; dynamic prescriptionQR;
int prescriptionTimes; dynamic prescriptionTimes;
Null productImage; dynamic productImage;
Null productImageBase64; dynamic productImageBase64;
String productImageString; String productImageString;
int projectID; dynamic projectID;
String projectName; String projectName;
String remarks; String remarks;
String route; String route;
String sKU; String sKU;
int scaleOffset; dynamic scaleOffset;
String startDate; String startDate;
PrescriptionReportEnh( PrescriptionReportEnh(
{this.address, {this.address,
this.appointmentNo, this.appodynamicmentNo,
this.clinic, this.clinic,
this.companyName, this.companyName,
this.days, this.days,
@ -70,7 +70,7 @@ class PrescriptionReportEnh {
PrescriptionReportEnh.fromJson(Map<String, dynamic> json) { PrescriptionReportEnh.fromJson(Map<String, dynamic> json) {
address = json['Address']; address = json['Address'];
appointmentNo = json['AppointmentNo']; appodynamicmentNo = json['AppodynamicmentNo'];
clinic = json['Clinic']; clinic = json['Clinic'];
companyName = json['CompanyName']; companyName = json['CompanyName'];
days = json['Days']; days = json['Days'];
@ -107,7 +107,7 @@ class PrescriptionReportEnh {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['Address'] = this.address; data['Address'] = this.address;
data['AppointmentNo'] = this.appointmentNo; data['AppodynamicmentNo'] = this.appodynamicmentNo;
data['Clinic'] = this.clinic; data['Clinic'] = this.clinic;
data['CompanyName'] = this.companyName; data['CompanyName'] = this.companyName;
data['Days'] = this.days; data['Days'] = this.days;

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_Li
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart'; import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -50,7 +51,9 @@ class _InPatientScreenState extends State<InPatientScreen>
} }
_handleTabSelection() { _handleTabSelection() {
Helpers.hideKeyboard(context);
setState(() { setState(() {
widget.showBottomSheet = false;
_activeTab = _tabController.index; _activeTab = _tabController.index;
}); });
} }

@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -44,8 +45,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient, onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false),
patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
@ -63,8 +63,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (model.radiologyList.isNotEmpty && if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -84,8 +83,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
], ],
), ),
), ),
if (patient.patientStatusType != null && if (patient.patientStatusType != null && patient.patientStatusType == 43)
patient.patientStatusType == 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -105,20 +103,19 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
], ],
), ),
), ),
if ((patient.patientStatusType != null && if ((patient.patientStatusType != null && patient.patientStatusType == 43) ||
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null)) (isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( SlideUpPageRoute(
builder: (context) => BaseAddProcedureTabPage( widget: BaseAddProcedureTabPage(
patient: patient, patient: patient,
model: model, model: model,
procedureType: ProcedureType.RADIOLOGY, procedureType: ProcedureType.RADIOLOGY,
), settings: RouteSettings(name: 'AddProcedureTabPage') ),
), settingRoute: 'AddProcedureTabPage'),
); );
}, },
label: TranslationBase.of(context).applyForRadiologyOrder, label: TranslationBase.of(context).applyForRadiologyOrder,
@ -143,43 +140,26 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
height: 160, height: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545) //Colors.red[900] Color(0xff404545)
color: model.radiologyList[index] color: model.radiologyList[index].isLiveCareAppodynamicment
.isLiveCareAppodynamicment
? Colors.red[900] ? Colors.red[900]
: !model.radiologyList[index].isInOutPatient : !model.radiologyList[index].isInOutPatient
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
? Radius.circular(0) bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
: Radius.circular(8), topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomLeft: projectViewModel.isArabic bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
? Radius.circular(0)
: Radius.circular(8),
topRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0)),
), ),
child: RotatedBox( child: RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
model.radiologyList[index] model.radiologyList[index].isLiveCareAppodynamicment
.isLiveCareAppodynamicment ? TranslationBase.of(context).liveCare.toUpperCase()
? TranslationBase.of(context) : !model.radiologyList[index].isInOutPatient
.liveCare ? TranslationBase.of(context).inPatientLabel.toUpperCase()
.toUpperCase() : TranslationBase.of(context).outpatient.toUpperCase(),
: !model.radiologyList[index]
.isInOutPatient
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -187,29 +167,21 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Expanded( Expanded(
child: DoctorCard( child: DoctorCard(
isNoMargin: true, isNoMargin: true,
doctorName: doctorName: model.radiologyList[index].doctorName,
model.radiologyList[index].doctorName, profileUrl: model.radiologyList[index].doctorImageURL,
profileUrl: invoiceNO: '${model.radiologyList[index].invoiceNo}',
model.radiologyList[index].doctorImageURL, branch: '${model.radiologyList[index].projectName}',
invoiceNO: clinic: model.radiologyList[index].clinicDescription,
'${model.radiologyList[index].invoiceNo}',
branch:
'${model.radiologyList[index].projectName}',
clinic: model
.radiologyList[index].clinicDescription,
appointmentDate: appointmentDate:
model.radiologyList[index].orderDate ?? model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate,
model.radiologyList[index].reportDate,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: RadiologyDetailsPage( page: RadiologyDetailsPage(
finalRadiology: finalRadiology: model.radiologyList[index],
model.radiologyList[index], patient: patient,
patient: patient, isInpatient: isInpatient),
isInpatient:isInpatient
),
), ),
); );
}, },
@ -218,8 +190,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
], ],
), ),
)), )),
if (model.radiologyList.isEmpty && if (model.radiologyList.isEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -95,13 +96,13 @@ class PrescriptionsPage extends StatelessWidget {
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( SlideUpPageRoute(
builder: (context) => BaseAddProcedureTabPage( widget: BaseAddProcedureTabPage(
patient: patient, patient: patient,
prescriptionModel: model, prescriptionModel: model,
procedureType: ProcedureType.PRESCRIPTION, procedureType: ProcedureType.PRESCRIPTION,
), ),
settings: RouteSettings(name: 'AddProcedureTabPage')), settingRoute: 'AddProcedureTabPage'),
); );
}, },
label: TranslationBase.of(context).applyForNewPrescriptionsOrder, label: TranslationBase.of(context).applyForNewPrescriptionsOrder,

@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'ProcedureCard.dart'; import 'ProcedureCard.dart';
@ -99,13 +100,13 @@ class ProcedureScreen extends StatelessWidget {
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( SlideUpPageRoute(
builder: (context) => BaseAddProcedureTabPage( widget: BaseAddProcedureTabPage(
patient: patient, patient: patient,
model: model, model: model,
procedureType: ProcedureType.PROCEDURE, procedureType: ProcedureType.PROCEDURE,
), ),
settings: RouteSettings(name: 'AddProcedureTabPage')), settingRoute: 'AddProcedureTabPage'),
); );
}, },
child: Container( child: Container(

@ -29,162 +29,168 @@ class AddRescheduleLeavScreen extends StatelessWidget {
appBarTitle: TranslationBase.of(context).rescheduleLeaves, appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column(children: [ child: Column(children: [
AddNewOrder( Padding(
onTap: () async { padding: const EdgeInsets.all(8.0),
await locator<AnalyticsService>().logEvent( child: AddNewOrder(
eventCategory: "Add Reschedule" onTap: () async {
"Leave Screen", await locator<AnalyticsService>().logEvent(
eventAction: "apply For Reschedule", eventCategory: "Add Reschedule"
); "Leave Screen",
openLeave( eventAction: "apply For Reschedule",
context, );
false, openLeave(
); context,
}, false,
label: TranslationBase.of(context).applyForReschedule, );
},
label: TranslationBase.of(context).applyForReschedule,
),
), ),
Column( Column(
children: model.getReschduleLeave.map<Widget>((GetRescheduleLeavesResponse item) { children: model.getReschduleLeave.map<Widget>((GetRescheduleLeavesResponse item) {
return RoundedContainer( return Padding(
child: Column( padding: const EdgeInsets.all(8.0),
children: [ child: RoundedContainer(
Container( child: Column(
decoration: BoxDecoration( children: [
border: Border( Container(
left: BorderSide( decoration: BoxDecoration(
color: item.status == 10 border: Border(
? Colors.red[800] left: BorderSide(
: item.status == 2 color: item.status == 10
? HexColor('#CC9B14') ? Colors.red[800]
: item.status == 9 : item.status == 2
? Colors.green ? HexColor('#CC9B14')
: Colors.red, : item.status == 9
width: 5.0, ? Colors.green
))), : Colors.red,
padding: EdgeInsets.only(left: 10, right: 10), width: 5.0,
child: Row( ))),
mainAxisAlignment: MainAxisAlignment.start, padding: EdgeInsets.only(left: 10, right: 10),
children: <Widget>[ child: Row(
Expanded( mainAxisAlignment: MainAxisAlignment.start,
flex: 4, children: <Widget>[
child: Wrap( Expanded(
children: <Widget>[ flex: 4,
Column( child: Wrap(
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ Column(
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ crossAxisAlignment: CrossAxisAlignment.start,
Container( children: <Widget>[
padding: EdgeInsets.all(3), Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
margin: EdgeInsets.only(top: 10), Container(
child: AppText( padding: EdgeInsets.all(3),
item.statusDescription, margin: EdgeInsets.only(top: 10),
fontWeight: FontWeight.bold, child: AppText(
color: item.status == 10 item.statusDescription,
? Colors.red[800] fontWeight: FontWeight.bold,
: item.status == 2 color: item.status == 10
? HexColor('#CC9B14') ? Colors.red[800]
: item.status == 9 : item.status == 2
? Colors.green ? HexColor('#CC9B14')
: Colors.red, : item.status == 9
fontSize: 14, ? Colors.green
: Colors.red,
fontSize: 14,
),
), ),
Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
AppDateUtils.convertStringToDateFormat(
item.createdOn, 'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
))
]),
SizedBox(
height: 5,
), ),
Padding( Container(
padding: EdgeInsets.only(top: 10),
child: AppText( child: AppText(
AppDateUtils.convertStringToDateFormat( item.requisitionType == 1
item.createdOn, 'yyyy-MM-dd HH:mm'), ? TranslationBase.of(context).offTime
fontWeight: FontWeight.bold, : item.requisitionType == 2
)) ? TranslationBase.of(context).holiday
]), : item.requisitionType == 3
SizedBox( ? TranslationBase.of(context).changeOfSchedule
height: 5, : TranslationBase.of(context).newSchedule,
),
Container(
child: AppText(
item.requisitionType == 1
? TranslationBase.of(context).offTime
: item.requisitionType == 2
? TranslationBase.of(context).holiday
: item.requisitionType == 3
? TranslationBase.of(context).changeOfSchedule
: TranslationBase.of(context).newSchedule,
fontWeight: FontWeight.bold,
)),
SizedBox(
height: 5,
),
Row(children: [
AppText(TranslationBase.of(context).startDate),
AppText(
AppDateUtils.convertStringToDateFormat(
item.dateTimeFrom, 'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )),
SizedBox(
// overflow: height: 5,
// TextOverflow.ellipsis, ),
]), Row(children: [
AppText(TranslationBase.of(context).startDate),
// overflow:
// TextOverflow.ellipsis,
SizedBox(
height: 5,
),
Row(
children: [
AppText(TranslationBase.of(context).endDate),
AppText( AppText(
AppDateUtils.convertStringToDateFormat( AppDateUtils.convertStringToDateFormat(
item.dateTimeTo, 'yyyy-MM-dd HH:mm'), item.dateTimeFrom, 'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
],
),
SizedBox( // overflow:
height: 5, // TextOverflow.ellipsis,
), ]),
model.coveringDoctors.length > 0
? Row(children: [ // overflow:
AppText( // TextOverflow.ellipsis,
TranslationBase.of(context).coveringDoctor,
), SizedBox(
AppText( height: 5,
getDoctor(model.coveringDoctors, item.coveringDoctorId), ),
fontWeight: FontWeight.bold, Row(
) children: [
]) AppText(TranslationBase.of(context).endDate),
: SizedBox(), AppText(
// AppText( AppDateUtils.convertStringToDateFormat(
// TranslationBase.of(context) item.dateTimeTo, 'yyyy-MM-dd HH:mm'),
// .reasons, fontWeight: FontWeight.bold,
// fontWeight: FontWeight.bold, )
// ), ],
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ ),
Padding(
padding: EdgeInsets.only(bottom: 5), SizedBox(
child: AppText(getReasons(model.allReasons, item.reasonId))), height: 5,
(item.status == 2) ),
? IconButton( model.coveringDoctors.length > 0
icon: Image.asset('assets/images/edit.png'), ? Row(children: [
// color: Colors.green, //Colors.black, AppText(
onPressed: () => {openLeave(context, true, extendedData: item)}, TranslationBase.of(context).coveringDoctor,
) ),
AppText(
getDoctor(model.coveringDoctors, item.coveringDoctorId),
fontWeight: FontWeight.bold,
)
])
: SizedBox(), : SizedBox(),
]), // AppText(
], // TranslationBase.of(context)
), // .reasons,
SizedBox( // fontWeight: FontWeight.bold,
width: 10, // ),
), Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
], Padding(
padding: EdgeInsets.only(bottom: 5),
child: AppText(getReasons(model.allReasons, item.reasonId))),
(item.status == 2)
? IconButton(
icon: Image.asset('assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {openLeave(context, true, extendedData: item)},
)
: SizedBox(),
]),
],
),
SizedBox(
width: 10,
),
],
),
), ),
), ],
], )),
)), ],
], ),
), ),
); );
}).toList(), }).toList(),

@ -45,8 +45,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
var date; var date;
var doctorID; var doctorID;
var reason; var reason;
var fromDate; dynamic fromDate;
var toDate; dynamic toDate;
var clinicID; var clinicID;
String fromTime; String fromTime;
String toTime; String toTime;
@ -80,12 +80,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
} }
}); });
setState(() { // setState(() {
final df = new DateFormat('yyyy-MM-dd'); // final df = new DateFormat('yyyy-MM-dd');
fromDate = pickedDate; //df.format(); // fromDate = pickedDate; //df.format();
_toDateController.text = df.format(pickedDate); // //_toDateController2.text = df.format(pickedDate);
toDate = pickedDate; // //toDate = pickedDate;
}); // });
}); });
} }
@ -99,9 +99,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
offTime = widget.updateData != null offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime;
? widget.updateData.requisitionType.toString()
: offTime;
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>( builder: (_, model, w) => BaseView<SickLeaveViewModel>(
@ -248,22 +246,17 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: bottom: SizeConfig.widthMultiplier * 0.9,
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -271,34 +264,22 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.allOffTime.length > 0 model2.allOffTime.length > 0
? Expanded( ? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child: DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: DropdownButton(
child:
DropdownButton(
// focusColor: Colors.grey, // focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
value: offTime == null value: offTime == null ? model2.allOffTime[0]['code'] : offTime,
? model2.allOffTime[0]
['code']
: offTime,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder: (BuildContext context) {
(BuildContext return model2.allOffTime.map((item) {
context) {
return model2.allOffTime
.map((item) {
return Row( return Row(
mainAxisSize: mainAxisSize: MainAxisSize.max,
MainAxisSize
.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
item[ item['description'],
'description'],
fontSize: SizeConfig fontSize: SizeConfig.textMultiplier * 2.1,
.textMultiplier *
2.1,
// color: // color:
// Colors.grey, // Colors.grey,
), ),
@ -306,38 +287,27 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
); );
}).toList(); }).toList();
}, },
onChanged: (newValue) => { onChanged: (newValue) {
setState(() { setState(() {
offTime = newValue; offTime = newValue;
}), });
if (offTime == '1') if (offTime == '1') {
{ model2.getReasons(18);
model2 } else if (offTime == '2') {
.getReasons(18) model2.getReasons(19);
} } else if (offTime == '3' || offTime == '5') {
else if (offTime == '2') model2.getReasons(102);
{ setState(() {
model2 offTime = newValue;
.getReasons(19) });
} }
else if (offTime ==
'3' ||
offTime == '5')
{
model2
.getReasons(102)
}
}, },
items: model2.allOffTime items: model2.allOffTime.map((item) {
.map((item) { return DropdownMenuItem<String>(
return DropdownMenuItem< value: item['code'].toString(),
String>(
value: item['code']
.toString(),
child: Text( child: Text(
item['description'], item['description'],
textAlign: textAlign: TextAlign.end,
TextAlign.end,
), ),
); );
}).toList(), }).toList(),
@ -355,37 +325,24 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: TranslationBase.of( hintText: TranslationBase.of(context).fromDate,
context)
.fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(icon: Icon(Icons.calendar_today)),
icon: Icon(Icons textInputType: TextInputType.number,
.calendar_today)),
textInputType:
TextInputType.number,
controller: _toDateController, controller: _toDateController,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker('fromDate');
'fromDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (val) => onChanged: (val) => fromDate = val,
fromDate = val, onSaved: (val) => fromDate = val,
onSaved: (val) =>
fromDate = val,
) )
], ],
)), )),
@ -395,37 +352,24 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Container( child: Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all( border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
Radius.circular(
6.0)),
border: Border.all(
width: 1.0,
color: HexColor(
"#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
DateTimePicker( DateTimePicker(
timeHintText: timeHintText: TranslationBase.of(context).fromTime,
TranslationBase.of( type: DateTimePickerType.time,
context)
.fromTime,
type: DateTimePickerType
.time,
controller: _controller4, controller: _controller4,
onChanged: (val) => onChanged: (val) => fromTime = val,
fromTime = val,
validator: (val) { validator: (val) {
print(val); print(val);
// setState( // setState(
// () => _valueToValidate4 = val); // () => _valueToValidate4 = val);
return null; return null;
}, },
onSaved: (val) => onSaved: (val) => fromTime = val,
fromTime = val,
) )
], ],
), ),
@ -435,37 +379,24 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Container( child: Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all( border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
Radius.circular(
6.0)),
border: Border.all(
width: 1.0,
color: HexColor(
"#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
DateTimePicker( DateTimePicker(
timeHintText: timeHintText: TranslationBase.of(context).toTime,
TranslationBase.of( type: DateTimePickerType.time,
context)
.toTime,
type: DateTimePickerType
.time,
controller: _controller5, controller: _controller5,
onChanged: (val) => onChanged: (val) => toTime = val,
toTime = val,
validator: (val) { validator: (val) {
print(val); print(val);
// setState( // setState(
// () => _valueToValidate4 = val); // () => _valueToValidate4 = val);
return null; return null;
}, },
onSaved: (val) => onSaved: (val) => toTime = val,
toTime = val,
) )
], ],
), ),
@ -480,38 +411,26 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: hintText: TranslationBase.of(context).fromDate,
TranslationBase.of(
context)
.fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(icon: Icon(Icons.calendar_today)),
icon: Icon(Icons textInputType: TextInputType.number,
.calendar_today)), readOnly: true,
textInputType: controller: _toDateController,
TextInputType.number,
controller:
_toDateController,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker('fromDate');
'fromDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
toDate = value; fromDate = value;
}); });
}), }),
], ],
@ -519,33 +438,21 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: hintText: TranslationBase.of(context).toDate,
TranslationBase readOnly: true,
.of(context)
.toDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(icon: Icon(Icons.calendar_today)),
icon: Icon(Icons textInputType: TextInputType.number,
.calendar_today)), controller: _toDateController2,
textInputType:
TextInputType.number,
controller:
_toDateController2,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker('toDate');
'toDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
@ -560,22 +467,17 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: bottom: SizeConfig.widthMultiplier * 0.9,
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -583,39 +485,23 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.allReasons.length > 0 model2.allReasons.length > 0
? Expanded( ? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child: DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: DropdownButton(
child:
DropdownButton(
focusColor: Colors.grey, focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
value: reason == null value: model2.allReasons[0]['id'].toString() ?? "",
? model2.allReasons[0]
['id']
.toString()
: reason,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder: (BuildContext context) {
(BuildContext return model2.allReasons.map((item) {
context) {
return model2.allReasons
.map((item) {
return Row( return Row(
mainAxisSize: mainAxisSize: MainAxisSize.max,
MainAxisSize
.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
projectsProvider projectsProvider.isArabic
.isArabic ? item['nameAr']
? item[ : item['nameEn'],
'nameAr'] fontSize: SizeConfig.textMultiplier * 2.1,
: item[
'nameEn'],
fontSize: SizeConfig
.textMultiplier *
2.1,
// color: // color:
// Colors.grey, // Colors.grey,
), ),
@ -628,20 +514,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
reason = newValue; reason = newValue;
}) })
}, },
items: model2.allReasons items: model2.allReasons.map((item) {
.map((item) { return DropdownMenuItem<String>(
return DropdownMenuItem< value: item['id'].toString(),
String>(
value: item['id']
.toString(),
child: Text( child: Text(
projectsProvider projectsProvider.isArabic ? item['nameAr'] : item['nameEn'],
.isArabic textAlign: TextAlign.end,
? item['nameAr']
: item[
'nameEn'],
textAlign:
TextAlign.end,
), ),
); );
}).toList(), }).toList(),
@ -657,22 +535,17 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: bottom: SizeConfig.widthMultiplier * 0.9,
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -683,69 +556,35 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: DropdownSearch( child: DropdownSearch(
mode: Mode.BOTTOM_SHEET, mode: Mode.BOTTOM_SHEET,
dropdownSearchDecoration: dropdownSearchDecoration: InputDecoration(
InputDecoration( contentPadding: EdgeInsets.all(0), border: InputBorder.none),
contentPadding:
EdgeInsets
.all(0),
border:
InputBorder
.none),
//maxHeight: 300, //maxHeight: 300,
items: model2 items: model2.coveringDoctors.map((item) {
.coveringDoctors return projectsProvider.isArabic
.map((item) { ? item['doctorNameN']
return projectsProvider : item['doctorName'];
.isArabic
? item[
'doctorNameN']
: item[
'doctorName'];
}).toList(), }).toList(),
// label: "Doctor List", // label: "Doctor List",
onChanged: (item) { onChanged: (item) {
model2.coveringDoctors model2.coveringDoctors.forEach((newVal) => {
.forEach( if (newVal['doctorName'] == item)
(newVal) => { doctorID = newVal['DoctorID']
if (newVal['doctorName'] == });
item ||
newVal['doctorName'] ==
item)
{
doctorID =
newVal['DoctorID']
}
});
}, },
selectedItem: selectedItem: getSelectedDoctor(model2),
getSelectedDoctor(
model2),
showSearchBox: true, showSearchBox: true,
searchBoxDecoration: searchBoxDecoration: InputDecoration(
InputDecoration( border: OutlineInputBorder(),
border: contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0),
OutlineInputBorder(), labelText: "Search Doctor",
contentPadding:
EdgeInsets.fromLTRB(
12, 12, 8, 0),
labelText:
"Search Doctor",
), ),
popupTitle: Container( popupTitle: Container(
height: 50, height: 50,
decoration: decoration: BoxDecoration(
BoxDecoration( color: Theme.of(context).primaryColorDark,
color: Theme.of( borderRadius: BorderRadius.only(
context) topLeft: Radius.circular(20),
.primaryColorDark, topRight: Radius.circular(20),
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(
20),
topRight:
Radius.circular(
20),
), ),
), ),
child: Center( child: Center(
@ -753,25 +592,16 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
'', '',
style: TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
fontWeight: fontWeight: FontWeight.bold,
FontWeight color: Colors.white,
.bold,
color:
Colors.white,
), ),
), ),
), ),
), ),
popupShape: popupShape: RoundedRectangleBorder(
RoundedRectangleBorder( borderRadius: BorderRadius.only(
borderRadius: topLeft: Radius.circular(24),
BorderRadius.only( topRight: Radius.circular(24),
topLeft:
Radius.circular(
24),
topRight:
Radius.circular(
24),
), ),
), ),
), ),
@ -845,17 +675,14 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
)), )),
SizedBox(height: SizeConfig.screenHeight * .3), SizedBox(height: SizeConfig.screenHeight * .3),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: widget.isUpdate == true title: widget.isUpdate == true
? TranslationBase.of(context) ? TranslationBase.of(context).updateReschedule
.updateReschedule : TranslationBase.of(context).addReschedule,
: TranslationBase.of(context)
.addReschedule,
color: HexColor('#359846'), color: HexColor('#359846'),
onPressed: () { onPressed: () {
if (offTime == '1' || offTime == '2') { if (offTime == '1' || offTime == '2') {
@ -865,9 +692,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
addRecheduleLeave(model2); addRecheduleLeave(model2);
} }
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday);
TranslationBase.of(context)
.onlyOfftimeHoliday);
} }
}, },
), ),
@ -900,16 +725,13 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
final df = new DateFormat('HH:mm:ss'); final df = new DateFormat('HH:mm:ss');
final dateFormat = new DateFormat('yyyy-MM-dd'); final dateFormat = new DateFormat('yyyy-MM-dd');
this.offTime = widget.updateData.requisitionType.toString(); this.offTime = widget.updateData.requisitionType.toString();
_toDateController.text = _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom));
dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom));
//df.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom));
df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3);
this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo));
this.toTime = this.toTime.substring(0, this.toTime.length - 3); this.toTime = this.toTime.substring(0, this.toTime.length - 3);
_toDateController2.text = _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
_controller5.text = toTime; _controller5.text = toTime;
_controller4.text = fromTime; _controller4.text = fromTime;
toDate = _toDateController2.text; toDate = _toDateController2.text;
@ -922,8 +744,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
getClinicName(model) { getClinicName(model) {
var clinicID = this.profile['ClinicID'] ?? 1; var clinicID = this.profile['ClinicID'] ?? 1;
var clinicInfo = var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
} }
@ -933,16 +754,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
var fromDates = fromDate; var fromDates = fromDate;
var toDates = toDate; var toDates = toDate;
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + fromDate = df.format(
'T' + DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString()));
fromTime + toDate = df
':' + .format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString()));
DateTime.now().second.toString()));
toDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
'T' +
toTime +
':' +
DateTime.now().second.toString()));
} else { } else {
fromDate = df.format(fromDates); fromDate = df.format(fromDates);
toDate = df.format(toDates); toDate = df.format(toDates);
@ -957,8 +772,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"dateTimeTo": toDate, "dateTimeTo": toDate,
"date": offTime == '1' ? fromDate : df.format(DateTime.now()), "date": offTime == '1' ? fromDate : df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
"status": 2, "status": 2,
"schedule": [ "schedule": [
{ {
@ -981,10 +795,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(), builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
settings: RouteSettings(name: 'AddRescheduleLeaveScreen') // MyReferredPatient(),
// MyReferredPatient(), ),
),
); );
} }
}); });
@ -993,22 +806,17 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
updateRecheduleLeave(model) { updateRecheduleLeave(model) {
// final df = new DateFormat('yyyy-MM-ddTHH:MM:ss'); // final df = new DateFormat('yyyy-MM-ddTHH:MM:ss');
final df = new DateFormat('yyyy-MM-dd'); final df = new DateFormat('yyyy-MM-dd');
var fromDates = fromDate; String dataS = DateTime.now().toIso8601String();
var toDates = toDate; dynamic fromDates = fromDate;
dynamic toDates = toDate;
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format(DateTime.parse(_toDateController.text)) + fromDate =
'T' + df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString();
fromTime + toDate =
':' + df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString();
DateTime.now().second.toString();
toDate = df.format(DateTime.parse(_toDateController.text)) +
'T' +
toTime +
':' +
DateTime.now().second.toString();
} else { } else {
fromDate = df.format(fromDates); fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates));
toDate = df.format(toDates); toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates));
} }
Map<String, dynamic> request = { Map<String, dynamic> request = {
@ -1021,8 +829,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"dateTimeTo": toDate, "dateTimeTo": toDate,
"date": offTime == '1' ? fromDate : df.format(DateTime.now()), "date": offTime == '1' ? fromDate : df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId": "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
"status": 2, "status": 2,
"schedule": [ "schedule": [
{ {
@ -1045,9 +852,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(), builder: (context) => AddRescheduleLeavScreen(),
settings: RouteSettings(name: 'AddRescheduleLeaveScreen') settings: RouteSettings(name: 'AddRescheduleLeaveScreen')),
),
); );
} }
}); });
@ -1061,8 +867,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
: model2.coveringDoctors[0]['doctorName']; : model2.coveringDoctors[0]['doctorName'];
else { else {
model2.coveringDoctors.forEach((newVal) => { model2.coveringDoctors.forEach((newVal) => {
if (newVal['doctorID'].toString() == doctorID) if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']}
{doctorName = newVal['doctorName']}
}); });
return doctorName; return doctorName;
} }

@ -46,7 +46,7 @@ class TextFieldsUtils{
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
),*/ ),*/
hintText: selectedText != null ? selectedText : hintText, hintText: selectedText != null ? selectedText : hintText??"",
suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,), suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,),
hintStyle: TextStyle( hintStyle: TextStyle(

@ -9,9 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder {
final Widget widget; final Widget widget;
final bool fullscreenDialog; final bool fullscreenDialog;
final bool opaque; final bool opaque;
final String settingRoute;
SlideUpPageRoute( SlideUpPageRoute({this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute})
{this.widget, this.fullscreenDialog = false, this.opaque = true})
: super( : super(
pageBuilder: ( pageBuilder: (
BuildContext context, BuildContext context,
@ -24,21 +24,17 @@ class SlideUpPageRoute extends PageRouteBuilder {
opaque: opaque, opaque: opaque,
barrierColor: Color.fromRGBO(0, 0, 0, 0.5), barrierColor: Color.fromRGBO(0, 0, 0, 0.5),
barrierDismissible: true, barrierDismissible: true,
settings: RouteSettings(name: widget.runtimeType.toString()), settings: RouteSettings(name: settingRoute ?? widget.runtimeType.toString()),
transitionDuration: Duration(milliseconds: 800), transitionDuration: Duration(milliseconds: 800),
transitionsBuilder: ((BuildContext context, transitionsBuilder:
Animation<double> animation, ((BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
Animation<double> secondaryAnimation,
Widget child) {
var begin = Offset(0.0, 1.0); var begin = Offset(0.0, 1.0);
var end = Offset.zero; var end = Offset.zero;
var curve = Curves.easeInOutQuint; var curve = Curves.easeInOutQuint;
var tween = var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
return SlideTransition( return SlideTransition(position: animation.drive(tween), child: child);
position: animation.drive(tween), child: child);
}), }),
); );
} }

@ -692,7 +692,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -1026,7 +1026,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1231,5 +1231,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.2 <=2.11.0-213.1.beta" dart: ">=2.10.2 <2.11.0"
flutter: ">=1.22.2 <2.0.0" flutter: ">=1.22.2 <2.0.0"

Loading…
Cancel
Save