first step form sick leave

merge-requests/847/head
Elham Rababh 4 years ago
parent 0ab0570bc6
commit aaca94e93c

@ -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";

@ -11,9 +11,11 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.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/patients/profile/add-order/addNewOrder.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/shared/errors/error_message.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:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -56,250 +58,184 @@ class AddSickLeavScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: SizeConfig.isHeightVeryShort?30:SizeConfig.isHeightShort?35: 10,),
if (!projectsProvider.isArabic) if (!projectsProvider.isArabic)
AppText(
TranslationBase.of(context).patient,
fontWeight: FontWeight.bold,
),
AppText( AppText(
TranslationBase.of(context).sickLeave, TranslationBase.of(context).patient,
fontSize: 24, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4),
fontWeight: FontWeight.w700,
letterSpacing:-0.72,
color: Color(0xFF2E303A),
),
AppText(TranslationBase.of(context).sickLeave,
fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 6: 6),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing:-1.44,
color: Color(0xFF2E303A),
), ),
], ],
)), )),
InkWell(
onTap: () async { AddNewOrder(label: TranslationBase.of(context)
await locator<AnalyticsService>().logEvent( .noSickLeaveApplied, onTap: () async {
eventCategory: "Add Sick Leave Screen" await locator<AnalyticsService>().logEvent(
"Leave Screen", eventCategory: "Add Sick Leave Screen"
eventAction: "apply For Sick Leave", "Leave Screen",
); eventAction: "apply For Sick Leave",
openSickLeave( );
context, openSickLeave(
false, context,
); false,
}, );
child: Container( }),
width: SizeConfig.screenWidth,
margin: EdgeInsets.only(
left: 20, right: 20, top: 10, bottom: 10),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
child: Container(
decoration: BoxDecoration(
color: Colors.grey,
borderRadius:
BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
color: Colors.white,
),
// onPressed: () {
// openSickLeave(
// context,
// false,
// );
// },
),
)),
Padding(
child: AppText(
TranslationBase.of(context)
.noSickLeaveApplied,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 16,
textAlign: TextAlign.center,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
],
)),
),
], ],
) )
: SizedBox(), : SizedBox(),
model.getAllSIckLeavePatient.length > 0 model.getAllSIckLeavePatient.length > 0
? Column( ? ListView.builder(
children: model.getAllSIckLeavePatient scrollDirection: Axis.vertical,
.map<Widget>((SickLeavePatientModel item) { shrinkWrap: true,
return RoundedContainer( itemCount: model.getAllSIckLeavePatient.length,
margin: EdgeInsets.all(10), itemBuilder: (BuildContext ctxt, int index) {
child: Column( var item = model.getAllSIckLeavePatient[index];
children: [ return Container(
Container( padding: EdgeInsets.all(10),
// decoration: BoxDecoration( child: Row(
// border: Border( mainAxisAlignment:
// left: BorderSide( MainAxisAlignment.start,
// // color: item.status == 1 children: <Widget>[
// // ? Colors.yellow[800] Expanded(
// // : item.status == 2 flex: 4,
// // ? Colors.green child: Wrap(
// // : Colors.black, // mainAxisAlignment:
// color: Colors.red, // MainAxisAlignment.start,
// width: 5.0,
// ))),
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Column(
flex: 4, crossAxisAlignment:
child: Wrap( CrossAxisAlignment.start,
// mainAxisAlignment: children: <Widget>[
// MainAxisAlignment.start, Container(
children: <Widget>[ padding: EdgeInsets.all(3),
Column( child: AppText(
crossAxisAlignment: item = model.getAllSIckLeavePatient[index].doctorName ?? "",
CrossAxisAlignment.start, // item.status == 1
children: <Widget>[ // ? TranslationBase.of(
Container( // context)
padding: EdgeInsets.all(3), // .hold
child: AppText( // : item.status == 2
item.doctorName ?? "", // ? TranslationBase
// item.status == 1 // .of(
// ? TranslationBase.of( // context)
// context) // .active
// .hold // : TranslationBase
// : item.status == 2 // .of(context)
// ? TranslationBase // .all,
// .of( fontWeight:
// context) FontWeight.bold,
// .active // color: item.status == 1
// : TranslationBase // ? Colors.yellow[800]
// .of(context) // : item.status == 2
// .all, // ? Colors.green
fontWeight: // : Colors.black,
FontWeight.bold, color: Colors.red,
// color: item.status == 1 ),
// ? Colors.yellow[800] ),
// : item.status == 2 Row(
// ? Colors.green children: [
// : Colors.black, AppText(TranslationBase
color: Colors.red, .of(context)
), .daysSickleave +
), ": "),
Row( AppText(
children: [ (item.sickLeaveDays
AppText(TranslationBase .toString() !=
.of(context) null &&
.daysSickleave + item.sickLeaveDays
": "), .toString() !=
AppText( "null")
(item.sickLeaveDays ? item.sickLeaveDays
.toString() != .toString()
null && : item.noOfDays
item.sickLeaveDays .toString(),
.toString() != fontWeight:
"null") FontWeight.bold,
? item.sickLeaveDays ),
.toString() ],
: item.noOfDays ),
.toString(), Row(
fontWeight: children: [
FontWeight.bold, AppText(
), TranslationBase.of(
], context)
), .startDate +
Row( ' ' ??
children: [ "",
AppText( ),
TranslationBase.of( Flexible(
context) child: AppText(
.startDate + AppDateUtils.getDayMonthYearDateFormatted(item
' ' ?? .startDate
"", .contains(
), "/Date(")
Flexible( ? AppDateUtils
child: AppText( .convertStringToDate(item
AppDateUtils.getDayMonthYearDateFormatted(item .startDate)
.startDate : DateTime.parse(
.contains( item.startDate)),
"/Date(") fontWeight:
? AppDateUtils FontWeight.bold,
.convertStringToDate(item
.startDate)
: DateTime.parse(
item.startDate)),
fontWeight:
FontWeight.bold,
),
)
],
), ),
Row( )
children: [ ],
AppText( ),
TranslationBase.of( Row(
context) children: [
.endDate + AppText(
' ' ?? TranslationBase.of(
"", context)
), .endDate +
Flexible( ' ' ??
child: AppText( "",
AppDateUtils.getDayMonthYearDateFormatted(item ),
.startDate Flexible(
.contains( child: AppText(
"/Date(") AppDateUtils.getDayMonthYearDateFormatted(item
? AppDateUtils.convertStringToDate( .startDate
item.endDate ?? .contains(
"") "/Date(")
.add(Duration( ? AppDateUtils.convertStringToDate(
days: item.noOfDays ?? item.endDate ??
item "")
.sickLeaveDays)) .add(Duration(
: DateTime.parse( days: item.noOfDays ??
item.startDate ?? "") item
.add(Duration(days: item.noOfDays ?? ""))), .sickLeaveDays))
fontWeight: : DateTime.parse(
FontWeight.bold, item.startDate ?? "")
), .add(Duration(days: item.noOfDays ?? ""))),
) fontWeight:
], FontWeight.bold,
), ),
], )
), ],
SizedBox( ),
width: 20, ],
), ),
], SizedBox(
), width: 20,
), ),
], ],
)), ),
], ),
)); ],
}).toList(), ));
) })
: patient.patientStatusType != 43 : patient.patientStatusType != 43
? Center( ? ErrorMessage(
child: Column( error: TranslationBase.of(context)
crossAxisAlignment: CrossAxisAlignment.center, .noSickLeave,
children: [ )
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).noSickLeave),
)
],
),
)
: SizedBox() : SizedBox()
])))); ]))));
} }

Loading…
Cancel
Save