Merge branch 'dev_v3.13.6' of http://34.17.52.79/Haroon6138/diplomatic-quarter into dev_v3.13.6

# Conflicts:
#	lib/pages/BookAppointment/widgets/DoctorView.dart
#	lib/uitl/app_toast.dart
dev_v3.13.6_voipcall
Sultan khan 2 years ago
commit 1a5687a27c

@ -173,7 +173,7 @@ class BaseAppClient {
onFailure!('Error While Fetching data', statusCode);
logApiEndpointError(endPoint, 'Error While Fetching data', statusCode);
} else {
var decoded = utf8.decode(response.bodyBytes);
// var decoded = utf8.decode(response.bodyBytes);
var parsed = json.decode(utf8.decode(response.bodyBytes));
// print("Response: $parsed");

@ -20,25 +20,21 @@ class AmRequestViewModel extends BaseViewModel {
HospitalService _hospitalService = locator<HospitalService>();
MedicalService _medicalService = locator<MedicalService>();
List<PatientERTransportationMethod> get amRequestModeList =>
_amService.amModelList;
List<PatientERTransportationMethod> get amRequestModeList => _amService.amModelList;
List<PatientAllPresOrders> get patientAllPresOrdersList =>
_amService.patientAllPresOrdersList;
List<PatientAllPresOrders> get patientAllPresOrdersList => _amService.patientAllPresOrdersList;
List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList =>
_medicalService.appoitmentAllHistoryResultList;
List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList => _medicalService.appoitmentAllHistoryResultList;
List<AmbulanceRequestOrdersModel> get patientAmbulanceRequestOrdersList =>
_amService.patientAmbulanceRequestOrdersList;
List<AmbulanceRequestOrdersModel> get patientAmbulanceRequestOrdersList => _amService.patientAmbulanceRequestOrdersList;
List<HospitalsModel> get hospitals => _hospitalService.hospitals;
bool get hasPendingOrder => _amService.hasPendingOrder;
PickUpRequestPresOrder get pickUpRequestPresOrder =>_amService.pickUpRequestPresOrder!;
PickUpRequestPresOrder? get pickUpRequestPresOrder => _amService.pickUpRequestPresOrder;
AmbulanceRequestOrdersModel get pendingAmbulanceRequestOrder =>_amService.pendingAmbulanceRequestOrder!;
AmbulanceRequestOrdersModel? get pendingAmbulanceRequestOrder => _amService.pendingAmbulanceRequestOrder;
Future getAppointmentHistory() async {
setState(ViewState.BusyLocal);

@ -20,28 +20,21 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
List<PharmacyProduct> filteredInPatientItems = [];
List<PharmacyProduct> filteredMyInPatientItems = [];
PharmacyCategoriseService _pharmacyCategoriseService =
locator<PharmacyCategoriseService>();
PharmacyCategoriseService _pharmacyCategoriseService = locator<PharmacyCategoriseService>();
List<PharmacyCategorise> get categorise =>
_pharmacyCategoriseService.categoriseList;
List<PharmacyCategorise> get categorise => _pharmacyCategoriseService.categoriseList;
List<CategoriseParentModel> get categoriseParent =>
_pharmacyCategoriseService.parentCategoriseList;
List<CategoriseParentModel> get categoriseParent => _pharmacyCategoriseService.parentCategoriseList;
List<PharmacyProduct> get parentProducts =>
_pharmacyCategoriseService.parentProductsList;
List<PharmacyProduct> get parentProducts => _pharmacyCategoriseService.parentProductsList;
List<CategoriseParentModel> get subCategorise =>
_pharmacyCategoriseService.subCategoriseList;
List<CategoriseParentModel> get subCategorise => _pharmacyCategoriseService.subCategoriseList;
List<PharmacyProduct> get subProducts =>
_pharmacyCategoriseService.subProductsList;
List<PharmacyProduct> get subProducts => _pharmacyCategoriseService.subProductsList;
List<PharmacyProduct> get finalProducts =>
_pharmacyCategoriseService.finalProducts;
List<CategoriseParentModel> get brandsList =>
_pharmacyCategoriseService.brandsList;
List<PharmacyProduct> get finalProducts => _pharmacyCategoriseService.finalProducts;
List<CategoriseParentModel> get brandsList => _pharmacyCategoriseService.brandsList;
List<PharmacyProduct> get searchList => _pharmacyCategoriseService.searchList;
@ -99,8 +92,7 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getCategoriseParent(
{String? i, int? pageIndex, bool? isLoading, BuildContext? context}) async {
Future getCategoriseParent({String? i, int? pageIndex, bool? isLoading, BuildContext? context}) async {
hasError = false;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
@ -111,19 +103,16 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.ErrorLocal);
} else
await getBrands(id: i);
await getParentProducts(
i: i, pageIndex: pageIndex, isLoading: isLoading, context: context);
await getParentProducts(i: i, pageIndex: pageIndex, isLoading: isLoading, context: context);
// GifLoaderDialogUtils.showMyDialog(context);
}
Future getParentProducts(
{String? i, int? pageIndex, bool? isLoading, BuildContext? context}) async {
Future getParentProducts({String? i, int? pageIndex, bool? isLoading, BuildContext? context}) async {
hasError = false;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.BusyLocal);
GifLoaderDialogUtils.showMyDialog(context!);
await _pharmacyCategoriseService.getParentProducts(
id: i, pageNumber: pageIndex, isLoading: isLoading!);
await _pharmacyCategoriseService.getParentProducts(id: i, pageNumber: pageIndex, isLoading: isLoading!);
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error!;
setState(ViewState.ErrorLocal);
@ -132,11 +121,7 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
GifLoaderDialogUtils.hideDialog(context);
}
Future getSubCategorise(
{String? i,
int? pageIndex,
bool isLoading = false,
BuildContext? context}) async {
Future getSubCategorise({String? i, int? pageIndex, bool isLoading = false, BuildContext? context}) async {
hasError = false;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
@ -147,21 +132,15 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
error = _pharmacyCategoriseService.error!;
setState(ViewState.ErrorLocal);
} else
getSubProducts(
i: i, pageIndex: pageIndex, isLoading: isLoading, context: context);
getSubProducts(i: i, pageIndex: pageIndex, isLoading: isLoading, context: context);
}
Future getSubProducts(
{String? i,
int? pageIndex,
bool isLoading = false,
BuildContext? context}) async {
Future getSubProducts({String? i, int? pageIndex, bool isLoading = false, BuildContext? context}) async {
hasError = false;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.BusyLocal);
GifLoaderDialogUtils.showMyDialog(context!);
await _pharmacyCategoriseService.getSubProducts(
id: i, pageIndex: pageIndex, isLoading: isLoading);
await _pharmacyCategoriseService.getSubProducts(id: i, pageIndex: pageIndex, isLoading: isLoading);
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error!;
setState(ViewState.ErrorLocal);
@ -182,13 +161,11 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getFilteredProducts(
{String? categoryId, String? brandId, String? min, String? max}) async {
Future getFilteredProducts({String? categoryId, String? brandId, String? min, String? max}) async {
hasError = false;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _pharmacyCategoriseService.getFilteredProducts(
categoryId: categoryId, brandId: brandId, max: max, min: min);
await _pharmacyCategoriseService.getFilteredProducts(categoryId: categoryId, brandId: brandId, max: max, min: min);
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error!;
setState(ViewState.ErrorLocal);
@ -196,13 +173,11 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getFilteredSubProducts(
{String? categoryId, String? brandId, String? min, String? max}) async {
Future getFilteredSubProducts({String? categoryId, String? brandId, String? min, String? max}) async {
hasError = false;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _pharmacyCategoriseService.getFilteredSubProducts(
categoryId: categoryId, brandId: brandId, max: max, min: min);
await _pharmacyCategoriseService.getFilteredSubProducts(categoryId: categoryId, brandId: brandId, max: max, min: min);
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error!;
setState(ViewState.ErrorLocal);
@ -267,16 +242,9 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
addOnFilteredList() {
if (lastSubsetIndex < parentProducts.length) {
firstSubsetIndex = firstSubsetIndex +
(parentProducts.length - lastSubsetIndex < inPatientPageSize - 1
? parentProducts.length - lastSubsetIndex
: inPatientPageSize - 1);
lastSubsetIndex = lastSubsetIndex +
(parentProducts.length - lastSubsetIndex < inPatientPageSize - 1
? parentProducts.length - lastSubsetIndex
: inPatientPageSize - 1);
filteredInPatientItems
.addAll(parentProducts.sublist(firstSubsetIndex, lastSubsetIndex));
firstSubsetIndex = firstSubsetIndex + (parentProducts.length - lastSubsetIndex < inPatientPageSize - 1 ? parentProducts.length - lastSubsetIndex : inPatientPageSize - 1);
lastSubsetIndex = lastSubsetIndex + (parentProducts.length - lastSubsetIndex < inPatientPageSize - 1 ? parentProducts.length - lastSubsetIndex : inPatientPageSize - 1);
filteredInPatientItems.addAll(parentProducts.sublist(firstSubsetIndex, lastSubsetIndex));
setState(ViewState.Idle);
}
}

@ -48,7 +48,7 @@ class SelectDeviceIMEIRES {
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
final Map<String, dynamic> data = Map<String, dynamic>();
data['BiometricEnabled'] = this.biometricEnabled;
data['CreatedOn'] = this.createdOn;
data['EditedOn'] = this.editedOn;

@ -15,9 +15,9 @@ class LocationDetails {
_long = long;
}
String get formattedAddress => _formattedAddress!;
String? get formattedAddress => _formattedAddress;
set formattedAddress(String formattedAddress) {
set formattedAddress(String? formattedAddress) {
_formattedAddress = formattedAddress;
}
}

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
@ -213,7 +214,7 @@ class _BookConfirmState extends State<BookConfirm> {
elevation: 0,
onPressed: () async {
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
if (isLiveCareSchedule != null && isLiveCareSchedule) {
if (isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
@ -273,7 +274,7 @@ class _BookConfirmState extends State<BookConfirm> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
logger.d(err);
GifLoaderDialogUtils.hideDialog(context);
});
}
@ -372,9 +373,9 @@ class _BookConfirmState extends State<BookConfirm> {
dialog.showAlertDialog(context);
}
}).catchError((err) {
logger.d(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
projectViewModel.analytics.appointment.book_appointment_click_confirm(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor);
}

@ -336,6 +336,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
child: RatingBar(
itemSize: 20.0,
allowHalfRating: true,
ignoreGestures: true,
initialRating: this.widget.doctor.actualDoctorRate!.toDouble(),
ratingWidget: RatingWidget(
full: Icon(

@ -40,9 +40,9 @@ class SearchByClinic extends StatefulWidget {
class _SearchByClinicState extends State<SearchByClinic> {
bool nearestAppo = false;
String dropdownValue = "";
String? dropdownValue;
String dropdownTitle = "";
String projectDropdownValue = "";
String? projectDropdownValue;
// var event = RobotProvider();
List<ListClinicCentralized> clinicsList = [];
@ -51,8 +51,8 @@ class _SearchByClinicState extends State<SearchByClinic> {
bool isLoaded = false;
bool isProjectLoaded = false;
ListClinicCentralized selectedClinic = ListClinicCentralized();
HospitalsModel selectedHospital = HospitalsModel();
ListClinicCentralized? selectedClinic;
HospitalsModel? selectedHospital;
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
@ -78,7 +78,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
projectViewModel = Provider.of(context);
if (projectViewModel.isLogin) {
if (radioValue == null) {
if (projectViewModel.user!.gender == 1) {
if (projectViewModel.user.gender == 1) {
radioValue = TranslationBase.of(context).male;
} else {
radioValue = TranslationBase.of(context).female;
@ -317,26 +317,26 @@ class _SearchByClinicState extends State<SearchByClinic> {
child: DropdownButtonHideUnderline(
child: DropdownButton<HospitalsModel>(
key: projectDropdownKey,
hint: new Text(TranslationBase.of(context).selectHospital),
hint: Text(TranslationBase.of(context).selectHospital),
value: selectedHospital,
iconSize: 0,
isExpanded: true,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: projectsList.map((item) {
items: projectsList.map((HospitalsModel item) {
return DropdownMenuItem<HospitalsModel>(
value: item,
child: Text(item.name!),
child: Text('${item.name!}'),
);
}).toList(),
onChanged: (newValue) async {
onChanged: (HospitalsModel? newValue) async {
setState(() {
selectedHospital = HospitalsModel.fromJson(newValue!.toJson());
HospitalsModel tempselectedHospital = new HospitalsModel.fromJson(newValue!.toJson());
projectDropdownValue = newValue.mainProjectID.toString();
if (dropdownValue.split("-")[0] == "253") {
if (dropdownValue!.split("-")[0] == "253") {
Navigator.push(
context,
FadePage(
page: LaserClinic(selectedHospital: selectedHospital),
page: LaserClinic(selectedHospital: tempselectedHospital!),
),
);
} else {
@ -489,7 +489,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
bool isDentalSelectedAndSupported() {
if (dropdownValue != null)
return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" || dropdownValue.split("-")[0] == "253") && isMobileAppDentalAllow;
return dropdownValue != "" && (dropdownValue!.split("-")[0] == "17" || dropdownValue!.split("-")[0] == "253") && isMobileAppDentalAllow;
else
return false;
}
@ -555,15 +555,15 @@ class _SearchByClinicState extends State<SearchByClinic> {
// TODO Mosa_REMARk to come back later
getDoctorsList(BuildContext context) {
SearchInfo searchInfo = new SearchInfo();
if (dropdownValue != null) if (dropdownValue.split("-")[0] == "17") {
searchInfo.ProjectID = int.parse(projectDropdownValue);
searchInfo.ClinicID = int.parse(dropdownValue.split("-")[0]);
if (dropdownValue != null) if (dropdownValue!.split("-")[0] == "17") {
searchInfo.ProjectID = int.parse(projectDropdownValue!);
searchInfo.ClinicID = int.parse(dropdownValue!.split("-")[0]);
searchInfo.hospital = selectedHospital;
searchInfo.clinic = selectedClinic;
searchInfo.date = DateTime.now();
if (projectViewModel.isLogin) {
if (projectViewModel.user!.age! > 12) {
if (projectViewModel.user.age! > 12) {
navigateToDentalComplaints(context, searchInfo);
} else {
callDoctorsSearchAPI(17);
@ -571,17 +571,17 @@ class _SearchByClinicState extends State<SearchByClinic> {
} else {
navigateToDentalComplaints(context, searchInfo);
}
} else if (dropdownValue.split("-")[0] == "253") {
} else if (dropdownValue!.split("-")[0] == "253") {
navigateToLaserClinic(context);
// callDoctorsSearchAPI();
} else if (dropdownValue.split("-")[1] == "true"
} else if (dropdownValue!.split("-")[1] == "true"
// && authProvider.isLogin &&
// authUser.patientType == 1
) {
Navigator.push(
context,
FadePage(
page: LiveCareBookAppointment(clinicName: dropdownTitle, liveCareClinicID: dropdownValue.split("-")[2], liveCareServiceID: dropdownValue.split("-")[3]),
page: LiveCareBookAppointment(clinicName: dropdownTitle, liveCareClinicID: dropdownValue!.split("-")[2], liveCareServiceID: dropdownValue!.split("-")[3]),
),
).then((value) {
setState(() {
@ -591,11 +591,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
Navigator.push(context, FadePage(page: LiveCareHome()));
}
if (value == "schedule") {
callDoctorsSearchAPI(int.parse(dropdownValue.split("-")[0]));
callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0]));
}
});
} else {
callDoctorsSearchAPI(int.parse(dropdownValue.split("-")[0]));
callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0]));
}
}
@ -609,7 +609,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, context).then((res) {
service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue!) : 0, nearestAppo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {

@ -87,8 +87,13 @@ class DoctorView extends StatelessWidget {
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
doctor.date ==null ? SizedBox() : Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)),
// doctor.date ==null ? SizedBox() : Text(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)),
Text(
doctor.date != null ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date )) : DateTime.now().toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
) ,
],

@ -62,7 +62,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
AmbulanceRequestOrdersModel order = widget.amRequestViewModel.pendingAmbulanceRequestOrder;
AmbulanceRequestOrdersModel order = widget.amRequestViewModel.pendingAmbulanceRequestOrder ?? AmbulanceRequestOrdersModel();
if(widget.amRequestViewModel.pendingAmbulanceRequestOrder != null) {
int status = order.statusId!;

@ -44,17 +44,17 @@ class _PickupLocationState extends State<PickupLocation> {
// double _latitude;
// double _longitude;
late AppoitmentAllHistoryResultList myAppointment;
late HospitalsModel _selectedHospital;
late LocationDetails _result;
late LocationUtils locationUtils;
AppoitmentAllHistoryResultList? myAppointment;
HospitalsModel? _selectedHospital;
LocationDetails? _result ;
LocationUtils? locationUtils;
late ProjectViewModel projectViewModel;
@override
void initState() {
super.initState();
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils!.getCurrentLocation());
setState(() {});
}
@ -117,7 +117,7 @@ class _PickupLocationState extends State<PickupLocation> {
)),
);
} else {
locationUtils.getCurrentLocation();
locationUtils!.getCurrentLocation();
}
},
child: Row(
@ -289,17 +289,17 @@ class _PickupLocationState extends State<PickupLocation> {
height: 12,
),
DoctorCard(
isInOutPatient: myAppointment.isInOutPatient,
name: myAppointment.doctorTitle! + " " + myAppointment.doctorNameObj!,
profileUrl: myAppointment.doctorImageURL,
subName: myAppointment.clinicName,
isLiveCareAppointment: myAppointment.isLiveCareAppointment,
date: DateUtil.convertStringToDate(myAppointment.appointmentDate!),
isInOutPatient: myAppointment!.isInOutPatient,
name: myAppointment!.doctorTitle! + " " + myAppointment!.doctorNameObj!,
profileUrl: myAppointment!.doctorImageURL,
subName: myAppointment!.clinicName,
isLiveCareAppointment: myAppointment!.isLiveCareAppointment,
date: DateUtil.convertStringToDate(myAppointment!.appointmentDate!),
isSortByClinic: false,
rating: myAppointment.actualDoctorRate! + 0.0,
appointmentTime: myAppointment.isLiveCareAppointment!
? DateUtil.convertStringToDate(myAppointment.appointmentDate!).toString().split(" ")[1].substring(0, 5)
: myAppointment.startTime!.substring(0, 5),
rating: myAppointment!.actualDoctorRate! + 0.0,
appointmentTime: myAppointment!.isLiveCareAppointment!
? DateUtil.convertStringToDate(myAppointment!.appointmentDate!).toString().split(" ")[1].substring(0, 5)
: myAppointment!.startTime!.substring(0, 5),
remainingTimeInMinutes: null),
],
),
@ -458,7 +458,7 @@ class _PickupLocationState extends State<PickupLocation> {
),
);
} else {
locationUtils.getCurrentLocation();
locationUtils!.getCurrentLocation();
}
},
child: Row(
@ -520,39 +520,39 @@ class _PickupLocationState extends State<PickupLocation> {
widget.patientER_RC.transportationDetails!.pickupSpot = _isInsideHome ? 1 : 0;
if (widget.patientER_RC.transportationDetails!.direction == 0) {
// To Hospital
widget.patientER_RC.transportationDetails!.dropoffLatitude = _result.lat.toStringAsFixed(6);
widget.patientER_RC.transportationDetails!.dropoffLongitude = _result.long.toStringAsFixed(6);
widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital.latitude;
widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital.longitude;
widget.patientER_RC.transportationDetails!.dropoffLatitude = _result!.lat.toStringAsFixed(6);
widget.patientER_RC.transportationDetails!.dropoffLongitude = _result!.long.toStringAsFixed(6);
widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital!.latitude;
widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital!.longitude;
} else {
// From Hospital
widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital.latitude;
widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital.longitude;
widget.patientER_RC.transportationDetails!.dropoffLatitude = _result.lat.toStringAsFixed(6);
widget.patientER_RC.transportationDetails!.dropoffLongitude = _result.long.toStringAsFixed(6);
widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital!.latitude;
widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital!.longitude;
widget.patientER_RC.transportationDetails!.dropoffLatitude = _result!.lat.toStringAsFixed(6);
widget.patientER_RC.transportationDetails!.dropoffLongitude = _result!.long.toStringAsFixed(6);
}
widget.patientER_RC.transportationDetails!.dropoffLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _result.formattedAddress : _selectedHospital.name;
widget.patientER_RC.transportationDetails!.dropoffLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _result!.formattedAddress : _selectedHospital!.name;
widget.patientER_RC.patientIdentificationID = widget.amRequestViewModel.user!.patientIdentificationNo;
widget.patientER_RC.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo;
widget.patientER_RC.transportationDetails!.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER_RC.transportationDetails!.pickupLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _selectedHospital.name : _result.formattedAddress;
widget.patientER_RC.projectID = widget.amRequestViewModel.user!.projectID;
widget.patientER_RC.patientID = widget.amRequestViewModel.user!.patientID;
widget.patientER_RC.transportationDetails!.pickupLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _selectedHospital!.name : _result!.formattedAddress;
widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID;
widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID;
widget.patientER_RC.transportationDetails!.requesterIsOutSA = false;
widget.patientER_RC.transportationDetails!.requesterMobileNo = widget.amRequestViewModel.user!.mobileNumber;
widget.patientER_RC.transportationDetails!.requesterFileNo = widget.amRequestViewModel.user!.patientID;
widget.patientER_RC.transportationDetails!.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber;
widget.patientER_RC.transportationDetails!.requesterFileNo = widget.amRequestViewModel.user.patientID;
if (_haveAppointment == HaveAppointment.YES) {
widget.patientER_RC.transportationDetails!.appointmentNo = myAppointment.appointmentNo.toString();
widget.patientER_RC.transportationDetails!.appointmentClinicName = myAppointment.clinicName;
widget.patientER_RC.transportationDetails!.appointmentDoctorName = myAppointment.doctorNameObj;
widget.patientER_RC.transportationDetails!.appointmentBranch = myAppointment.projectName;
widget.patientER_RC.transportationDetails!.appointmentTime = myAppointment.appointmentDate;
widget.patientER_RC.transportationDetails!.appointmentNo = myAppointment!.appointmentNo.toString();
widget.patientER_RC.transportationDetails!.appointmentClinicName = myAppointment!.clinicName;
widget.patientER_RC.transportationDetails!.appointmentDoctorName = myAppointment!.doctorNameObj;
widget.patientER_RC.transportationDetails!.appointmentBranch = myAppointment!.projectName;
widget.patientER_RC.transportationDetails!.appointmentTime = myAppointment!.appointmentDate;
widget.patientER_RC.transportationDetails!.haveAppointment = 1;
widget.patientER_RC.transportationDetails!.dropoffLatitude = myAppointment.latitude;
widget.patientER_RC.transportationDetails!.dropoffLongitude = myAppointment.longitude;
widget.patientER_RC.transportationDetails!.dropoffLocationName = myAppointment.projectName;
widget.patientER_RC.transportationDetails!.dropoffLatitude = myAppointment!.latitude;
widget.patientER_RC.transportationDetails!.dropoffLongitude = myAppointment!.longitude;
widget.patientER_RC.transportationDetails!.dropoffLocationName = myAppointment!.projectName;
} else {
widget.patientER_RC.transportationDetails!.appointmentNo = "0";
widget.patientER_RC.transportationDetails!.appointmentClinicName = "";
@ -593,11 +593,15 @@ class _PickupLocationState extends State<PickupLocation> {
}
String getHospitalName(String title) {
return _selectedHospital == null ? title : _selectedHospital.name!;
return _selectedHospital == null ? title : _selectedHospital!.name!;
}
String getSelectFromMapName(context) {
return _result != null ? _result.formattedAddress : "";
return _result != null
? _result!.formattedAddress != null
? _result!.formattedAddress!
: ""
: "";
}
getAppointment() {
@ -619,11 +623,11 @@ class _PickupLocationState extends State<PickupLocation> {
setState(() {
myAppointment = value;
HospitalsModel hospitalsModel = HospitalsModel();
hospitalsModel.name = myAppointment.projectName;
hospitalsModel.iD = myAppointment.projectID;
hospitalsModel.mainProjectID = myAppointment.projectID;
hospitalsModel.latitude = myAppointment.latitude;
hospitalsModel.longitude = myAppointment.longitude;
hospitalsModel.name = myAppointment!.projectName;
hospitalsModel.iD = myAppointment!.projectID;
hospitalsModel.mainProjectID = myAppointment!.projectID;
hospitalsModel.latitude = myAppointment!.latitude;
hospitalsModel.longitude = myAppointment!.longitude;
_selectedHospital = hospitalsModel;
});
else {

@ -102,7 +102,6 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
margin: EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6),
child: SliderView(
onLoginClick: () {
print("-----------");
widget.onLoginClick!();
projectViewModel.analytics.loginRegistration.login_register_initiate();
},

@ -565,7 +565,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
changeCurrentTab(1);
},
onLoginClick: () {
print("here i am");
login();
},
onMedicalFileClick: () {

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_mod
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
@ -59,7 +60,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
late int mobileNumber;
String errorMsg = '';
SelectDeviceIMEIRES user = SelectDeviceIMEIRES();
SelectDeviceIMEIRES? user;
bool isLoading = false;
var registerd_data;
bool isMoreOption = false;
@ -107,7 +108,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return Scaffold(
backgroundColor: Color(0xfff8f8f8),
resizeToAvoidBottomInset: false,
@ -139,7 +139,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
),
Text(
user.name!.toLowerCase().capitalizeFirstofEach,
user!.name!.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44),
),
SizedBox(height: 10),
@ -172,10 +172,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
),
Text(
user.editedOn != null
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn!))
: user.createdOn != null
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.createdOn!))
user!.editedOn != null
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!))
: user!.createdOn != null
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.createdOn!))
: '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
@ -194,7 +194,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
),
),
Text(
" " + getType(user.logInType, context),
" " + getType(user!.logInType, context),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
@ -203,10 +203,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
),
Expanded(child: SizedBox()),
Text(
user.editedOn != null
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn!), false)
: user.createdOn != null
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.createdOn!), false)
user!.editedOn != null
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.editedOn!), false)
: user!.createdOn != null
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.createdOn!), false)
: '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
),
@ -499,24 +499,25 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
setDefault() async {
showLoader(true);
if (await sharedPref.getObject(IMEI_USER_DATA) != null) user = SelectDeviceIMEIRES.fromJson(await sharedPref.getObject(IMEI_USER_DATA));
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
isMoreOption = true;
this.registerd_data = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
this.registerd_data = await CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
}
this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user.mobile!);
this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user!.mobile!);
this.zipCode = this.registerd_data != null
? this.registerd_data.zipCode
: this.user.outSA == true
: this.user!.outSA == true
? "971"
: "966";
this.patientOutSA = this.registerd_data != null
? this.registerd_data.zipCode == "966"
? 0
: 1
: this.user.outSA;
: this.user!.outSA;
if (this.registerd_data != null) {
this.loginTokenID = await sharedPref.getString(LOGIN_TOKEN_ID);
this.loginType = this.registerd_data.searchType;
@ -534,9 +535,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this.lastLogin = await sharedPref.getInt(LAST_LOGIN) != null
? await sharedPref.getInt(LAST_LOGIN)
: user != null
? user.logInType
? user!.logInType
: null;
showLoader(false);
//this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN);
}
@ -560,7 +562,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
request.isRegister = this.registerd_data.isRegister;
} else {
request.searchType = request.searchType != null ? request.searchType : 2;
request.patientID = this.user.patientID != null ? this.user.patientID : 0;
request.patientID = this.user!.patientID != null ? this.user!.patientID : 0;
request.nationalID = request.nationalID != null ? request.nationalID : '0';
request.patientIdentificationID = request.patientIdentificationID != null ? request.patientIdentificationID : '0';
request.isRegister = false;

@ -15,7 +15,9 @@ import 'package:provider/provider.dart';
class MedicalProfilePageNew extends StatefulWidget {
Function()? onTap;
String? a;
MedicalProfilePageNew({this.onTap});
@override
_MedicalProfilePageState createState() => _MedicalProfilePageState();
}
@ -57,7 +59,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
children: [
projectViewModel!.isLogin
? Text(
projectViewModel?.user?.firstName ?? "",
projectViewModel?.user.firstName ?? "",
style: TextStyle(color: Colors.black, fontSize: SizeConfig.textMultiplier! * 1.8),
)
: Container(),

@ -44,7 +44,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
"باوند",
"كيلو جرام",
];
late String measureTimeSelectedType;
String? measureTimeSelectedType;
bool isButtonDisabled = true;
@override

@ -24,7 +24,8 @@ class WeightMonthlyPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (projectViewModel == null) projectViewModel = Provider.of(context);
//if (projectViewModel == null)
projectViewModel = Provider.of(context);
groupData();
return ListView(
children: [

@ -24,7 +24,8 @@ class WeightWeeklyPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (projectViewModel == null) projectViewModel = Provider.of(context);
///if (projectViewModel == null)
projectViewModel = Provider.of(context);
return ListView(
children: [
Container(

@ -20,7 +20,8 @@ class BloodPressureMonthlyPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (projectViewModel == null) projectViewModel = Provider.of(context);
// if (projectViewModel == null)
projectViewModel = Provider.of(context);
groupData();
return ListView(
children: [

@ -22,7 +22,8 @@ class BloodPressureYearPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (projectViewModel == null) projectViewModel = Provider.of(context);
// if (projectViewModel == null)
projectViewModel = Provider.of(context);
groupData();
return ListView(
children: [

@ -22,7 +22,8 @@ class BloodPressureWeeklyPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (projectViewModel == null) projectViewModel = Provider.of(context);
// if (projectViewModel == null)
projectViewModel = Provider.of(context);
return ListView(
children: [
Container(

@ -25,7 +25,7 @@ class BloodMonthlyPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (projectViewModel == null) projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
groupData();
return AppScaffold(
body: ListView(

@ -23,7 +23,8 @@ class BloodYearPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (projectViewModel == null) projectViewModel = Provider.of(context);
// if (projectViewModel == null)
projectViewModel = Provider.of(context);
groupData();
return ListView(

@ -128,7 +128,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
fontSize: 10,
);
return Text(
timeSeries1![value.toInt()].time,
timeSeries1![value.toInt()].time.toString(),
style: styl,
);
}),
@ -148,7 +148,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
fontSize: 10,
);
return Text(
timeSeries1![value.toInt()].time,
timeSeries1![value.toInt()].time.toString(),
style: styl,
);
}

@ -61,9 +61,9 @@ class PrescriptionItemsPage extends StatelessWidget {
prescriptions.name!,
DateUtil.convertStringToDate(prescriptions.appointmentDate!),
DateUtil.formatDateToTime(
DateUtil.convertStringToDate(
model.prescriptionReportEnhList.length > 0 || model.prescriptionReportListINP.length > 0 ? DateUtil.convertStringToDate(
model.prescriptionReportEnhList.length > 0 ? model.prescriptionReportEnhList[0].orderDate! : model.prescriptionReportListINP[0].orderDate!,
),
) : DateTime.now(),
),
prescriptions.nationalityFlagURL!,
prescriptions.doctorRate,

@ -50,7 +50,7 @@ class RadiologyDetailsPage extends StatelessWidget {
finalRadiology!.doctorName!,
finalRadiology!.doctorID!,
finalRadiology!.doctorImageURL!,
finalRadiology!.speciality!,
finalRadiology!.speciality ?? [""],
Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!) ? finalRadiology!.invoiceNo_VP.toString() : finalRadiology!.invoiceNo.toString(),
finalRadiology!.projectName!,
finalRadiology!.orderDate,
@ -59,7 +59,7 @@ class RadiologyDetailsPage extends StatelessWidget {
finalRadiology!.doctorRate,
finalRadiology!.actualDoctorRate,
finalRadiology!.noOfPatientsRate,
projectViewModel.user!.emailAddress!,
projectViewModel.user.emailAddress!,
),
onTap: () {
showConfirmMessage(finalRadiology: finalRadiology!, model: model, userObj: projectViewModel.user!);

@ -20,9 +20,9 @@ class MonthlyReportsPage extends StatefulWidget {
}
class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
late bool isAgree;
late bool isSummary;
late String email;
bool isAgree = false;
bool isSummary = false;
String email = "";
final formKey = GlobalKey<FormState>();
List<ImagesInfo> imagesInfo = [];
@ -47,7 +47,7 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
isAgree = model.receiveHealthSummaryReport;
}
if (email == null) {
email = model?.user?.emailAddress ?? "";
email = model.user.emailAddress ?? "";
}
return AppScaffold(
isShowAppBar: true,
@ -99,10 +99,11 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
});
if (!isSummary) {
GifLoaderDialogUtils.showMyDialog(context);
print("is Summry: $isSummary");
await model.updatePatientHealthSummaryReport(message: TranslationBase.of(context).updateSuccessfully, isSummary: isSummary);
model.receiveHealthSummaryReport = isSummary;
isAgree = isSummary;
model.user!.emailAddress = "";
model.user.emailAddress = "";
GifLoaderDialogUtils.hideDialog(context);
}
},
@ -187,7 +188,8 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
RichText(
text: TextSpan(
text: TranslationBase.of(context).toViewTheTermsAndConditions + " ",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
style: TextStyle(
fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
children: [
TextSpan(
text: TranslationBase.of(context).clickHere,

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -41,6 +42,7 @@ class ReportListWidget extends StatelessWidget {
separatorBuilder: (context, index) => SizedBox(height: 14),
itemBuilder: (context, index) {
Reports report = reportList[index];
logger.d(report.toJson());
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
@ -105,7 +107,7 @@ class ReportListWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingBar(
initialRating: report.actualDoctorRate!.toDouble(),
initialRating:report.actualDoctorRate == null ? 0.0: report.actualDoctorRate!.toDouble(),
itemSize: 16,
ratingWidget: RatingWidget(
full: Icon(

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
@ -378,23 +379,29 @@ class DoctorsListService extends BaseService {
};
if (clinicID == 253) {
List<String> procedureID = projectViewModel!.selectedBodyPartList!.map((element) => element.id.toString()).toList();
List<String> procedureID = projectViewModel!.selectedBodyPartList.map((element) => element.id.toString()).toList();
request["GeneralProcedureList"] = procedureID;
if (procedureID.length == 1 && procedureID[0] == "1") {
request["InitialSlotDuration"] = 90;
} else {
request["InitialSlotDuration"] = projectViewModel!.laserSelectionDuration!;
request["InitialSlotDuration"] = projectViewModel.laserSelectionDuration;
}
}
dynamic localRes;
try {
await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
logger.d(error);
throw error;
}, body: request);
logger.d(localRes);
return Future.value(localRes);
} catch (e) {
logger.d(e);
return Future.error(e);
}
}
Future<Map> insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, BuildContext context) async {
@ -1841,6 +1848,4 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
}

@ -31,7 +31,7 @@ class AppToast {
int? elevation,
int imageSize = 32,
}) {
Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize);
Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds ?? 0, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize);
}
static void showErrorToast({

@ -14,4 +14,5 @@ class GifLoaderDialogUtils {
Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context).pop());
}
}
}

@ -617,7 +617,7 @@ class Utils {
List<Widget> medical = [];
medical.add(InkWell(
onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null,
onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null,
child: isLogin!
? Stack(children: [
MedicalProfileItem(

@ -56,7 +56,7 @@ class LargeAvatar extends StatelessWidget {
} else
return Center(
child: Texts(
name![0].toUpperCase(),
name == null? "" : name![0].toUpperCase(),
color: Colors.white,
fontSize: 18,
));

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -206,6 +208,7 @@ class DoctorCard extends StatelessWidget {
itemSize: 20.0,
allowHalfRating: true,
initialRating: rating!,
ignoreGestures: true,
ratingWidget: RatingWidget(
full: Icon(
Icons.star,
@ -213,7 +216,7 @@ class DoctorCard extends StatelessWidget {
),
half: Icon(
Icons.star_half,
color: Color(0XFFD02127),
color: CustomColors.accentColor,
),
empty: Icon(
Icons.star_border,

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
@ -35,30 +36,37 @@ class TimeLineView extends StatefulWidget {
class _TimeLineViewState extends State<TimeLineView> {
List<AppoitmentAllHistoryResultList> tempList = [];
List<DateObj> dateObjs = [];
DateObj selectedDateObj = DateObj(DateTime.now().month,DateTime.now().year,DateTime.now().year.toString());
final authService = new auth.AuthProvider();
DateObj? selectedDateObj;
final authService = auth.AuthProvider();
@override
void initState() {
super.initState();
dateObjs.add(new DateObj(0, 0, widget.isArabic ? "الكل" : "All"));
// selectedDateObj = DateObj(DateTime.august, 2021, 2021.toString());
dateObjs.add(DateObj(0, 0, widget.isArabic ? "الكل" : "All"));
for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) {
tempList.add(widget.appoitmentAllHistoryResultList[i]);
dateObjs.add(new DateObj(
dateObjs.add(
DateObj(
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!).month,
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!).year,
DateUtil.getMonthYearLangDateFormatted(
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!),
widget.isArabic ? "ar" : "en",
)));
),
),
);
}
dateObjs = dateObjs.toSet().toList();
dateObjs.sort((a, b) => a.month.compareTo(b.month));
dateObjs.sort((a, b) => a.year.compareTo(b.year));
logger.d(dateObjs);
// for (int i = 0; i < dateObjs.length; i++) {
// print(dateObjs[i].monthYear.toString());
// }
for (int i = 0; i < dateObjs.length; i++) {
print(dateObjs[i].monthYear.toString());
}
}
applyFilter(bool isAll) {
@ -73,7 +81,7 @@ class _TimeLineViewState extends State<TimeLineView> {
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!),
widget.isArabic ? "ar" : "en",
) ==
selectedDateObj.monthYear) {
selectedDateObj!.monthYear) {
tempList.add(widget.appoitmentAllHistoryResultList[i]);
}
}
@ -142,14 +150,14 @@ class _TimeLineViewState extends State<TimeLineView> {
items: dateObjs.map((DateObj value) {
return DropdownMenuItem<DateObj>(
value: value,
child: new AutoSizeText(
value.monthYear,
child: AutoSizeText(
'${value.monthYear}',
),
);
}).toList(),
onChanged: (r) {
onChanged: (DateObj? r) {
selectedDateObj = r!;
applyFilter(r?.year == 0 ? true : false);
applyFilter(r.year == 0 ? true : false);
setState(() {});
},
underline: Container(
@ -159,6 +167,7 @@ class _TimeLineViewState extends State<TimeLineView> {
),
),
)
: Container()
],
),

@ -39,12 +39,12 @@ class _CustomSwitchState extends State<CustomSwitch> with SingleTickerProviderSt
bool _switchStatus = _circleAnimation!.status == AnimationStatus.dismissed || _circleAnimation!.status == AnimationStatus.reverse;
return GestureDetector(
onTap: Feedback.wrapForTap(() async {
if (widget!.value!) {
if (widget.value!) {
_animationController!.reverse();
} else {
_animationController!.forward();
}
await widget!.onChanged!();
await widget.onChanged!();
}, context),
child: AnimatedContainer(
duration: Duration(milliseconds: 200),

@ -134,6 +134,7 @@ class DoctorHeader extends StatelessWidget {
RatingBar(
itemSize: 20.0,
allowHalfRating: true,
ignoreGestures: true,
initialRating: headerModel.actualDoctorRate! + 0.0,
ratingWidget: RatingWidget(
full: Icon(
@ -174,14 +175,14 @@ class DoctorHeader extends StatelessWidget {
onTap!();
},
child: Container(
padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15),
padding: EdgeInsets.only(top: 10, bottom: 10, right: 15, left: 15),
decoration: BoxDecoration(
color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(buttonIcon ?? 'assets/images/new/email.svg', width: 19.0),
SizedBox(width: 6),
SizedBox(width: 4),
Text(
buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 1),

Loading…
Cancel
Save