doctor leave

merge-requests/214/head
Sultan Khan 4 years ago
parent 669655307a
commit 3c968f0de1

Binary file not shown.

@ -0,0 +1,7 @@
<svg id="enter" xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 42 42">
<path id="Path_1146" data-name="Path 1146" d="M17.938,210.625H1.313a1.313,1.313,0,1,1,0-2.625H17.938a1.313,1.313,0,1,1,0,2.625Zm0,0" transform="translate(22.749 -190.938)"/>
<path id="Path_1147" data-name="Path 1147" d="M123.984,143.736a1.313,1.313,0,0,1-.928-2.242l5.635-5.635-5.635-5.633a1.313,1.313,0,0,1,1.857-1.857l6.563,6.562a1.313,1.313,0,0,1,0,1.857l-6.562,6.562A1.31,1.31,0,0,1,123.984,143.736Zm0,0" transform="translate(-89.86 -117.486)"/>
<path id="Path_1148" data-name="Path 1148" d="M312.668,42.076a3.5,3.5,0,0,0,3.5-3.5V7.076A3.522,3.522,0,0,0,313.8,3.753L303.284.248a3.537,3.537,0,0,0-4.616,3.329v31.5a3.524,3.524,0,0,0,2.368,3.321L311.553,41.9A3.662,3.662,0,0,0,312.668,42.076ZM302.168,2.7a1.03,1.03,0,0,1,.313.046l10.47,3.491a.9.9,0,0,1,.592.838v31.5a.922.922,0,0,1-1.188.83l-10.47-3.491a.905.905,0,0,1-.591-.838V3.576A.876.876,0,0,1,302.168,2.7Zm0,0" transform="translate(-298.668 -0.076)"/>
<path id="Path_1149" data-name="Path 1149" d="M195.168,8.75a1.313,1.313,0,0,0,1.313-1.312V4.813A4.816,4.816,0,0,0,191.668,0H171.98a1.313,1.313,0,0,0,0,2.625h19.688a2.19,2.19,0,0,1,2.187,2.188V7.438A1.313,1.313,0,0,0,195.168,8.75Zm0,0" transform="translate(-168.48)"/>
<path id="Path_1150" data-name="Path 1150" d="M171.98,350.082h7a4.816,4.816,0,0,0,4.812-4.813v-2.625a1.313,1.313,0,0,0-2.625,0v2.625a2.19,2.19,0,0,1-2.187,2.188h-7a1.313,1.313,0,0,0,0,2.625Zm0,0" transform="translate(-155.793 -313.332)"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL = 'https://hmgwebservices.com/';
//const BASE_URL = 'https://uat.hmgwebservices.com/';
//const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL =
@ -109,9 +109,10 @@ const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves';
const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave';
const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const GET_COVERING_DOCTORS =
'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
const GET_RESCHEDULE_LEAVE =
'Services/DoctorApplication.svc/REST/GetAllSickLeaves';
'Services/DoctorApplication.svc/REST/GetRequisition';
const GET_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/GetPrescription';

@ -386,4 +386,8 @@ const Map<String, Map<String, String>> localizedValues = {
'fio2': {'en': "FIO2(%)", 'ar': 'FIO2(%)'},
'sao2': {'en': "SAO2(%)", 'ar': 'SAO2(%)'},
'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'},
'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'},
'to': {'en': "To", 'ar': 'إلى'},
'coveringDoctor': {'en': "Covering Doctor", 'ar': 'تغطية دكتور'},
'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'}
};

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
@ -8,11 +9,18 @@ import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.d
class SickLeaveService extends BaseService {
Map get sickLeavestatisitics => _statistics;
Map _statistics = {};
var offTime = [];
get getOffTimeList => offTime;
List get getOffTimeList => offTime;
List offTime = [];
List get getReasons => reasonse;
List reasonse = [];
List<GetAllSickLeaveResponse> get getAllSickLeave => _getAllsickLeave;
List<GetAllSickLeaveResponse> _getAllsickLeave = [];
List get coveringDoctorsList => _coveringDoctors;
List _coveringDoctors = [];
List<GetRescheduleLeavesResponse> get getAllRescheduleLeave =>
_getReScheduleLeave;
List<GetRescheduleLeavesResponse> _getReScheduleLeave = [];
Future getStatistics(appoNo, patientMRN) async {
hasError = false;
await baseAppClient.post(
@ -38,7 +46,7 @@ class SickLeaveService extends BaseService {
ADD_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
print(response);
//print(response);
// _statistics = {};
// _statistics = response['SickLeaveStatistics'];
},
@ -99,16 +107,16 @@ class SickLeaveService extends BaseService {
GET_RESCHEDULE_LEAVE,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
_getAllsickLeave.clear();
// response['SickLeavesList']['entityList'].forEach((v) {
// _getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v));
// });
_getReScheduleLeave.clear();
response['requisitionList']['entityList'].forEach((v) {
_getReScheduleLeave.add(GetRescheduleLeavesResponse.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {'PatientMRN': 3120772},
body: {'ClinicID': 1},
);
}
@ -119,7 +127,7 @@ class SickLeaveService extends BaseService {
GET_OFFTIME,
onSuccess: (dynamic response, int statusCode) {
offTime = [];
offTime = response[' '];
offTime = response['MasterLookUpList']['entityList'];
},
onFailure: (String error, int statusCode) {
hasError = true;
@ -129,20 +137,37 @@ class SickLeaveService extends BaseService {
);
}
Future getReasons(id) async {
Future getReasonsByID({id}) async {
hasError = false;
await baseAppClient.post(
GET_OFFTIME,
onSuccess: (dynamic response, int statusCode) {
offTime = [];
offTime = response[' '];
reasonse = [];
reasonse = response['MasterLookUpList']['entityList'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {"MasterInput": id ?? 18},
);
}
Future getCoveringDoctors() async {
hasError = false;
await baseAppClient.post(
GET_COVERING_DOCTORS,
onSuccess: (dynamic response, int statusCode) {
_coveringDoctors = [];
_coveringDoctors = response['coveringDoctorList']['entityList'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {"MasterInput": id},
body: {"ClinicID": 1},
);
}
}

@ -0,0 +1,52 @@
class GetRescheduleLeavesResponse {
int clinicId;
var coveringDoctorId;
String date;
String dateTimeFrom;
String dateTimeTo;
int doctorId;
int reasonId;
int requisitionNo;
int requisitionType;
int status;
GetRescheduleLeavesResponse(
{this.clinicId,
this.coveringDoctorId,
this.date,
this.dateTimeFrom,
this.dateTimeTo,
this.doctorId,
this.reasonId,
this.requisitionNo,
this.requisitionType,
this.status});
GetRescheduleLeavesResponse.fromJson(Map<String, dynamic> json) {
clinicId = json['clinicId'];
coveringDoctorId = json['coveringDoctorId'];
date = json['date'];
dateTimeFrom = json['dateTimeFrom'];
dateTimeTo = json['dateTimeTo'];
doctorId = json['doctorId'];
reasonId = json['reasonId'];
requisitionNo = json['requisitionNo'];
requisitionType = json['requisitionType'];
status = json['status'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['clinicId'] = this.clinicId;
data['coveringDoctorId'] = this.coveringDoctorId;
data['date'] = this.date;
data['dateTimeFrom'] = this.dateTimeFrom;
data['dateTimeTo'] = this.dateTimeTo;
data['doctorId'] = this.doctorId;
data['reasonId'] = this.reasonId;
data['requisitionNo'] = this.requisitionNo;
data['requisitionType'] = this.requisitionType;
data['status'] = this.status;
return data;
}
}

@ -49,7 +49,7 @@ class PatientViewModel extends BaseViewModel {
List<dynamic> get referralFrequencyList =>
_patientService.referalFrequancyList;
Future getPatientList( patient, patientType,
Future getPatientList(patient, patientType,
{bool isBusyLocal = false}) async {
if (isBusyLocal) {
setState(ViewState.BusyLocal);

@ -12,7 +12,10 @@ class SickLeaveViewModel extends BaseViewModel {
SickLeaveService _sickLeaveService = locator<SickLeaveService>();
get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics;
get getAllSIckLeave => _sickLeaveService.getAllSickLeave;
get allOffTime => _sickLeaveService.getOffTimeList;
List get allOffTime => _sickLeaveService.getOffTimeList;
List get allReasons => _sickLeaveService.getReasons;
List get coveringDoctors => _sickLeaveService.coveringDoctorsList;
get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave;
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.Busy);
await _sickLeaveService.addSickLeave(addSickLeaveRequest);
@ -75,7 +78,17 @@ class SickLeaveViewModel extends BaseViewModel {
Future getReasons(id) async {
setState(ViewState.Busy);
await _sickLeaveService.getReasons(id);
await _sickLeaveService.getReasonsByID(id: id);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getCoveringDoctors() async {
setState(ViewState.Busy);
await _sickLeaveService.getCoveringDoctors();
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);

@ -384,6 +384,34 @@
"sync"
]
},
{
"uid": "a0f7dbb184f90f285a9cba8cf09a9b6a",
"css": "drawer_icon",
"code": 59429,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1564.7 1000H68C30.6 1000 0 958.7 0 908.2H0C0 857.6 30.6 816.3 68 816.3H1564.7C1602 816.3 1632.7 857.6 1632.7 908.2H1632.7C1632.7 958.7 1602 1000 1564.7 1000ZM911.6 591.8H68C30.6 591.8 0 550.5 0 500H0C0 449.5 30.6 408.2 68 408.2H911.6C949 408.2 979.6 449.5 979.6 500H979.6C979.6 550.5 949 591.8 911.6 591.8ZM1238.1 183.7H68C30.6 183.7 0 142.4 0 91.8H0C0 41.3 30.6 0 68 0H1238.1C1275.5 0 1306.1 41.3 1306.1 91.8H1306.1C1306.1 142.4 1275.5 183.7 1238.1 183.7Z",
"width": 1633
},
"search": [
"drawer_icon"
]
},
{
"uid": "764baf138776221a3e1e845391b188a4",
"css": "leaves",
"code": 59446,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M968.7 468.7H572.9A31.3 31.3 0 1 1 572.9 406.2H968.7A31.3 31.3 0 1 1 968.7 468.7ZM968.7 468.7M812.5 625A31.3 31.3 0 0 1 790.4 571.6L924.5 437.5 790.4 303.3A31.3 31.3 0 0 1 834.6 259.1L990.9 415.4A31.3 31.3 0 0 1 990.9 459.6L834.6 615.8A31.2 31.2 0 0 1 812.5 625ZM812.5 625M333.3 1000A83.3 83.3 0 0 0 416.7 916.7V166.7A83.9 83.9 0 0 0 360.3 87.5L109.9 4.1A84.2 84.2 0 0 0 0 83.4V833.4A83.9 83.9 0 0 0 56.4 912.4L306.8 995.8A87.2 87.2 0 0 0 333.3 1000ZM83.3 62.5A24.5 24.5 0 0 1 90.8 63.6L340.1 146.7A21.4 21.4 0 0 1 354.2 166.6V916.6A22 22 0 0 1 325.9 936.4L76.6 853.3A21.5 21.5 0 0 1 62.5 833.3V83.3A20.9 20.9 0 0 1 83.3 62.5ZM83.3 62.5M635.4 208.3A31.3 31.3 0 0 0 666.7 177.1V114.6A114.7 114.7 0 0 0 552.1 0H83.3A31.3 31.3 0 0 0 83.3 62.5H552.1A52.1 52.1 0 0 1 604.2 114.6V177.1A31.3 31.3 0 0 0 635.4 208.3ZM635.4 208.3M385.4 875H552.1A114.7 114.7 0 0 0 666.6 760.4V697.9A31.3 31.3 0 0 0 604.1 697.9V760.4A52.1 52.1 0 0 1 552.1 812.5H385.4A31.3 31.3 0 0 0 385.4 875ZM385.4 875",
"width": 1000
},
"search": [
"leaves"
]
},
{
"uid": "740f78c2b53c8cc100a8b0d283bbd34f",
"css": "home_icon-1",
@ -481,19 +509,6 @@
"search": [
"scdedule_icon_active"
]
}, {
"uid": "a0f7dbb184f90f285a9cba8cf09a9b6a",
"css": "drawer_icon",
"code": 59429,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1564.7 1000H68C30.6 1000 0 958.7 0 908.2H0C0 857.6 30.6 816.3 68 816.3H1564.7C1602 816.3 1632.7 857.6 1632.7 908.2H1632.7C1632.7 958.7 1602 1000 1564.7 1000ZM911.6 591.8H68C30.6 591.8 0 550.5 0 500H0C0 449.5 30.6 408.2 68 408.2H911.6C949 408.2 979.6 449.5 979.6 500H979.6C979.6 550.5 949 591.8 911.6 591.8ZM1238.1 183.7H68C30.6 183.7 0 142.4 0 91.8H0C0 41.3 30.6 0 68 0H1238.1C1275.5 0 1306.1 41.3 1306.1 91.8H1306.1C1306.1 142.4 1275.5 183.7 1238.1 183.7Z",
"width": 1633
},
"search": [
"drawer_icon"
]
}
]
}

@ -11,7 +11,7 @@
/// fonts:
/// - asset: fonts/DoctorApp.ttf
///
///
///
///
import 'package:flutter/widgets.dart';
@ -19,35 +19,64 @@ class DoctorApp {
DoctorApp._();
static const _kFontFam = 'DoctorApp';
static const _kFontPkg = null;
static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData reject_icon = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon_active = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon_active = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon_active = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData scdedule_icon_active = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData schedule_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData discharge_patient = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData approved_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData pending_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData in_patient_white = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData lab_results = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData operations = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData out_patient = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData patient = IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData radiology = IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData medicine_search = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData qr_code = IconData(0xe820, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referral = IconData(0xe821, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referred = IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_patient = IconData(0xe823, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData sync_icon = IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData drawer_icon = IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const String _kFontPkg = null;
static const IconData female_icon =
IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData male =
IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData reject_icon =
IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon_active =
IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon =
IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon_active =
IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon =
IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon_active =
IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData scdedule_icon_active =
IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData schedule_icon =
IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData discharge_patient =
IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData approved_icon =
IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData pending_icon =
IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData in_patient_white =
IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData lab_results =
IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon =
IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData operations =
IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData out_patient =
IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData patient =
IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData qr_code =
IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData radiology =
IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referral =
IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_patient =
IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData mail =
IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData medicine_search =
IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referred =
IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData sync_icon =
IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData drawer_icon =
IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData leaves =
IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}

@ -964,9 +964,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
Icons.rule_folder,
DoctorApp.leaves,
size: 50,
color: Colors.black,
),
AppText(
TranslationBase.of(context).rescheduleLeaves,

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.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/icons_app/doctor_app_icons.dart';
@ -8,6 +10,7 @@ import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.da
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.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_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:flutter/material.dart';
@ -17,119 +20,179 @@ class AddRescheduleLeavScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<SickLeaveViewModel>(
onModelReady: (model) => model.getRescheduleLeave(),
onModelReady: (model) =>
{model.getRescheduleLeave(), model.getCoveringDoctors()},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: model.getAllSIckLeave.length > 0
body: model.getReschduleLeave.length > 0
? SingleChildScrollView(
child: Column(
children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) {
return CardWithBgWidgetNew(
widget: Column(
children: [
Container(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 4,
child: Wrap(
// mainAxisAlignment:
// MainAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 20),
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: [
AppTextFormField(
hintText:
TranslationBase.of(context).requestLeave,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
Icons.add_circle,
color: Colors.red,
)),
textInputType: TextInputType.text,
onTap: () {
openLeave(
context,
false,
);
},
inputFormatter: ONLY_LETTERS,
)
],
),
),
Column(
children: model.getReschduleLeave.map<Widget>(
(GetRescheduleLeavesResponse item) {
return CardWithBgWidgetNew(
widget: Column(
children: [
Container(
padding:
EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 4,
child: Wrap(
children: <Widget>[
Container(
padding: EdgeInsets.all(3),
child: AppText(
item.status == 1
? TranslationBase.of(
context)
.approved
: item.status == 2
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding:
EdgeInsets.all(3),
child: AppText(
item.status == 1
? TranslationBase
.of(context)
.extended
: TranslationBase
.of(context)
.pending,
fontWeight: FontWeight.bold,
color: Colors.white,
),
color: item.status == 1
? Colors.green
: Colors.yellow[800],
),
Row(
children: [
AppText(
.approved
: item.status == 2
? TranslationBase.of(
context)
.pending
: TranslationBase.of(
context)
.rejected,
fontWeight:
FontWeight.bold,
color: Colors.white,
),
color: item.status == 1
? Colors.green
: item.status == 2
? Colors
.yellow[800]
: Colors.red[800],
),
SizedBox(
height: 5,
),
Container(
child: AppText(
TranslationBase.of(
context)
.leaveStartDate +
.holiday +
' ',
fontWeight:
FontWeight.bold,
)),
Row(
children: [
Flexible(
child: Text(
item.dateTimeFrom +
' ' +
TranslationBase.of(
context)
.to +
' ' +
item.dateTimeTo,
// overflow:
// TextOverflow.ellipsis,
))
],
),
Flexible(
child: Text(
item.startDate,
overflow:
TextOverflow.ellipsis,
))
],
),
AppText(
item.noOfDays.toString() +
' ' +
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(
context)
.daysSickleave,
fontWeight: FontWeight.bold,
.coveringDoctor,
fontWeight:
FontWeight.bold,
),
model.coveringDoctors
.length >
0
? Row(children: [
AppText(getDoctor(
model
.coveringDoctors,
item.doctorId))
])
: SizedBox(),
],
),
SizedBox(
width: 10,
),
Row(children: [
AppText(
item.remarks,
)
]),
],
),
SizedBox(
width: 20,
),
],
),
),
(item.status == 1 || item.status == 2)
? Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.open_in_full,
size: 40,
),
// color: Colors.green, //Colors.black,
onPressed: () => {
// openSickLeave(context, true,
// extendedData: item)
},
))
: SizedBox(),
],
)),
SizedBox(
height: 20,
),
Divider(
height: 1,
),
],
));
}).toList(),
),
(item.status == 1)
? Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.edit_outlined,
size: 30,
),
// color: Colors.green, //Colors.black,
onPressed: () => {
// openSickLeave(context, true,
// extendedData: item)
},
))
: SizedBox(),
],
)),
SizedBox(
height: 10,
),
Divider(
height: 1,
),
],
));
}).toList(),
)
],
),
)
: new Builder(builder: (context) {
@ -190,4 +253,12 @@ class AddRescheduleLeavScreen extends StatelessWidget {
));
});
}
getDoctor(model, doctorId) {
var obj;
obj = model.where((i) => i['doctorID'] == doctorId).toList();
print(obj);
return obj.length > 0 ? obj[0]['doctorName'] : "";
}
}

@ -2,6 +2,7 @@ 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/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -20,6 +21,7 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:provider/provider.dart';
Helpers helpers = Helpers();
@ -32,6 +34,7 @@ class RescheduleLeaveScreen extends StatefulWidget {
class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
TextEditingController _toDateController = new TextEditingController();
ProjectViewModel projectsProvider;
String _selectedClinic;
Map profile = {};
AddSickLeaveRequest addSickLeave = AddSickLeaveRequest();
@ -59,17 +62,23 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
@override
void initState() {
getProfile();
super.initState();
}
@override
Widget build(BuildContext context) {
projectsProvider = Provider.of(context);
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>(
onModelReady: (model2) => model2.getOffTime(),
onModelReady: (model2) => {
model2.getOffTime(),
model2.getReasons(18),
model2.getCoveringDoctors()
},
builder: (_, model2, w) => AppScaffold(
baseViewModel: model,
baseViewModel: model2,
isShowAppBar: false,
body: Center(
child: Container(
@ -79,8 +88,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: ListView(
children: [
Container(
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
@ -98,10 +106,6 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).clinicName,
// fontSize: 10,
// ),
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
@ -163,11 +167,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
],
),
)),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
@ -181,7 +183,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
ignoring: true,
child: AppTextFormField(
readOnly: true,
hintText: profile['DoctorName'],
hintText: profile != null
? profile['DoctorName']
: "",
borderColor: Colors.white,
onSaved: (value) {},
inputFormatter: ONLY_NUMBERS))
@ -190,8 +194,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
),
Container(
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
@ -212,65 +215,319 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
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(
focusColor: Colors.grey,
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,
color:
Colors.grey,
),
],
);
}).toList();
},
onChanged: (newValue) =>
{},
items: model
.getClinicNameList()
model2.allOffTime.length > 0
? Expanded(
// add Expanded to have your dropdown button fill remaining space
child:
DropdownButtonHideUnderline(
child: DropdownButton(
focusColor: Colors.grey,
isExpanded: true,
value: model2.allOffTime[0]
['code'],
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model2.allOffTime
.map((item) {
return DropdownMenuItem(
value:
item.toString(),
child: Text(
item,
textAlign:
TextAlign.end,
),
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
item[
'description'],
fontSize: SizeConfig
.textMultiplier *
2.1,
color:
Colors.grey,
),
],
);
}).toList(),
))),
),
}).toList();
},
onChanged: (newValue) => {},
items: model2.allOffTime
.map((item) {
return DropdownMenuItem<
String>(
value: item['code']
.toString(),
child: Text(
item['description'],
textAlign:
TextAlign.end,
),
);
}).toList(),
)),
)
: SizedBox(),
],
)
],
),
)),
Container(
margin: EdgeInsets.all(8),
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: [
AppTextFormField(
hintText: TranslationBase.of(context)
.fromDate,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons.calendar_today)),
textInputType: TextInputType.number,
controller: _toDateController,
onTap: () {
_presentDatePicker('_selectedToDate');
},
inputFormatter: ONLY_DATE,
onChanged: (value) {
addSickLeave.startDate = value;
}),
],
)),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.all(8),
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: [
new AppTextFormField(
readOnly: true,
hintText: "",
borderColor: Colors.white,
onSaved: (value) {},
inputFormatter: ONLY_NUMBERS),
],
),
),
),
Expanded(
child: Container(
margin: EdgeInsets.all(8),
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: [
new AppTextFormField(
readOnly: true,
hintText: "",
borderColor: Colors.white,
onSaved: (value) {},
inputFormatter: ONLY_NUMBERS),
],
),
),
)
],
),
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: 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: [
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
model2.allReasons.length > 0
? Expanded(
// add Expanded to have your dropdown button fill remaining space
child:
DropdownButtonHideUnderline(
child: DropdownButton(
focusColor: Colors.grey,
isExpanded: true,
value: model2.allReasons[0]
['id']
.toString(),
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model2.allReasons
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
projectsProvider
.isArabic
? item[
'nameAr']
: item[
'nameEn'],
fontSize: SizeConfig
.textMultiplier *
2.1,
color:
Colors.grey,
),
],
);
}).toList();
},
onChanged: (newValue) => {},
items: model2.allReasons
.map((item) {
return DropdownMenuItem<
String>(
value: item['id']
.toString(),
child: Text(
projectsProvider
.isArabic
? item['nameAr']
: item['nameEn'],
textAlign:
TextAlign.end,
),
);
}).toList(),
)),
)
: SizedBox(),
],
)
],
),
)),
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: 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: [
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
model2.coveringDoctors.length > 0
? Expanded(
// add Expanded to have your dropdown button fill remaining space
child:
DropdownButtonHideUnderline(
child: DropdownButton(
focusColor: Colors.grey,
isExpanded: true,
value: model2
.coveringDoctors[0]
['doctorID']
.toString(),
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model2
.coveringDoctors
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
projectsProvider
.isArabic
? item[
'doctorNameN']
: item[
'doctorName'],
fontSize: SizeConfig
.textMultiplier *
2.1,
color:
Colors.grey,
),
],
);
}).toList();
},
onChanged: (newValue) => {},
items: model2
.coveringDoctors
.map((item) {
return DropdownMenuItem<
String>(
value: item['doctorID']
.toString(),
child: Text(
projectsProvider
.isArabic
? item[
'doctorNameN']
: item[
'doctorName'],
textAlign:
TextAlign.start,
),
);
}).toList(),
)),
)
: SizedBox(),
],
)
],
),
)),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
@ -307,9 +564,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
}
getClinicName(model) {
var clinicInfo = model.clinicsList
.where((i) => i['ClinicID'] == this.profile['ClinicID'])
.toList();
var clinicID = this.profile != null ? this.profile['ClinicID'] : 1;
var clinicInfo =
model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
}
}

@ -424,6 +424,12 @@ class TranslationBase {
String get sao2 => localizedValues['sao2'][locale.languageCode];
String get painManagement =>
localizedValues['painManagement'][locale.languageCode];
String get holiday => localizedValues['holiday'][locale.languageCode];
String get to => localizedValues['to'][locale.languageCode];
String get coveringDoctor =>
localizedValues['coveringDoctor'][locale.languageCode];
String get requestLeave =>
localizedValues['requestLeave'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -35,9 +35,6 @@ class _AppDrawerState extends State<AppDrawer> {
// _isInit = false;
// }
@override
Widget build(BuildContext context) {
AuthViewModel authProvider = Provider.of(context);
@ -68,20 +65,24 @@ class _AppDrawerState extends State<AppDrawer> {
),
),
SizedBox(height: 15),
CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
backgroundImage:
NetworkImage(authProvider.doctorProfile.doctorImageURL),
backgroundColor: Colors.white,
),
Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
authProvider.doctorProfile?.doctorName,
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2,
)),
authProvider.doctorProfile != null
? CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
backgroundImage: NetworkImage(
authProvider.doctorProfile.doctorImageURL),
backgroundColor: Colors.white,
)
: SizedBox(),
authProvider.doctorProfile != null
? Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
authProvider.doctorProfile?.doctorName,
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2,
))
: SizedBox(),
AppText(
"Director of medical records", //TODO: Make The Dr Title Dynamic and check overflow issue.
fontWeight: FontWeight.normal,
@ -121,7 +122,9 @@ class _AppDrawerState extends State<AppDrawer> {
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).qr+ TranslationBase.of(context).reader, DoctorApp.qr_code),
TranslationBase.of(context).qr +
TranslationBase.of(context).reader,
DoctorApp.qr_code),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(QR_READER);

Loading…
Cancel
Save