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,20 +58,27 @@ 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( AppText(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
fontWeight: FontWeight.bold, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4),
fontWeight: FontWeight.w700,
letterSpacing:-0.72,
color: Color(0xFF2E303A),
), ),
AppText( AppText(TranslationBase.of(context).sickLeave,
TranslationBase.of(context).sickLeave, fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 6: 6),
fontSize: 24,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing:-1.44,
color: Color(0xFF2E303A),
), ),
], ],
)), )),
InkWell(
onTap: () async { AddNewOrder(label: TranslationBase.of(context)
.noSickLeaveApplied, onTap: () async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "Add Sick Leave Screen" eventCategory: "Add Sick Leave Screen"
"Leave Screen", "Leave Screen",
@ -79,76 +88,18 @@ class AddSickLeavScreen extends StatelessWidget {
context, context,
false, 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(
// decoration: BoxDecoration(
// border: Border(
// left: BorderSide(
// // color: item.status == 1
// // ? Colors.yellow[800]
// // : item.status == 2
// // ? Colors.green
// // : Colors.black,
// color: Colors.red,
// width: 5.0,
// ))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
@ -167,7 +118,7 @@ class AddSickLeavScreen extends StatelessWidget {
Container( Container(
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
child: AppText( child: AppText(
item.doctorName ?? "", item = model.getAllSIckLeavePatient[index].doctorName ?? "",
// item.status == 1 // item.status == 1
// ? TranslationBase.of( // ? TranslationBase.of(
// context) // context)
@ -278,27 +229,12 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
), ),
], ],
)),
],
)); ));
}).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