Merge branch 'haroon-new-design' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into haroon-new-design

merge-requests/429/head
Haroon Amjad 4 years ago
commit 134ccb7ee1

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="612px" height="612px" viewBox="0 0 612 612" style="enable-background:new 0 0 612 612;" xml:space="preserve">
<g>
<g id="_x32__22_">
<g>
<path d="M535.5,0h-459C34.253,0,0,34.253,0,76.5v459C0,577.747,34.253,612,76.5,612h459c42.247,0,76.5-34.253,76.5-76.5v-459
C612,34.253,577.747,0,535.5,0z M229.5,459c10.557,0,19.125,8.568,19.125,19.125s-8.568,19.125-19.125,19.125h-95.089
c-5.355,0-10.156-2.219-13.617-5.757c-3.71-3.137-6.043-7.707-6.043-13.368V382.5c0-10.557,8.568-19.125,19.125-19.125
S153,371.943,153,382.5l-0.421,49.075l91.379-91.38l27.043,27.043L179.239,459H229.5z M243.958,271.824l-91.379-91.398L153,229.5
c0,10.557-8.568,19.125-19.125,19.125s-19.125-8.568-19.125-19.125v-95.625c0-5.661,2.333-10.232,6.043-13.388
c3.461-3.519,8.281-5.737,13.617-5.737H229.5c10.557,0,19.125,8.568,19.125,19.125S240.057,153,229.5,153h-50.261l91.781,91.781
L243.958,271.824z M497.25,478.125c0,5.661-2.333,10.231-6.044,13.388c-3.461,3.538-8.28,5.737-13.616,5.737H382.5
c-10.557,0-19.125-8.568-19.125-19.125S371.943,459,382.5,459h50.261l-91.781-91.781l27.043-27.042l91.379,91.379L459,382.5
c0-10.557,8.568-19.125,19.125-19.125s19.125,8.568,19.125,19.125V478.125z M497.25,229.5c0,10.557-8.568,19.125-19.125,19.125
S459,240.057,459,229.5l0.421-49.075l-91.38,91.379l-27.042-27.043L432.761,153H382.5c-10.557,0-19.125-8.568-19.125-19.125
s8.568-19.125,19.125-19.125h95.09c5.336,0,10.155,2.219,13.616,5.757c3.711,3.136,6.044,7.707,6.044,13.368V229.5z"/>
</g>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

File diff suppressed because it is too large Load Diff

@ -21,6 +21,7 @@ const THEME_VALUE = 'is_vibration';
const MAIN_USER = 'main-user';
const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited';
const PHARMACY_CUSTOMER_ID = 'costumer-id';
const PHARMACY_CUSTOMER_OBJECT = 'pharmacy-customer-object';
const IS_ROBOT_VISIBLE = 'robot-visible';
const IS_ROBOT_INIT = 'robot-init';
const HMG_GEOFENCES = 'hmg-geo-fences';
@ -34,3 +35,4 @@ const H2O_REMINDER = 'H2O_REMINDER';
const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA';
const DOCTOR_SCHEDULE_DATE_SEL = 'DOCTOR_SCHEDULE_DATE_SEL';
const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL';
const CLINICS_LIST = 'CLINICS_LIST';

@ -11,6 +11,7 @@ class GetPatientICProjectsModel {
dynamic editedOn;
dynamic editedBy;
bool isActive;
dynamic distanceInKilometers;
GetPatientICProjectsModel(
{this.id,
@ -22,6 +23,7 @@ class GetPatientICProjectsModel {
this.createdBy,
this.editedOn,
this.editedBy,
this.distanceInKilometers,
this.isActive});
GetPatientICProjectsModel.fromJson(Map<String, dynamic> json) {
@ -35,6 +37,7 @@ class GetPatientICProjectsModel {
editedOn = json['EditedOn'];
editedBy = json['EditedBy'];
isActive = json['IsActive'];
distanceInKilometers = json['DistanceInKilometers'];
}
Map<String, dynamic> toJson() {
@ -49,6 +52,7 @@ class GetPatientICProjectsModel {
data['EditedOn'] = this.editedOn;
data['EditedBy'] = this.editedBy;
data['IsActive'] = this.isActive;
data['DistanceInKilometers'] = this.distanceInKilometers;
return data;
}
}

@ -7,7 +7,7 @@ class PharmacyPrescriptions {
int projectID;
String setupID;
String locationDescription;
Null locationDescriptionN;
dynamic locationDescriptionN;
String itemDescription;
Null itemDescriptionN;
String alias;
@ -16,7 +16,7 @@ class PharmacyPrescriptions {
Null companybarcode;
int cityID;
String cityName;
int distanceInKilometers;
dynamic distanceInKilometers;
String latitude;
int locationType;
String longitude;

@ -1,6 +1,6 @@
class RequestGetListPharmacyForPrescriptions {
int latitude;
int longitude;
dynamic latitude;
dynamic longitude;
double versionID;
int channel;
int languageID;

@ -1,16 +1,14 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:intl/intl.dart';
import '../../../locator.dart';
import '../base_service.dart';
class CustomerAddressesService extends BaseService {
List<AddressInfo> addressesList = List();
CustomerInfo customerInfo;
CustomerInfo customerInfo = new CustomerInfo();
Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async {
addNewAddressRequestModel.customer.email = customerInfo.email;
@ -40,7 +38,8 @@ class CustomerAddressesService extends BaseService {
Future getCustomerAddresses() async {
Map<String, String> queryParams = {'fields': 'addresses'};
hasError = false;
await baseAppClient.getPharmacy("$BASE_PHARMACY_URL$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}", onSuccess: (dynamic response, int statusCode) {
var customerID = await sharedPref.getObject(PHARMACY_CUSTOMER_ID);
await baseAppClient.getPharmacy("$BASE_PHARMACY_URL$GET_CUSTOMER_ADDRESSES$customerID", onSuccess: (dynamic response, int statusCode) {
addressesList.clear();
response["customers"][0]["addresses"].forEach((data) {
addressesList.add(AddressInfo.fromJson(data));

@ -124,7 +124,7 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
// var parsed = json.decode(response.body.toString());
var decoded = utf8.decode(response.bodyBytes);
var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
@ -569,7 +569,7 @@ class BaseAppClient {
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = "";
_vitalSignService.heightCm = "";
model.setState(0, false);
model.setState(0, false, null);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
}

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/contactus/get_patientI_cprojects.dart';
import '../base_service.dart';
@ -12,6 +13,9 @@ class LiveChatService extends BaseService {
Future getAllLiveChatOrders() async {
hasError = false;
body['List_PatientICProjects'] = false;
body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
await baseAppClient.post(GET_LIVECHAT_REQUEST,
onSuccess: (dynamic response, int statusCode) {
LivechatModelList.clear();

@ -41,10 +41,13 @@ class FeedbackService extends BaseService {
_requestInsertCOCItem.deviceInfo = Platform.localHostname;
_requestInsertCOCItem.resolution = "400x847";
_requestInsertCOCItem.projectID = 0;
_requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948";
_requestInsertCOCItem.identificationNo =
int.parse(user.patientIdentificationNo);
if (BASE_URL.contains('uat')) {
_requestInsertCOCItem.forDemo = true;
} else {
_requestInsertCOCItem.forDemo = false;
}
final Map<String, dynamic> body = _requestInsertCOCItem.toJson();

@ -18,15 +18,14 @@ class BloodSugarService extends BaseService {
Future getBloodSugar() async {
hasError = false;
Map<String, dynamic> body = Map();
monthDiabtectResultAverageList.clear();
weekDiabtectResultAverageList.clear();
yearDiabtecResultAverageList.clear();
monthDiabtecPatientResult.clear();
weekDiabtecPatientResult.clear();
yearDiabtecPatientResult.clear();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) {
monthDiabtectResultAverageList.clear();
weekDiabtectResultAverageList.clear();
yearDiabtecResultAverageList.clear();
monthDiabtecPatientResult.clear();
weekDiabtecPatientResult.clear();
yearDiabtecPatientResult.clear();
response['List_MonthDiabtectResultAverage'].forEach((item) {
monthDiabtectResultAverageList.add(MonthDiabtectResultAverage.fromJson(item));
@ -47,10 +46,10 @@ class BloodSugarService extends BaseService {
Future getDiabtecResults() async {
hasError = false;
monthDiabtecPatientResult.clear();
weekDiabtecPatientResult.clear();
yearDiabtecPatientResult.clear();
await baseAppClient.post(GET_DIABTEC_RESULT, onSuccess: (dynamic response, int statusCode) {
monthDiabtecPatientResult.clear();
weekDiabtecPatientResult.clear();
yearDiabtecPatientResult.clear();
response['List_MonthDiabtecPatientResult'].forEach((item) {
monthDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item));

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
@ -119,6 +120,13 @@ class PrescriptionsService extends BaseService {
Future getListPharmacyForPrescriptions({int itemId}) async {
hasError = false;
requestGetListPharmacyForPrescriptions.itemID = itemId;
requestGetListPharmacyForPrescriptions.latitude = await sharedPref.getDouble(USER_LAT);
requestGetListPharmacyForPrescriptions.longitude = await sharedPref.getDouble(USER_LONG);
// requestGetListPharmacyForPrescriptions.latitude = 24.709863;
// requestGetListPharmacyForPrescriptions.longitude = 46.668348;
pharmacyPrescriptionsList.clear();
await baseAppClient.post(GET_PHARMACY_LIST, onSuccess: (dynamic response, int statusCode) {
pharmacyPrescriptionsList.clear();

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -12,6 +13,7 @@ class PharmacyModuleService extends BaseService {
bool isFinished = true;
String errorMsg = '';
String url = "";
CustomerInfo customerInfo;
List<PharmacyImageObject> bannerItems = List();
List<Manufacturer> manufacturerList = List();
@ -51,8 +53,13 @@ class PharmacyModuleService extends BaseService {
hasError = false;
try {
await baseAppClient.getPharmacy(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async {
if (!response['IsRegistered']) {}
await generatePharmacyToken();
if (!response['IsRegistered']) {
} else {
customerInfo = CustomerInfo.fromJson(response);
await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId);
}
// await generatePharmacyToken();
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -122,16 +122,13 @@ class CMCViewModel extends BaseViewModel {
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken();
// await _pharmacyModuleService.createUser();
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
await _pharmacyModuleService.createUser();
// await _customerAddressesService.getCustomerInfo();
setState(ViewState.ErrorLocal);
} else {
await _pharmacyModuleService.createUser();
// await _customerAddressesService.getCustomerInfo();
await getCustomerAddresses();
}
}

@ -105,16 +105,13 @@ class HomeHealthCareViewModel extends BaseViewModel {
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken();
// await _pharmacyModuleService.createUser();
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
await _pharmacyModuleService.createUser();
// await _customerAddressesService.getCustomerInfo();
setState(ViewState.ErrorLocal);
} else {
// await _pharmacyModuleService.createUser();
await _customerAddressesService.getCustomerInfo();
await _pharmacyModuleService.createUser();
await getCustomerAddresses();
}
}

@ -115,6 +115,7 @@ class RRTViewModel extends BaseViewModel {
var success = false;
await _service.baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, body: body, onSuccess: (response, statusCode) {
success = true;
rrtServiceData.pendingOrders.remove(order);
}, onFailure: (error, statusCode) {
AppToast.showErrorToast(message: error);
success = false;
@ -151,14 +152,27 @@ class RRTViewModel extends BaseViewModel {
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _pharmacy_service.generatePharmacyToken();
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
await _pharmacy_service.createUser();
await getCustomerAddresses();
setState(ViewState.ErrorLocal);
} else {
await _customerAddressesService.getCustomerInfo();
await _pharmacy_service.createUser();
await getCustomerAddresses();
}
// setState(ViewState.Busy);
// await _pharmacy_service.generatePharmacyToken();
// if (_customerAddressesService.hasError) {
// error = _customerAddressesService.error;
// await _pharmacy_service.createUser();
// await getCustomerAddresses();
// setState(ViewState.ErrorLocal);
// } else {
// await _customerAddressesService.getCustomerInfo();
// await getCustomerAddresses();
// }
}
}

@ -20,6 +20,7 @@ class PrescriptionDeliveryViewModel extends BaseViewModel {
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken().then((value) async {
// await _customerAddressesService.getCustomerInfo();
await _customerAddressesService.getCustomerInfo();
});
if (_customerAddressesService.hasError) {

@ -39,7 +39,7 @@ class AskDoctorViewModel extends BaseViewModel {
});
} else {
setState(ViewState.Idle);
AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).askDocEmpty);
// AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).askDocEmpty);
}
}

@ -31,6 +31,11 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
List<PrescriptionsList> prescriptionsOrderListByValue(filterValue) {
return filterValue == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
}
get isMedDeliveryAllowed => _prescriptionsService.isMedDeliveryAllowed;
getPrescriptions() async {
setState(ViewState.Busy);

@ -1,39 +1,48 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart';
import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart';
import 'package:diplomaticquarterapp/core/service/notifications_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class NotificationViewModel extends BaseViewModel {
NotificationService _notificationService = locator<NotificationService>();
ToDoCountProviderModel model = Provider.of<ToDoCountProviderModel>(AppGlobal.context);
List<GetNotificationsResponseModel> get notifications =>
_notificationService.notificationsList;
List<GetNotificationsResponseModel> get notifications => _notificationService.notificationsList;
Future getNotifications(
GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async {
if(getNotificationsRequestModel.currentPage == 0)
setState(ViewState.Busy);
Future getNotifications(GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async {
if (getNotificationsRequestModel.currentPage == 0) setState(ViewState.Busy);
await _notificationService
.getAllNotifications(getNotificationsRequestModel);
await _notificationService.getAllNotifications(getNotificationsRequestModel);
if (_notificationService.hasError) {
error = _notificationService.error;
setState(ViewState.Error);
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
setState(ViewState.Idle);
}
}
Future markAsRead(id) async {
// setState(ViewState.Busy);
MarkMessageAsReadRequestModel markMessageAsReadRequestModel =
new MarkMessageAsReadRequestModel(notificationPoolID: id);
MarkMessageAsReadRequestModel markMessageAsReadRequestModel = new MarkMessageAsReadRequestModel(notificationPoolID: id);
final authService = new AuthProvider();
await _notificationService.markAsRead(markMessageAsReadRequestModel);
setState(ViewState.Idle);
await authService.getDashboard().then((value) {
var notificationCount = '';
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
});
setState(ViewState.Idle);
}
}
}

@ -2,15 +2,19 @@ import 'package:flutter/cupertino.dart';
class ToDoCountProviderModel with ChangeNotifier {
int _count;
String _notificationsCount;
bool _isShowBadge = false;
int get count => _count == null ? 0 : _count;
String get notificationsCount => _notificationsCount == null ? "0" : _notificationsCount;
bool get isShowBadge => _isShowBadge;
void setState(int count, bool isShowBadge) {
void setState(int count, bool isShowBadge, String notifCount) {
_count = count;
_isShowBadge = isShowBadge;
_notificationsCount = notifCount;
notifyListeners();
}
}
}

@ -295,13 +295,21 @@ class GetAllSharedRecordsByStatusList {
int iD;
int patientID;
int responseID;
Null relationshipID;
Null relationship;
Null relationshipN;
int regionID;
int status;
dynamic isActive;
Null isActive;
String editedOn;
String createdOn;
int age;
String emaiLAddress;
int gender;
String genderDescription;
String genderImage;
String mobileNumber;
int patientDataVerified;
String patientIdenficationNumber;
String patientName;
String statusDescription;
@ -310,13 +318,21 @@ class GetAllSharedRecordsByStatusList {
{this.iD,
this.patientID,
this.responseID,
this.relationshipID,
this.relationship,
this.relationshipN,
this.regionID,
this.status,
this.isActive,
this.editedOn,
this.createdOn,
this.age,
this.emaiLAddress,
this.gender,
this.genderDescription,
this.genderImage,
this.mobileNumber,
this.patientDataVerified,
this.patientIdenficationNumber,
this.patientName,
this.statusDescription});
@ -325,13 +341,21 @@ class GetAllSharedRecordsByStatusList {
iD = json['ID'];
patientID = json['PatientID'];
responseID = json['ResponseID'];
relationshipID = json['RelationshipID'];
relationship = json['Relationship'];
relationshipN = json['RelationshipN'];
regionID = json['RegionID'];
status = json['Status'];
isActive = json['IsActive'];
editedOn = json['EditedOn'];
createdOn = json['CreatedOn'];
age = json['Age'];
emaiLAddress = json['EmaiLAddress'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
genderImage = json['GenderImage'];
mobileNumber = json['MobileNumber'];
patientDataVerified = json['PatientDataVerified'];
patientIdenficationNumber = json['PatientIdenficationNumber'];
patientName = json['PatientName'];
statusDescription = json['StatusDescription'];
@ -342,13 +366,21 @@ class GetAllSharedRecordsByStatusList {
data['ID'] = this.iD;
data['PatientID'] = this.patientID;
data['ResponseID'] = this.responseID;
data['RelationshipID'] = this.relationshipID;
data['Relationship'] = this.relationship;
data['RelationshipN'] = this.relationshipN;
data['RegionID'] = this.regionID;
data['Status'] = this.status;
data['IsActive'] = this.isActive;
data['EditedOn'] = this.editedOn;
data['CreatedOn'] = this.createdOn;
data['Age'] = this.age;
data['EmaiLAddress'] = this.emaiLAddress;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['GenderImage'] = this.genderImage;
data['MobileNumber'] = this.mobileNumber;
data['PatientDataVerified'] = this.patientDataVerified;
data['PatientIdenficationNumber'] = this.patientIdenficationNumber;
data['PatientName'] = this.patientName;
data['StatusDescription'] = this.statusDescription;

@ -1,5 +1,6 @@
class HeaderModel {
String doctorName;
int doctorId;
String doctorImageURL;
List<String> speciality;
String invoiceNo;
@ -12,6 +13,6 @@ class HeaderModel {
int totalReviews;
String email;
HeaderModel(this.doctorName, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate, this.actualDoctorRate,
this.totalReviews, this.email);
HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate,
this.actualDoctorRate, this.totalReviews, this.email);
}

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/photo_view_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import 'new_cmc_step_tow_page.dart';
@ -124,10 +125,8 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
),
margin: EdgeInsets.all(12),
child: IconButton(
icon: Icon(
Icons.view_carousel_rounded,
color: Colors.white,
),
icon: SvgPicture.asset("assets/images/new/ic_zoom.svg",color: Colors.white,),
padding: EdgeInsets.all(12),
onPressed: () {
showDraggableDialog(context, PhotoViewPage(projectViewModel.isArabic ? "assets/images/cc_ar.png" : "assets/images/cc_en.png"));
},

@ -39,17 +39,9 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
TextEditingController _mobileTextController = TextEditingController();
bool _isSubmitted = false;
dynamic _selectedCountry = {
"name": "Saudi Arabia",
"name_ar": "المملكة العربية السعودية",
"code": "+966",
"countryCode": "SA",
"pattern": "5xxxxxxxx",
"maxLength": 9
};
dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
SearchCriteriaModel selectedCriteria = SearchCriteriaModel(
name: "Identification Number", nameAr: "رقم المحول", value: 1);
SearchCriteriaModel selectedCriteria = SearchCriteriaModel(name: "Identification Number", nameAr: "رقم المحول", value: 1);
@override
Widget build(BuildContext context) {
@ -59,23 +51,15 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
if (projectViewModel.isLogin) {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
SearchEReferralRequestModel searchEReferralRequestModel =
new SearchEReferralRequestModel(
patientMobileNumber: (projectViewModel.user.outSA == 0
? "966"
: "971") +
projectViewModel.user.mobileNumber
.substring(1, projectViewModel.user.mobileNumber.length),
SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel(
patientMobileNumber: (projectViewModel.user.outSA == 0 ? "966" : "971") + projectViewModel.user.mobileNumber.substring(1, projectViewModel.user.mobileNumber.length),
);
if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo =
_searchTextController.text;
searchEReferralRequestModel.identificationNo = _searchTextController.text;
searchEReferralRequestModel.referralNumber = 0;
} else {
searchEReferralRequestModel.referralNumber =
int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo =
projectViewModel.user.patientIdentificationNo;
searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo = projectViewModel.user.patientIdentificationNo;
}
await model.getEReferrals(searchEReferralRequestModel);
GifLoaderDialogUtils.hideDialog(context);
@ -102,15 +86,10 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getSearchCriteriaName()),
Icon(Icons.arrow_drop_down)
],
children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)],
),
),
),
@ -118,9 +97,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
height: 12,
),
NewTextFields(
hintText: selectedCriteria.value == 1
? "Enter Patient Identification No"
: "Enter Referral Number",
hintText: selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number",
controller: _searchTextController,
onChanged: (_) {
setState(() {});
@ -135,15 +112,10 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getCountryName()),
Icon(Icons.arrow_drop_down)
],
children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)],
),
),
),
@ -155,31 +127,21 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
onChange: (_) {
setState(() {});
},
code: _selectedCountry == null
? "11"
: _selectedCountry["code"],
code: _selectedCountry == null ? "11" : _selectedCountry["code"],
),
SizedBox(
height: 12,
),
if ((model.state == ViewState.Idle &&
model.allReferral.length == 0))
Center(
child: Text(
TranslationBase.of(context).noSearchResult)),
if ((model.state == ViewState.ErrorLocal))
AppEmbeddedError(error: model.error),
if ((model.state == ViewState.Idle && model.allReferral.length == 0)) Center(child: Text(TranslationBase.of(context).noSearchResult)),
if ((model.state == ViewState.ErrorLocal)) AppEmbeddedError(error: model.error),
model.allReferral.length > 0
? NetworkBaseView(
baseViewModel: model,
child: ListView.separated(
separatorBuilder: (context, index) =>
SizedBox(height: 0),
separatorBuilder: (context, index) => SizedBox(height: 0),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: model.allReferral == null
? 0
: model.allReferral.length,
itemCount: model.allReferral == null ? 0 : model.allReferral.length,
itemBuilder: (BuildContext context, int index) {
return Container(
width: double.infinity,
@ -188,9 +150,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
Navigator.push(
context,
FadePage(
page: ReferralDetails(
referral:
model.allReferral[index]),
page: ReferralDetails(referral: model.allReferral[index]),
),
);
},
@ -200,71 +160,22 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
projectViewModel.isArabic
? model
.allReferral[
index]
.statusAr
: model
.allReferral[
index]
.status,
style: TextStyle(
fontSize: 14.0,
letterSpacing: -0.56,
fontWeight:
FontWeight.bold)),
Text(projectViewModel.isArabic ? model.allReferral[index].statusAr : model.allReferral[index].status,
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Container(
margin: EdgeInsets.only(
top: 5.0),
child: myRichText(
TranslationBase.of(
context)
.patientName +
": ",
model
.allReferral[
index]
.patientName,
projectViewModel
.isArabic)),
myRichText(
TranslationBase.of(
context)
.hospital +
": ",
model.allReferral[index]
.preferredBranchName,
projectViewModel
.isArabic),
myRichText(
TranslationBase.of(
context)
.referralDate +
": ",
DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDateNoTimeZone(
model
.allReferral[
index]
.referralDate)),
projectViewModel
.isArabic),
margin: EdgeInsets.only(top: 5.0),
child: myRichText(TranslationBase.of(context).patientName + ": ", model.allReferral[index].patientName, projectViewModel.isArabic)),
myRichText(TranslationBase.of(context).hospital + ": ", model.allReferral[index].preferredBranchName, projectViewModel.isArabic),
myRichText(TranslationBase.of(context).referralDate + ": ",
DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(model.allReferral[index].referralDate)), projectViewModel.isArabic),
],
),
Icon(projectViewModel.isArabic
? Icons
.arrow_back_ios_outlined
: Icons
.arrow_forward_ios_outlined),
Icon(projectViewModel.isArabic ? Icons.arrow_back_ios_outlined : Icons.arrow_forward_outlined),
],
),
),
@ -289,23 +200,17 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(14),
child: DefaultButton(
TranslationBase.of(context).search,
(_searchTextController.text.isEmpty ||
_mobileTextController.text.isEmpty)
(_searchTextController.text.isEmpty || _mobileTextController.text.isEmpty)
? null
: () async {
SearchEReferralRequestModel
searchEReferralRequestModel =
new SearchEReferralRequestModel(
patientMobileNumber: _selectedCountry['code'] +
_mobileTextController.text,
SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel(
patientMobileNumber: _selectedCountry['code'] + _mobileTextController.text,
);
if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo =
_searchTextController.text;
searchEReferralRequestModel.identificationNo = _searchTextController.text;
searchEReferralRequestModel.referralNumber = 0;
} else {
searchEReferralRequestModel.referralNumber =
int.parse(_searchTextController.text);
searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo = '';
}
await model.getEReferrals(searchEReferralRequestModel);

@ -179,6 +179,7 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
widget.model.orderId.toString(),
onClick: () {
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: HomeHealthCarePage));
Navigator.push(context, FadePage(page: HomeHealthCarePage()));
},
);
}

@ -162,15 +162,21 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
TranslationBase.of(context).serviceName + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
...List.generate(
widget.model.hhcAllOrderDetail.length,
(index) => Container(
child: Texts(
projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 13,
bold: false,
),
),
Column(
children: [
...List.generate(
widget.model.hhcAllOrderDetail.length,
(index) => Container(
child: Texts(
projectViewModel.isArabic
? widget.model.hhcAllOrderDetail[index].descriptionN
: widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 13,
bold: false,
),
),
)
],
)
],
)

@ -121,7 +121,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).serviceName + ": ",
TranslationBase.of(context).hospital + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(

@ -1,13 +1,11 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -22,6 +20,7 @@ import 'Dialog/setting_page_radio_button_list_dialog.dart';
class H2oSetting extends StatefulWidget {
final UserDetailModel userDetailModel;
final H2OViewModel viewModel;
H2oSetting({Key key, this.userDetailModel, this.viewModel}) : super(key: key);
@override
@ -34,6 +33,9 @@ class _H2oSettingState extends State<H2oSetting> {
TextEditingController _nameController = TextEditingController();
TextEditingController _heightController = TextEditingController();
TextEditingController _weightController = TextEditingController();
List<PopupMenuItem> _weightPopupList = List();
List<PopupMenuItem> _heightPopupList = List();
bool _isUnitML = true;
bool _isGenderMale = false;
bool _isHeightCM = false;
@ -68,6 +70,7 @@ class _H2oSettingState extends State<H2oSetting> {
}
SharedPreferences prefs;
void readPrefs() async {
prefs = await SharedPreferences.getInstance();
_isUnitML = (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false;
@ -92,109 +95,122 @@ class _H2oSettingState extends State<H2oSetting> {
@override
Widget build(BuildContext context) {
_weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)];
_heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)];
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).h2o,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
showHomeAppBarIcon: false,
body: SingleChildScrollView(
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextField(
controller: _nameController,
decoration: InputDecoration(
labelText: TranslationBase.of(context).enterNameHere,
labelStyle: TextStyle(color: Colors.black87),
fillColor: Colors.white,
filled: true,
border: UnderlineInputBorder(
borderSide: BorderSide(
width: 0,
style: BorderStyle.none,
),
borderRadius: BorderRadius.circular(6.0),
),
),
),
SizedBox(height: 8),
Text(TranslationBase.of(context).preferredunit),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).ml, TranslationBase.of(context).l, _isUnitML, (value) {
if (_isUnitML != value) {
setState(() {
_isUnitML = value;
});
}
}),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Divider(height: 1.5, color: Colors.black54),
),
Text(TranslationBase.of(context).gender),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) {
if (_isGenderMale != value) {
setState(() {
_isGenderMale = value;
});
}
}),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Divider(height: 1.5, color: Colors.black54),
),
Text(TranslationBase.of(context).height),
_commonSlidersRow(_heightController, 1, 270, _heightValue, (text) {
_heightController.text = text;
}, (value) {
setState(() {
_heightValue = value;
});
}),
SizedBox(height: 8),
Text(TranslationBase.of(context).heightUnit),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).cm, TranslationBase.of(context).ft, _isHeightCM, (value) {
if (_isHeightCM != value) {
setState(() {
_isHeightCM = value;
});
}
}),
SizedBox(height: 8),
_commonSlidersRow(_weightController, 1, 250, _weightValue, (text) {
_weightController.text = text;
}, (value) {
setState(() {
_weightValue = value;
});
}),
SizedBox(height: 8),
Text(TranslationBase.of(context).weightUnit),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).kg, TranslationBase.of(context).lb, _isWeightKG, (value) {
if (_isWeightKG != value) {
setState(() {
_isWeightKG = value;
});
}
}),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Divider(height: 1.5, color: Colors.black54),
),
Container(
padding: EdgeInsets.all(8),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("${TranslationBase.of(context).birth_date}:"),
SizedBox(height: 8),
InkWell(
onTap: () {
Text(
TranslationBase.of(context).enterDetailBelow,
style: TextStyle(
fontSize: 19,
height: 23 / 19,
fontWeight: FontWeight.w700,
color: Color(0xff2E303A),
letterSpacing: -1.14,
),
),
SizedBox(height: 12),
_containerWidget(inputWidget(TranslationBase.of(context).enterNameHere, TranslationBase.of(context).name, _nameController)),
SizedBox(height: 16),
Text(
TranslationBase.of(context).preferredunit,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
SizedBox(height: 12),
_commonRadioButtonsRow(TranslationBase.of(context).mililitre, TranslationBase.of(context).litre, _isUnitML, (value) {
if (_isUnitML != value) {
setState(() {
_isUnitML = value;
});
}
}),
SizedBox(height: 12),
Text(
TranslationBase.of(context).pleaseSelectGender,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
SizedBox(height: 12),
_commonRadioButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) {
if (_isGenderMale != value) {
setState(() {
_isGenderMale = value;
});
}
}),
SizedBox(height: 18),
_commonInputAndUnitRow(
TranslationBase.of(context).height,
_heightController,
1,
270,
_heightValue,
(text) {
_heightController.text = text;
},
(value) {
_heightValue = value;
},
_isHeightCM ? TranslationBase.of(context).cm : TranslationBase.of(context).ft,
(value) {
if (_isHeightCM != value) {
setState(() {
_isHeightCM = value;
});
}
},
_heightPopupList),
SizedBox(height: 12),
_commonInputAndUnitRow(
TranslationBase.of(context).weight,
_weightController,
1,
250,
_weightValue,
(text) {
_heightController.text = text;
},
(value) {
_weightValue = value;
},
_isWeightKG ? TranslationBase.of(context).kg : TranslationBase.of(context).lb,
(value) {
if (_isWeightKG != value) {
setState(() {
_isWeightKG = value;
});
}
},
_weightPopupList),
SizedBox(height: 12),
_containerWidget(
_commonDropDownView(TranslationBase.of(context).dateOfBirth, DateUtil.getFormattedDate(_dobDate, "dd MMMM, yyyy"), () {
showModalBottomSheet(
context: context,
builder: (context) {
@ -245,71 +261,239 @@ class _H2oSettingState extends State<H2oSetting> {
]),
);
});
}, // implement cupertino dialog to select date
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(DateUtil.getFormattedDate(_dobDate, "yyyy-MM-dd")), Icon(Icons.arrow_drop_down_outlined)]),
)
}, iconData: Icons.calendar_today),
),
SizedBox(height: 12),
_containerWidget(
_commonDropDownView(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () {
showDialog(
context: context,
child: CommonRadioButtonDialog(
list: _activityLevelListEng,
title: TranslationBase.of(context).activityLevel,
onSelect: (index) {
Navigator.pop(context);
setState(() {
_selectedActiveLevel = index + 1;
});
},
selectedIndex: _selectedActiveLevel - 1,
),
);
}),
),
SizedBox(height: 18),
Text(
TranslationBase.of(context).reminderLabel,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
SizedBox(height: 12),
_containerWidget(
_commonDropDownView(TranslationBase.of(context).reminderTimesLabel, _remindedTimeListEng[_selectedRemindedTime], () {
showDialog(
context: context,
child: CommonRadioButtonDialog(
list: _remindedTimeListEng,
onSelect: (index) {
Navigator.pop(context);
setState(() {
_selectedRemindedTime = index;
});
},
selectedIndex: _selectedRemindedTime,
),
);
}),
),
],
),
),
SizedBox(height: 8),
_commonDialogSelectorRow(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () {
showDialog(
context: context,
child: CommonRadioButtonDialog(
list: _activityLevelListEng,
title: TranslationBase.of(context).activityLevel,
onSelect: (index) {
Navigator.pop(context);
setState(() {
_selectedActiveLevel = index + 1;
});
},
selectedIndex: _selectedActiveLevel - 1,
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).save,
_updateUserDetails,
color: Color(0xff349745),
),
),
],
),
);
}
Widget _containerWidget(Widget child) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: child,
);
}
Widget _commonDropDownView(String title, String value, VoidCallback callback, {IconData iconData}) {
return InkWell(
onTap: callback,
child: Row(
children: [
Expanded(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(
title,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
);
}),
SizedBox(height: 8),
_commonDialogSelectorRow(TranslationBase.of(context).reminderLabel, _remindedTimeListEng[_selectedRemindedTime], () {
showDialog(
context: context,
child: CommonRadioButtonDialog(
list: _remindedTimeListEng,
onSelect: (index) {
Navigator.pop(context);
setState(() {
_selectedRemindedTime = index;
});
},
selectedIndex: _selectedRemindedTime,
),
Text(
value,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
);
}),
SizedBox(height: 16),
SizedBox(
height: 50,
width: MediaQuery.of(context).size.width,
child: FlatButton(
color: Theme.of(context).appBarTheme.color,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
]),
),
Icon(
iconData ?? Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
],
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
),
onPressed: _updateUserDetails,
child: Text(
TranslationBase.of(context).save,
style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {
// validateForm()
},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
);
}
Widget _commonRadioButtonsRow(String rightText, String leftText, bool checkParam, Function(bool) callBack) {
return Row(
children: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(width: 22, height: 22, child: Radio(value: true, groupValue: checkParam, onChanged: callBack)),
SizedBox(width: 8),
Text(
rightText,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.44,
),
),
],
),
SizedBox(width: 12),
Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(width: 22, height: 22, child: Radio(value: false, groupValue: checkParam, onChanged: callBack)),
SizedBox(width: 8),
Text(
leftText,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.44,
),
)
),
],
),
),
],
);
}
Widget _commonButtonsRow(String rightText, String leftText, bool checkParam, Function(bool) callBack) {
return Row(children: [
Expanded(
child: SizedBox(
@ -341,101 +525,85 @@ class _H2oSettingState extends State<H2oSetting> {
]);
}
Widget _commonSlidersRow(_controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange) {
return Container(
margin: EdgeInsets.only(top: 6),
padding: EdgeInsets.all(6),
color: Colors.white,
height: 50,
child: Row(
Widget _commonInputAndUnitRow(_title, _controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange, String unitTitle,
Function(bool) onUnitTap, _list) {
return _containerWidget(
Row(
children: [
SizedBox(
width: 75,
child: TextField(
controller: _controller,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
onChanged: (value) {
double _value = double.parse(value);
if (_value > _maxValue) {
onTextValueChange(_maxValue.toStringAsFixed(0));
onValueChange(_maxValue);
return;
} else if (_value < _minValue) {
onTextValueChange(_minValue.toStringAsFixed(0));
onValueChange(_minValue);
return;
} else if (_value >= _minValue && _value <= _maxValue) {
onValueChange(_value);
return;
}
},
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
],
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 4, right: 4),
fillColor: Colors.white,
filled: true,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 1,
color: Colors.grey,
style: BorderStyle.solid,
Expanded(
flex: 3,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_title,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
borderRadius: BorderRadius.circular(6.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 1,
color: Colors.grey,
style: BorderStyle.solid,
TextField(
controller: _controller,
keyboardType: TextInputType.number,
onChanged: (value) {
double _value = double.parse(value);
if (_value > _maxValue) {
onTextValueChange(_maxValue.toStringAsFixed(0));
onValueChange(_maxValue);
return;
} else if (_value < _minValue) {
onTextValueChange(_minValue.toStringAsFixed(0));
onValueChange(_minValue);
return;
} else if (_value >= _minValue && _value <= _maxValue) {
onValueChange(_value);
return;
}
},
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
],
style: TextStyle(
color: Color(0xff575757),
letterSpacing: -0.56,
),
decoration: InputDecoration(
isDense: true,
hintText: "0",
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
borderRadius: BorderRadius.circular(6.0),
),
),
],
),
),
Container(height: 34, width: 1, color: Color(0xffE0E0E0), margin: EdgeInsets.only(left: 12, right: 12)),
Expanded(
flex: 6,
child: Slider(
min: _minValue,
max: _maxValue,
activeColor: Colors.redAccent,
inactiveColor: Colors.redAccent.withOpacity(.3),
value: _valueOrg,
onChanged: (value) {
onTextValueChange(value.toStringAsFixed(0));
onValueChange(value);
},
),
flex: 1,
child: PopupMenuButton(
child: _commonDropDownView(TranslationBase.of(context).unit, unitTitle, null),
onSelected: (value) {
onUnitTap(value);
},
itemBuilder: (context) => _list),
)
],
),
);
}
Widget _commonDialogSelectorRow(String title, String selectedText, VoidCallback onPressed) {
return Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
Text(title),
SizedBox(height: 8),
InkWell(
onTap: onPressed,
child: Container(
height: 50,
padding: EdgeInsets.all(8),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(selectedText), Icon(Icons.arrow_drop_down_outlined)],
),
),
)
]);
}
void _updateUserDetails() async {
_userDetailModel.height = _heightValue;
_userDetailModel.weight = _weightValue;
@ -469,6 +637,7 @@ class _H2oSettingState extends State<H2oSetting> {
}
final CalendarPlugin _myPlugin = CalendarPlugin();
void _addReminderToCalender(int _selectedRemindedTime) async {
bool _calendarPermission = await _myPlugin.hasPermissions();
if (_calendarPermission) {

@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart';
@ -13,11 +14,12 @@ import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class H2OPage extends StatefulWidget {
@override
@ -44,98 +46,121 @@ class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<H2OViewModel>(
onModelReady: (model) => model.getUserDetail(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).waterTracker,
description: TranslationBase.of(context).h2oInfo,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
imagesInfo: [
ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/ar/0.png')
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/ar/0.png')
],
showHomeAppBarIcon: false,
baseViewModel: model,
isHelp: true,
appBarIcons: [
model.isLogin
? IconButton(
icon: Image.asset("assets/images/new-design/setting_gear_icon.png"),
color: Colors.white,
onPressed: () {
Navigator.push(
context,
FadePage(
page: H2oSetting(userDetailModel: model.userDetail, viewModel: model),
),
);
},
)
: Container(),
],
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0),
child: Stack(
children: <Widget>[
Positioned(
bottom: 1,
left: 0,
right: 0,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container(
color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8),
height: 70.0,
),
),
),
Center(
child: Container(
height: 60.0,
alignment: Alignment.center,
// margin: EdgeInsets.only(top: 10.0),
// width: MediaQuery.of(context).size.width * 0.9,
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(TranslationBase.of(context).today),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(TranslationBase.of(context).week),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(TranslationBase.of(context).month),
),
),
],
),
if (model.isLogin)
IconButton(
icon: Icon(Icons.settings),
color: Color(0xff2B353E),
onPressed: () {
Navigator.push(
context,
FadePage(
page: H2oSetting(userDetailModel: model.userDetail, viewModel: model),
),
),
],
);
},
),
),
backgroundColor: Colors.white,
],
body: Scaffold(
// extendBodyBehindAppBar: true,
// appBar: PreferredSize(
// preferredSize: Size.fromHeight(65.0),
// child: Stack(
// children: <Widget>[
// Positioned(
// bottom: 1,
// left: 0,
// right: 0,
// child: BackdropFilter(
// filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
// child: Container(
// color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8),
// height: 70.0,
// ),
// ),
// ),
// Center(
// child: Container(
// height: 60.0,
// alignment: Alignment.center,
// // margin: EdgeInsets.only(top: 10.0),
// // width: MediaQuery.of(context).size.width * 0.9,
//
// child: TabBar(
// isScrollable: false,
// controller: _tabController,
// indicatorWeight: 5.0,
// indicatorSize: TabBarIndicatorSize.tab,
// indicatorColor: Colors.red[800],
// labelColor: Theme.of(context).primaryColor,
// labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
// unselectedLabelColor: Colors.grey[800],
// tabs: [
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).today),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).week),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).month),
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// backgroundColor: Colors.white,
body: Column(
children: <Widget>[
TabBar(
controller: _tabController,
indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)],
),
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),

@ -2,15 +2,23 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:wave/config.dart';
import 'package:wave/wave.dart';
import 'Dialog/confirm_add_amount_dialog.dart';
import 'add_custom_amount.dart';
class TodayPage extends StatelessWidget {
Future<bool> readPrefs() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false;
@ -25,23 +33,16 @@ class TodayPage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model,
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 12),
child: Container(
margin: EdgeInsets.only(top: 60),
child: Column(
children: [
Center(
child: CircularPercentIndicator(
radius: 180.0,
animation: true,
animationDuration: 1200,
lineWidth: 15.0,
percent: model.userProgressData == null
? 0.0
: (model.userProgressData.percentageConsumed / 100) >= 1
? 1
: (model.userProgressData.percentageConsumed / 100),
center: Center(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 320,
child: Row(
children: [
Expanded(
child: FutureBuilder<bool>(
future: readPrefs(),
builder: (context, data) {
@ -56,121 +57,214 @@ class TodayPage extends StatelessWidget {
unit = TranslationBase.of(context).l;
}
unit = unit.toLowerCase();
var totalH2O = model?.userProgressData?.quantityLimit ?? 0.0;
var consumedH2O = model?.userProgressData?.quantityConsumed ?? 0.0;
double totalH2O = model?.userProgressData?.quantityLimit ?? 0.0;
double consumedH2O = model?.userProgressData?.quantityConsumed ?? 0.0;
if (!isUnitML) {
totalH2O = totalH2O / 1000;
consumedH2O = consumedH2O / 1000;
}
if (consumedH2O > totalH2O) {
consumedH2O = totalH2O;
}
double divide = consumedH2O / totalH2O;
String percentage = (divide * 100).toStringAsFixed(0);
var remainingH2O = totalH2O - consumedH2O;
return Column(
mainAxisSize: MainAxisSize.min,
children: [
// SizedBox(
// height: 40,
// ),
Text(
TranslationBase.of(context).consumed,
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
),
Text(
model.userProgressData == null ? "0.0" : "$consumedH2O $unit",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")),
),
SizedBox(
height: 4,
),
SizedBox(
height: 5,
width: 50,
child: Container(),
),
SizedBox(
height: 4,
),
Text(
TranslationBase.of(context).remaining,
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
),
Text(
model.userProgressData == null
? "0.0"
: (remainingH2O) < 0
? "0 $unit"
: '$remainingH2O $unit',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0),
),
],
return AspectRatio(
aspectRatio: 234 / 320,
child: Stack(
alignment: Alignment.center,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(18),
child: WaveWidget(
config: CustomConfig(
colors: [Color(0xff0d47a1), Color(0xff1976d2), Color(0xff2196f3)],
durations: [19440, 10800, 6000],
heightPercentages: [1 - divide - .10, 1 - divide - .05, 1 - divide],
blur: MaskFilter.blur(BlurStyle.solid, 0),
),
waveAmplitude: 0,
backgroundColor: Color(0xff2e303a),
size: Size(
double.infinity,
double.infinity,
),
),
),
Padding(
padding: const EdgeInsets.only(top: 12, bottom: 12),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
remainingH2O.toStringAsFixed(0) + "$unit " + TranslationBase.of(context).left.toLowerCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Colors.white,
letterSpacing: -0.56,
),
),
Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
"$percentage%",
style: TextStyle(
fontSize: 34,
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: -2.34,
),
),
Text(
TranslationBase.of(context).consumed,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Colors.white,
letterSpacing: -0.56,
),
),
],
),
],
),
)
],
),
);
},
),
),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: HexColor("#D1E3F6"),
progressColor: HexColor("#60BCF9"),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"${TranslationBase.of(context).remaining} %",
style: TextStyle(fontSize: 16.0),
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"${TranslationBase.of(context).consumed} %",
style: TextStyle(fontSize: 16.0),
)
],
SizedBox(width: 21),
SizedBox(
height: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_circularButton(context, 600, model),
SizedBox(height: 8),
_circularButton(context, 330, model),
SizedBox(height: 8),
_circularButton(context, 200, model),
// SizedBox(height: 8),
// _circularButton(context, 0, model, isCustom: true),
SizedBox(height: 8),
InkWell(
onTap: () => undoVolume(context, model),
child: Text(
TranslationBase.of(context).undo,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xffD02127),
letterSpacing: -0.56,
decoration: TextDecoration.underline,
),
),
),
],
),
)
],
),
SizedBox(
height: 30,
),
SizedBox(
height: 0.5,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey,
),
),
],
),
),
SizedBox(height: 40),
// Text(
// TranslationBase.of(context).addCustomAmount,
// style: TextStyle(
// fontSize: 14,
// height: 21 / 14,
// fontWeight: FontWeight.w600,
// color: Color(0xff2B353E),
// letterSpacing: -0.56,
// ),
// ),
],
),
),
floatingActionButton: H20FloatingActionButton(
// controller: _controller,
model: model,
// floatingActionButton: H20FloatingActionButton(
// // controller: _controller,
// model: model,
// ),
),
);
}
Widget _circularButton(context, int value, model, {bool isCustom = false}) {
String _text = "$value${TranslationBase.of(context).ml}";
if (isCustom) {
_text = TranslationBase.of(context).custom;
}
return InkWell(
onTap: () {
if (isCustom) {
Navigator.push(
context,
FadePage(
page: AddCustomAmount(
model: model,
),
),
);
} else {
showConfirmMessage(context, value, model);
}
},
child: Container(
padding: EdgeInsets.all(21),
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(width: 1, color: Color(0xffDEDEDE)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
TranslationBase.of(context).add,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
color: Color(0xff575757),
letterSpacing: -0.44,
),
),
Text(
_text,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
],
),
),
);
}
void showConfirmMessage(context, int amount, H2OViewModel model) {
showDialog(
context: context,
child: ConfirmAddAmountDialog(
model: model,
amount: amount,
),
);
}
void undoVolume(context, H2OViewModel model) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.undoUserActivity();
GifLoaderDialogUtils.hideDialog(context);
}
}

@ -74,6 +74,7 @@ class _BookConfirmState extends State<BookConfirm> {
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
"",
@ -345,12 +346,12 @@ class _BookConfirmState extends State<BookConfirm> {
}
getToDoCount() {
toDoProvider.setState(0, true);
toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {}
}).catchError((err) {
print(err);

@ -60,6 +60,7 @@ class _BookSuccessState extends State<BookSuccess> {
DoctorHeader(
headerModel: HeaderModel(
widget.docObject.name,
widget.docObject.doctorID,
widget.docObject.doctorImageURL,
widget.docObject.speciality,
"",

@ -103,6 +103,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
"",
@ -145,7 +146,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
onTap: (index) {
setState(() {
if (index == 1) {
if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.isLiveCareAppointment) {
if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.doctor.clinicID == 47 || widget.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex;
showFooterButton = false;
} else {
@ -499,7 +500,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
dialog.showAlertDialog(context);
}
} else
AppToast.showErrorToast(message: "Please select Time Slot to continue");
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
}
navigateToLogin() {

@ -70,6 +70,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
DoctorHeader(
headerModel: HeaderModel(
widget.docObject.name,
widget.docObject.doctorID,
widget.docObject.doctorImageURL,
widget.docObject.speciality,
"",
@ -191,7 +192,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
disabledTextColor: Colors.white,
disabledColor: CustomColors.green,
onPressed: () async {
print(widget.patientShareResponse.appointmentNo);
print(widget.patientShareResponse.appointmentNo);
showReminderDialog(
context,
widget.dateTime,
@ -201,7 +202,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
widget.appoTimeFormatted,
onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
navigateToBookSuccess(context);
navigateToBookSuccess(context);
},
);
},

@ -7,11 +7,13 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../../../uitl/date_uitl.dart';
@ -24,6 +26,7 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedTime;
bool isLiveCareAppointment;
final dynamic doctorSchedule;
DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment});
@override
@ -55,8 +58,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
@override
void didUpdateWidget(covariant DocAvailableAppointments oldWidget) {
if (oldWidget.doctorSchedule != widget.doctorSchedule) {
_calendarController.setSelectedDay(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), isProgrammatic: true);
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), List());
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']));
_calendarController.selectedDate = DateUtil.convertStringToDate(widget.doctorSchedule['Date']);
}
super.didUpdateWidget(oldWidget);
}
@ -99,28 +102,17 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
super.dispose();
}
void _onDaySelected(DateTime day, List events) {
void _onDaySelected(DateTime day) {
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, language);
openTimeSlotsPickerForDate(day, docFreeSlots);
DocAvailableAppointments.selectedDate = formatter.format(day);
print(DocAvailableAppointments.selectedDate);
_calendarController.selectedDate = day;
print(_calendarController.selectedDate);
});
}
void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onVisibleDaysChanged');
print(first);
print(last);
}
void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onCalendarCreated');
print(first);
print(last);
}
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
@ -134,30 +126,36 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
),
Container(
height: 40,
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border
),
),
minWidth: MediaQuery.of(context).size.width * 0.18,
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
);
},
),
),
DocAvailableAppointments.areSlotsAvailable
? Container(
height: 40,
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border
),
),
minWidth: MediaQuery.of(context).size.width * 0.18,
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
);
},
),
)
: Center(
child: Padding(
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)),
)),
],
),
),
@ -166,99 +164,42 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
Widget _buildTableCalendarWithBuilders() {
return Card(
shape: cardRadius(12),
margin: EdgeInsets.all(16),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.only(bottom: 12),
child: TableCalendar(
locale: language == "en" ? 'en_US' : 'ar_SA',
calendarController: _calendarController,
events: _events,
initialCalendarFormat: CalendarFormat.month,
startDay: DateTime.now(),
formatAnimation: FormatAnimation.slide,
startingDayOfWeek: StartingDayOfWeek.sunday,
weekendDays: [DateTime.friday, DateTime.saturday],
availableGestures: AvailableGestures.horizontalSwipe,
availableCalendarFormats: const {
CalendarFormat.month: '',
CalendarFormat.week: '',
},
calendarStyle: CalendarStyle(
outsideDaysVisible: false,
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
),
headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
builders: CalendarBuilders(
selectedDayBuilder: (context, date, _) {
return FadeTransition(
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
child: Container(
margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 5.0),
color: Colors.transparent,
width: 0,
height: 0,
child: Text(
'${date.day}',
style: TextStyle().copyWith(fontSize: 14.0),
),
),
);
},
todayDayBuilder: (context, date, _) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.transparent
: Color(0xff76cfb7),
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
),
);
},
markersBuilder: (context, date, events, _) {
final children = <Widget>[];
if (events.isNotEmpty) {
children.add(
Positioned(
right: 4,
bottom: 4,
child: _buildEventsMarker(date, events),
),
);
}
return children;
},
shape: cardRadius(12),
margin: EdgeInsets.all(16),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.only(bottom: 12),
child: Container(
child: SfCalendar(
controller: _calendarController,
minDate: DateTime.now(),
showNavigationArrow: true,
headerStyle: CalendarHeaderStyle(textAlign: TextAlign.center, textStyle: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
viewHeaderStyle: ViewHeaderStyle(dayTextStyle: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black)),
view: CalendarView.month,
todayHighlightColor: CustomColors.green,
selectionDecoration: containerColorRadiusBorderWidthCircular(Colors.transparent, 4, CustomColors.green, 2.5),
cellBorderColor: Colors.white,
dataSource: MeetingDataSource(_getDataSource()),
monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date;
_onDaySelected(details.date);
},
),
),
onDaySelected: (date, event, _) {
_onDaySelected(date, event);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
),
),
);
));
}
List<Meeting> _getDataSource() {
final List<Meeting> meetings = <Meeting>[];
_events.forEach((key, value) {
final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0);
final DateTime endTime = startTime.add(const Duration(hours: 2));
meetings.add(Meeting("", startTime, endTime, CustomColors.green, false));
});
return meetings;
}
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
@ -270,14 +211,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
});
setState(() {
if (dayEvents.length != 0)
if (dayEvents.length != 0) {
DocAvailableAppointments.areSlotsAvailable = true;
else
selectedButtonIndex = 0;
DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime;
} else
DocAvailableAppointments.areSlotsAvailable = false;
selectedButtonIndex = 0;
DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime;
});
}
@ -299,7 +238,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
selectedDateJSON = freeSlotsResponse[0];
});
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
_calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON);
return _eventsParsed;
}
@ -321,7 +260,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
Widget getSelectedButton(int index) {
return RaisedButton(
color: CustomColors.green, //Color of the border
color: CustomColors.green,
//Color of the border
textColor: Colors.white,
elevation: 0,
onPressed: () {
@ -352,10 +292,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_events.clear(),
_events = value,
if (widget.doctorSchedule != null)
{
_calendarController.setSelectedDay(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), isProgrammatic: true),
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), List())
}
{_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date'])), _calendarController.selectedDate = DateUtil.convertStringToDate(widget.doctorSchedule['Date'])}
});
});
} else {
@ -403,29 +340,49 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
this.language = languageID;
});
}
}
Widget _buildEventsMarker(DateTime date, List events) {
return Container(
decoration: containerColorRadiusBorderWidth(
_calendarController.isSelected(date)
? CustomColors.green
: _calendarController.isToday(date)
? CustomColors.green.withOpacity(0.5)
: Colors.white,
200,
_calendarController.isSelected(date) ? CustomColors.green : Colors.black,
2),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
fontSize: 14.0,
),
),
),
);
class MeetingDataSource extends CalendarDataSource {
MeetingDataSource(List<Meeting> source) {
appointments = source;
}
@override
DateTime getStartTime(int index) {
return _getMeetingData(index).from;
}
@override
DateTime getEndTime(int index) {
return _getMeetingData(index).to;
}
@override
String getSubject(int index) {
return _getMeetingData(index).eventName;
}
@override
Color getColor(int index) {
return _getMeetingData(index).background;
}
@override
bool isAllDay(int index) {
return _getMeetingData(index).isAllDay;
}
Meeting _getMeetingData(int index) {
final dynamic meeting = appointments[index];
Meeting meetingData;
if (meeting is Meeting) {
meetingData = meeting;
}
return meetingData;
}
}
class Meeting {
Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);
String eventName;
DateTime from;
DateTime to;
Color background;
bool isAllDay;
}

@ -1,5 +1,6 @@
import "dart:collection";
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
@ -429,24 +430,36 @@ class _SearchByClinicState extends State<SearchByClinic> {
return false;
}
getClinicsList() {
getClinicsList() async {
GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService();
service.getClinicsList(context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
isMobileAppDentalAllow = res['ISMobileAppDentalAllow'];
res['ListClinicCentralized'].forEach((v) {
clinicsList.add(new ListClinicCentralized.fromJson(v));
});
if (await sharedPref.getObject(CLINICS_LIST) != null) {
dynamic res = await sharedPref.getObject(CLINICS_LIST);
setState(() {
isMobileAppDentalAllow = res['ISMobileAppDentalAllow'];
res['ListClinicCentralized'].forEach((v) {
clinicsList.add(new ListClinicCentralized.fromJson(v));
});
getProjectsList();
GifLoaderDialogUtils.hideDialog(context);
} else {}
}).catchError((err) {
print(err);
});
getProjectsList();
GifLoaderDialogUtils.hideDialog(context);
});
} else {
ClinicListService service = new ClinicListService();
service.getClinicsList(context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
isMobileAppDentalAllow = res['ISMobileAppDentalAllow'];
res['ListClinicCentralized'].forEach((v) {
clinicsList.add(new ListClinicCentralized.fromJson(v));
});
});
getProjectsList();
GifLoaderDialogUtils.hideDialog(context);
} else {}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
}
}
getProjectsList() {

@ -74,7 +74,7 @@ class DoctorView extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName, projectViewModel.isArabic),
if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName, projectViewModel.isArabic),
if (doctor.projectName != null) myRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic),
if (doctor.speciality != null)
Text(
getDoctorSpeciality(this.doctor.speciality).trim(),
@ -99,7 +99,11 @@ class DoctorView extends StatelessWidget {
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
if (isShowFlag) Image.network(this.doctor.nationalityFlagURL, width: 22.0, height: 22.0)
if (isShowFlag) Icon(
Icons.arrow_forward,
color: Theme.of(context).primaryColor,
),
// if (isShowFlag) Image.network(this.doctor.nationalityFlagURL, width: 22.0, height: 22.0)
],
),
],

@ -115,7 +115,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
mHeight(20),
Text(
"When would you like to set a reminder for this appointment?",
TranslationBase.of(context).appointmentReminder,
style: TextStyle(
fontSize: 16,
color: Color(0xff2B353E),
@ -125,7 +125,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
mHeight(20),
Text(
"Please select from below options:",
TranslationBase.of(context).pleaseSelectFromBelowOptions,
style: TextStyle(
fontSize: 12,
color: Color(0xff2B353E),
@ -135,7 +135,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
ListTile(
contentPadding: EdgeInsets.zero,
title: const Text('Before 30 Mins'),
title: Text(TranslationBase.of(context).appoReminder30),
leading: Radio<int>(
value: 0,
groupValue: i,
@ -148,7 +148,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
ListTile(
contentPadding: EdgeInsets.zero,
title: const Text('Before 1 Hour'),
title: Text(TranslationBase.of(context).appoReminder60),
leading: Radio<int>(
value: 1,
groupValue: i,
@ -161,7 +161,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
ListTile(
contentPadding: EdgeInsets.zero,
title: const Text('Before 1 Hour and 30 Mins'),
title: Text(TranslationBase.of(context).appoReminder90),
leading: Radio<int>(
value: 2,
groupValue: i,
@ -174,7 +174,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
ListTile(
contentPadding: EdgeInsets.zero,
title: const Text('Before 2 Hours'),
title: Text(TranslationBase.of(context).appoReminder120),
leading: Radio<int>(
value: 3,
groupValue: i,

@ -45,7 +45,6 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
children: [
Text(
TranslationBase.of(context).instructions,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
),
SizedBox(height: 20),
@ -87,12 +86,12 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
children: <Widget>[
Expanded(
child: Text(
model.LiveChatModelList[index]?.projectName ?? "",
model.LiveChatModelList[index].projectName.toString() + "\n" + model.LiveChatModelList[index].distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: tappedIndex == index ? Colors.white : Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
),
),
Icon(
Icons.arrow_forward_ios,
Icons.arrow_forward,
color: tappedIndex == index ? Colors.white : Colors.black,
),
],

@ -45,7 +45,7 @@ class _LiveChatPageState extends State<LiveChatPage> with SingleTickerProviderSt
imagesInfo: imagesInfo,
title: TranslationBase.of(context).liveChat,
description: TranslationBase.of(context).infoChat,
appBarTitle: TranslationBase.of(context).service,
appBarTitle: TranslationBase.of(context).liveChat,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,

@ -32,7 +32,6 @@ class PharmaciesLiveChatPage extends StatelessWidget {
SizedBox(height: 20),
Text(
TranslationBase.of(context).instructions,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
),
],
@ -44,14 +43,13 @@ class PharmaciesLiveChatPage extends StatelessWidget {
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).start,
() {
String chat;
chat =
"http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic ? 1 : 2}";
launch(chat);
},
color: Color(0xffD02127),
textColor: Colors.white,
null,
// () {
// String chat;
// chat =
// "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic ? 1 : 2}";
// launch(chat);
// },
disabledColor: Color(0xffEAEAEA),
),
),

@ -21,10 +21,11 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:table_calendar/table_calendar.dart';
// import 'package:table_calendar/table_calendar.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
class CovidTimeSlots extends StatefulWidget {
int projectID;
@ -100,24 +101,17 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
super.dispose();
}
void _onDaySelected(DateTime day, List events, ProjectViewModel projectViewModel) {
void _onDaySelected(DateTime day, ProjectViewModel projectViewModel) {
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en");
openTimeSlotsPickerForDate(day, docFreeSlots);
CovidTimeSlots.selectedDate = formatter.format(day);
_calendarController.selectedDate = day;
print(CovidTimeSlots.selectedDate);
});
}
void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onVisibleDaysChanged');
}
void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onCalendarCreated');
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -151,6 +145,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
fontWeight: FontWeight.w600,
),
),
mHeight(12),
Card(
shape: cardRadius(12),
child: _buildTableCalendarWithBuilders(projectViewModel),
@ -165,30 +160,36 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
),
),
mHeight(8),
Container(
height: 40,
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border
),
),
minWidth: MediaQuery.of(context).size.width * 0.2,
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
);
},
),
),
CovidTimeSlots.areSlotsAvailable
? Container(
height: 40,
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border
),
),
minWidth: MediaQuery.of(context).size.width * 0.2,
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
);
},
),
)
: Center(
child: Padding(
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)),
)),
],
),
),
@ -239,95 +240,35 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
}
Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
return TableCalendar(
locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US',
calendarController: _calendarController,
events: _events,
initialCalendarFormat: CalendarFormat.month,
startDay: DateTime.now(),
formatAnimation: FormatAnimation.slide,
startingDayOfWeek: StartingDayOfWeek.sunday,
weekendDays: [DateTime.friday, DateTime.saturday],
availableGestures: AvailableGestures.horizontalSwipe,
availableCalendarFormats: const {
CalendarFormat.month: '',
CalendarFormat.week: '',
},
calendarStyle: CalendarStyle(
outsideDaysVisible: false,
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
),
headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
builders: CalendarBuilders(
selectedDayBuilder: (context, date, _) {
return FadeTransition(
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
child: Container(
margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 6.0),
color: Colors.transparent,
width: 0,
height: 0,
child: Text(
'${date.day}',
style: TextStyle().copyWith(fontSize: 14.0),
),
),
);
},
todayDayBuilder: (context, date, _) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.transparent
: Color(0xff76cfb7),
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
),
);
},
markersBuilder: (context, date, events, holidays) {
final children = <Widget>[];
if (events.isNotEmpty) {
children.add(
Positioned(
right: 4,
bottom: 4,
child: _buildEventsMarker(date, events),
),
);
}
return children;
},
),
onDaySelected: (date, event, _) {
_onDaySelected(date, event, projectViewModel);
_animationController.forward(from: 0.0);
return SfCalendar(
controller: _calendarController,
minDate: DateTime.now(),
showNavigationArrow: true,
headerStyle: CalendarHeaderStyle(textAlign: TextAlign.center, textStyle: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
viewHeaderStyle: ViewHeaderStyle(dayTextStyle: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black)),
view: CalendarView.month,
todayHighlightColor: CustomColors.green,
selectionDecoration: containerColorRadiusBorderWidthCircular(Colors.transparent, 4, CustomColors.green, 2.5),
cellBorderColor: Colors.white,
dataSource: MeetingDataSource(_getDataSource()),
monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date;
_onDaySelected(details.date, projectViewModel);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
);
}
List<Meeting> _getDataSource() {
final List<Meeting> meetings = <Meeting>[];
_events.forEach((key, value) {
final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0);
final DateTime endTime = startTime.add(const Duration(hours: 2));
meetings.add(Meeting("", startTime, endTime, CustomColors.green, false));
});
return meetings;
}
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
dayEvents.clear();
DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
@ -337,14 +278,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
});
setState(() {
if (dayEvents.length != 0)
if (dayEvents.length != 0) {
CovidTimeSlots.areSlotsAvailable = true;
else
selectedButtonIndex = 0;
CovidTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime;
} else
CovidTimeSlots.areSlotsAvailable = false;
selectedButtonIndex = 0;
CovidTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime;
});
}
@ -366,43 +305,43 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots'];
});
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
_calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON);
return _eventsParsed;
}
Widget _buildEventsMarker(DateTime date, List events) {
return Container(
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: _calendarController.isSelected(date)
// ? Colors.green[400]
// : _calendarController.isToday(date)
// ? Colors.brown[300]
// : Colors.blue[400],
// ),
decoration: containerColorRadiusBorderWidth(
_calendarController.isSelected(date)
? CustomColors.green
: _calendarController.isToday(date)
? CustomColors.green.withOpacity(0.5)
: Colors.white,
200,
_calendarController.isSelected(date) ? CustomColors.green : Colors.black,
2),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
fontSize: 13.0,
),
),
),
);
}
// Widget _buildEventsMarker(DateTime date, List events) {
// return Container(
// // decoration: BoxDecoration(
// // shape: BoxShape.circle,
// // color: _calendarController.isSelected(date)
// // ? Colors.green[400]
// // : _calendarController.isToday(date)
// // ? Colors.brown[300]
// // : Colors.blue[400],
// // ),
//
// decoration: containerColorRadiusBorderWidth(
// _calendarController.isSelected(date)
// ? CustomColors.green
// : _calendarController.isToday(date)
// ? CustomColors.green.withOpacity(0.5)
// : Colors.white,
// 200,
// _calendarController.isSelected(date) ? CustomColors.green : Colors.black,
// 2),
// width: 40.0,
// height: 40.0,
// child: Center(
// child: Text(
// '${date.day}',
// style: TextStyle().copyWith(
// color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
// fontSize: 13.0,
// ),
// ),
// ),
// );
// }
Widget getNormalButton(int index) {
return RaisedButton(
@ -436,12 +375,16 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
}
bookCovidTestAppointment() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID;
docObject.projectID = widget.projectID;
insertAppointmentCovidTest(context, docObject);
if(CovidTimeSlots.areSlotsAvailable) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID;
docObject.projectID = widget.projectID;
insertAppointmentCovidTest(context, docObject);
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
}
}
insertAppointmentCovidTest(context, DoctorList docObject) {
@ -485,12 +428,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
}
getToDoCount() {
toDoProvider.setState(0, true);
toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {}
}).catchError((err) {
print(err);
@ -546,8 +489,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
if (res['COVID19_FreeTimeSlots'].length != 0) {
freeSlotsResponse = res['COVID19_FreeTimeSlots'];
_getJSONSlots().then((value) => {
setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value})
});
setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value})
});
} else {}
} else {
GifLoaderDialogUtils.hideDialog(context);
@ -560,3 +503,53 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
});
}
}
class MeetingDataSource extends CalendarDataSource {
MeetingDataSource(List<Meeting> source) {
appointments = source;
}
@override
DateTime getStartTime(int index) {
return _getMeetingData(index).from;
}
@override
DateTime getEndTime(int index) {
return _getMeetingData(index).to;
}
@override
String getSubject(int index) {
return _getMeetingData(index).eventName;
}
@override
Color getColor(int index) {
return _getMeetingData(index).background;
}
@override
bool isAllDay(int index) {
return _getMeetingData(index).isAllDay;
}
Meeting _getMeetingData(int index) {
final dynamic meeting = appointments[index];
Meeting meetingData;
if (meeting is Meeting) {
meetingData = meeting;
}
return meetingData;
}
}
class Meeting {
Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);
String eventName;
DateTime from;
DateTime to;
Color background;
bool isAllDay;
}

@ -170,6 +170,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
onChanged: (newValue) {
setState(() {
obj["ans"] = newValue;
checkAllChecked();
});
}),
Text(
@ -192,6 +193,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
onChanged: (newValue) {
setState(() {
obj["ans"] = newValue;
checkAllChecked();
});
}),
Text(
@ -228,7 +230,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
child: MaterialButton(
height: 50,
elevation: 0,
color: CustomColors.accentColor,
color: all2 ? CustomColors.accentColor : CustomColors.grey,
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(
@ -249,6 +251,17 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
));
}
bool all2 = false;
checkAllChecked() {
all2 = true;
qa.forEach((element) {
if (element["ans"] == 2 || element["ans"] == null) {
all2 = false;
}
});
}
next() async {
bool all = true;
qa.forEach((element) {

@ -117,6 +117,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
onTap: () {
setState(() {
widget.selectedProcedure = widget.proceduresList[index];
getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
});
},
child: ListTile(

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -251,7 +252,16 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
if (isPaymentMade) checkPaymentStatus(appo);
if (isPaymentMade) {
checkPaymentStatus(appo);
} else {
print("onBrowserExit Payment Not made");
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
}
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {

@ -51,6 +51,8 @@ class _AddMember extends State<AddMember> {
return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: isLoading == true
? AppCircularProgressIndicator()
: SingleChildScrollView(
@ -69,7 +71,7 @@ class _AddMember extends State<AddMember> {
Expanded(
flex: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
//MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
@ -88,24 +90,24 @@ class _AddMember extends State<AddMember> {
],
),
),
// Expanded(
// flex: 3,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// Row(
// children: <Widget>[
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).add,
// () => {this.addMember()},
// color: isButtonDisabled == true ? Colors.grey : Colors.grey[900],
// textColor: Colors.white,
// ))
// ],
// ),
// ],
// ))
Expanded(
flex: 3,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).add,
() => {this.addMember()},
color: isButtonDisabled == true ? Colors.grey : Colors.red[600],
textColor: Colors.white,
))
],
),
],
))
]),
)));
}

@ -6,6 +6,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:diplomaticquarterapp/widgets/habib_logo_widget.dart';
class AddFamilyMemberType extends StatelessWidget {
static int loginType = 0;
@ -14,139 +16,204 @@ class AddFamilyMemberType extends StatelessWidget {
return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Padding(
padding: EdgeInsets.all(20),
child: Column(
children: <Widget>[
Expanded(
flex: 6,
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/habib-logo.png',
height: 80,
width: 80,
),
Padding(
padding: EdgeInsets.all(20),
child: AppText(
TranslationBase.of(context).registerInfoFamily,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
),
),
Padding(
padding: EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
AddFamilyMemberType.loginType = 1,
Navigator.of(context)
.pushNamed(ADD_FAMILY_MEMBER)
},
child: RoundedContainer(
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(
20, 10, 20, 10),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/id_card_icon.png',
height: SizeConfig
.imageSizeMultiplier *
12,
width: SizeConfig
.imageSizeMultiplier *
15,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context)
.idNo,
fontSize: SizeConfig
.textMultiplier *
2,
)
],
),
)))),
Expanded(
child: InkWell(
onTap: () => {
AddFamilyMemberType.loginType = 2,
Navigator.of(context)
.pushNamed(ADD_FAMILY_MEMBER)
},
child: RoundedContainer(
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(
25, 10, 25, 10),
child: Column(
children: <Widget>[
Image.asset(
'assets/images/my_file_white_icon.png',
height: SizeConfig
.imageSizeMultiplier *
12,
width: SizeConfig
.imageSizeMultiplier *
15,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context)
.fileNo,
fontSize: SizeConfig
.textMultiplier *
2,
)
],
),
))))
],
)),
Divider(
color: Colors.grey,
height: 2,
),
]),
),
// Expanded(
// flex: 2,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// Row(
// children: <Widget>[
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).registerNow,
// () => {
// Navigator.of(context).pushNamed(
// REGISTER,
// )
// },
// ))
// ],
// ),
// ],
// ))
],
)));
padding: EdgeInsets.only(bottom: 20, left: 21, right: 21),
child: Column(children: [
Expanded(
child: ListView(
padding: EdgeInsets.zero,
physics: BouncingScrollPhysics(),
children: [
SizedBox(height: 12),
HabibLogoWidget(),
SizedBox(height: 50),
Text(
TranslationBase.of(context).logintypeRadio,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
),
GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(top: 25),
shrinkWrap: true,
children: [
getButton(context, TranslationBase.of(context).nationalIdNumber, 'assets/images/new/national_id.svg', 1),
getButton(context, TranslationBase.of(context).medicalFileNumber, 'assets/images/new/medical_file.svg', 2),
],
),
SizedBox(height: 20),
// RichText(
// text: TextSpan(
// text: TranslationBase.of(context).forgotPassword,
// style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12),
// recognizer: TapGestureRecognizer()..onTap = () => Navigator.of(context).push(FadePage(page: ForgotPassword())),
// ),
// ),
],
),
),
// SizedBox(
// height: 43,
// width: double.infinity,
// child: FlatButton(
// onPressed: () {},
// child: Text(
// TranslationBase.of(context).registerNow,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48),
// ),
// color: Color(0xffD02127),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(6),
// ),
// ),
// ),
]),
));
// body: Padding(
// padding: EdgeInsets.all(20),
// child: Column(
// children: <Widget>[
// Expanded(
// flex: 6,
// child: Column(
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Image.asset(
// 'assets/images/habib-logo.png',
// height: 80,
// width: 80,
// ),
// Padding(
// padding: EdgeInsets.all(20),
// child: AppText(
// TranslationBase.of(context).registerInfoFamily,
// fontSize: SizeConfig.textMultiplier * 3.5,
// textAlign: TextAlign.left,
// ),
// ),
// Padding(
// padding: EdgeInsets.all(20),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Expanded(
// child: InkWell(
// onTap: () => {AddFamilyMemberType.loginType = 1, Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER)},
// child: RoundedContainer(
// borderColor: Colors.grey,
// showBorder: true,
// child: Padding(
// padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Image.asset(
// 'assets/images/id_card_icon.png',
// height: SizeConfig.imageSizeMultiplier * 12,
// width: SizeConfig.imageSizeMultiplier * 15,
// ),
// SizedBox(
// height: 20,
// ),
// AppText(
// TranslationBase.of(context).idNo,
// fontSize: SizeConfig.textMultiplier * 2,
// )
// ],
// ),
// )))),
// Expanded(
// child: InkWell(
// onTap: () => {AddFamilyMemberType.loginType = 2, Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER)},
// child: RoundedContainer(
// borderColor: Colors.grey,
// showBorder: true,
// child: Padding(
// padding: EdgeInsets.fromLTRB(25, 10, 25, 10),
// child: Column(
// children: <Widget>[
// Image.asset(
// 'assets/images/my_file_white_icon.png',
// height: SizeConfig.imageSizeMultiplier * 12,
// width: SizeConfig.imageSizeMultiplier * 15,
// ),
// SizedBox(
// height: 20,
// ),
// AppText(
// TranslationBase.of(context).fileNo,
// fontSize: SizeConfig.textMultiplier * 2,
// )
// ],
// ),
// ))))
// ],
// )),
// Divider(
// color: Colors.grey,
// height: 2,
// ),
// ]),
// ),
// // Expanded(
// // flex: 2,
// // child: Column(
// // mainAxisAlignment: MainAxisAlignment.end,
// // children: <Widget>[
// // Row(
// // children: <Widget>[
// // Expanded(
// // child: DefaultButton(
// // TranslationBase.of(context).registerNow,
// // () => {
// // Navigator.of(context).pushNamed(
// // REGISTER,
// // )
// // },
// // ))
// // ],
// // ),
// // ],
// // ))
// ],
// )));
}
Widget getButton(BuildContext _context, String _title, String _icon, int _flag) {
return InkWell(
onTap: () {
AddFamilyMemberType.loginType = _flag;
Navigator.of(_context).pushNamed(ADD_FAMILY_MEMBER);
},
child: Container(
padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
SvgPicture.asset(
_icon,
height: 38,
width: 38,
),
Text(
_title,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),
),
],
),
),
);
}
}

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -7,19 +8,23 @@ import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dar
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as list;
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
@ -28,14 +33,13 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
class MyFamily extends StatefulWidget {
final bool isAppbarVisible;
MyFamily({this.isAppbarVisible = true});
@override
_MyFamily createState() => _MyFamily();
}
@ -55,6 +59,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
ToDoCountProviderModel toDoProvider;
var isVaiable = false;
bool isSwitchUser = false;
@override
void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: 0);
@ -80,6 +86,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: widget.isAppbarVisible,
imagesInfo: imagesInfo,
showNewAppBar: true,
showNewAppBarTitle: true,
icon: "assets/images/new/bottom_nav/family_files.svg",
description: TranslationBase.of(context).familyInfo,
body: Scaffold(
@ -100,46 +108,64 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
// ),
// ),
// ),
// Center(
// child: Container(
// height: 60.0,
// // margin: EdgeInsets.only(top: 10.0),
// width: MediaQuery.of(context).size.width * 0.92, // 0.9,
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7
// ),
// color: Colors.white),
Center(
child: Container(
height: 60.0,
margin: EdgeInsets.only(top: 10.0),
width: MediaQuery.of(context).size.width * 0.92, // 0.9,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: true,
controller: _tabController,
indicatorWeight: 5.0,
//indicatorSize: TabBarIndicatorSize.label,
indicatorSize: TabBarIndicatorSize.tab,
// indicatorColor: Theme.of(context).primaryColor,
// labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.30,
child: Center(
child: AppText(TranslationBase.of(context).family),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.30,
child: Center(
child: AppText(TranslationBase.of(context).request),
),
),
],
),
child:
// TabBar(
// isScrollable: true,
// controller: _tabController,
// indicatorWeight: 5.0,
// indicatorSize: TabBarIndicatorSize.tab,
// labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
// unselectedLabelColor: Colors.grey[800],
// tabs: [
// Container(
// width: MediaQuery.of(context).size.width * 0.30,
// child: Center(
// child: AppText(TranslationBase.of(context).family),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.30,
// child: Center(
// child: AppText(TranslationBase.of(context).request),
// ),
// ),
// ],
// ),
TabBar(
controller: _tabController,
indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).family), Text(TranslationBase.of(context).request)],
),
),
// ),
// ),
],
),
),
@ -157,15 +183,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
],
),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () async {
color: Theme.of(context).scaffoldBackgroundColor,
width: double.infinity,
padding: EdgeInsets.all(14),
child: DefaultButton(
TranslationBase.of(context).addFamilyMember,
() async {
Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE);
},
label: TranslationBase.of(context).addFamilyMember,
backgroundColor: Colors.red[900],
),
),
),
@ -193,50 +218,105 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
return Padding(
padding: EdgeInsets.only(top: 50),
child: Column(children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Texts(
TranslationBase.of(context).request,
textAlign: TextAlign.center,
)),
Expanded(flex: 2, child: Texts(TranslationBase.of(context).switchUser, textAlign: TextAlign.center)),
Expanded(flex: 1, child: Texts(TranslationBase.of(context).deleteView, textAlign: TextAlign.center)),
],
),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: <Widget>[
// Expanded(
// flex: 3,
// child: Texts(
// TranslationBase.of(context).request,
// textAlign: TextAlign.center,
// )),
// Expanded(flex: 2, child: Texts(TranslationBase.of(context).switchUser, textAlign: TextAlign.center)),
// Expanded(flex: 1, child: Texts(TranslationBase.of(context).deleteView, textAlign: TextAlign.center)),
// ],
// ),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
return result.status == 3
? Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)),
Expanded(
flex: 2,
child: IconButton(
icon: Icon(Icons.group),
color: Colors.black,
onPressed: () {
switchUser(result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteFamily(result, context);
},
)),
],
))
? Card(
margin: EdgeInsets.all(10),
shape: cardRadius(15),
color: result.gender == 1 ? Color(0xff6EA8FF) : Color(0xffFDA4B0),
elevation: 3,
child: Container(
// height: 130,
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
result.patientName.toLowerCase().capitalizeFirstofEach,
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.white,
),
Texts(TranslationBase.of(context).fileNumber + ': ' + result.responseID.toString(), fontSize: 12, color: Colors.white),
Texts(result.age.toString() + ' ' + TranslationBase.of(context).years + ', ' + result.genderDescription, fontSize: 12, color: Colors.white),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
CupertinoSwitch(
value: isSwitchUser,
onChanged: (value) {
setState(() {
isSwitchUser = value;
});
if (isSwitchUser == true) switchUser(result, context);
},
),
Texts(
TranslationBase.of(context).switchUser,
color: Colors.white,
fontSize: 12,
)
],
),
InkWell(
onTap: () {
deleteFamily(result, context);
},
child: Row(
children: [
Texts(
TranslationBase.of(context).delete,
color: Colors.white,
fontSize: 12,
),
Icon(
Icons.delete,
color: Colors.white,
),
],
))
],
)
// Expanded(
// flex: 2,
// child: IconButton(
// icon: Icon(Icons.group),
// color: Colors.black,
// onPressed: () {
// switchUser(result, context);
// },
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.delete,
// color: Colors.black,
// ),
// onPressed: () {
// deleteFamily(result, context);
// },
// )),
],
)))
: SizedBox();
}).toList())
]));
@ -281,7 +361,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userViewRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
),
children: <Widget>[
FutureBuilder(
@ -294,51 +374,57 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else
return Column(
children: [
Column(children: [
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject)),
])),
Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRemoveRequest(result.iD, 3, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
acceptRemoveRequest(result.iD, 4, context);
},
))
],
));
}).toList())
])
],
);
return Container(
padding: EdgeInsets.all(15),
child: Card(
elevation: 3,
shape: cardRadius(8),
child: Column(
children: [
Column(children: [
Padding(
padding: EdgeInsets.all(10),
child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
])),
Divider(color: Colors.black, height: 1),
Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Container(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRemoveRequest(result.iD, 3, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
acceptRemoveRequest(result.iD, 4, context);
},
))
],
));
}).toList())
])
],
)));
}
})
],
@ -348,7 +434,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: ExpansionTile(
title: Text(
TranslationBase.of(context).sentRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
),
children: <Widget>[
FutureBuilder(
@ -362,30 +448,40 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else
return Container(
padding: EdgeInsets.all(15),
height: SizeConfig.screenHeight * .3,
child: SingleChildScrollView(
child: Column(
children: [
Padding(padding: EdgeInsets.only(left: 10, right: 10), child: Row(children: [Expanded(flex: 3, child: AppText(TranslationBase.of(context).theName))])),
Column(
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Padding(
child: Card(
elevation: 3,
shape: cardRadius(8),
child: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)),
Expanded(
flex: 2,
child: AppText(
result.statusDescription,
color: result.status == 3 ? Colors.green : Colors.red,
)),
],
));
}).toList(),
)
],
)));
child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).theName, fontWeight: FontWeight.w600)),
Expanded(flex: 2, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600))
])),
Divider(color: Colors.black, height: 1),
Column(
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)),
Expanded(
flex: 2,
child: AppText(
result.statusDescription,
color: result.status == 3 ? Colors.green : Colors.red,
)),
],
));
}).toList(),
)
],
))));
}
})
],
@ -394,7 +490,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
),
children: <Widget>[
FutureBuilder(
@ -407,39 +503,45 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else
return Column(
children: [
Column(children: [
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).delete)),
])),
Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(flex: 3, child: AppText(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deactivateRequest(result.iD, 5, context);
},
)),
],
));
}).toList())
])
],
);
return Container(
padding: EdgeInsets.all(15),
child: Card(
elevation: 3,
shape: cardRadius(8),
child: Column(
children: [
Column(children: [
Padding(
padding: EdgeInsets.all(10),
child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).delete)),
])),
Divider(color: Colors.black),
Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(flex: 3, child: AppText(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deactivateRequest(result.iD, 5, context);
},
)),
],
));
}).toList())
])
],
)));
}
})
],
@ -523,38 +625,40 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}
loginAfter(result, context) async {
GifLoaderDialogUtils.hideDialog(context);
var currentLang = await sharedPref.getString(APP_LANGUAGE);
Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: true);
result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE);
result = list.CheckActivationCode.fromJson(result);
var mainUser = await sharedPref.getObject(MAIN_USER);
var bloodType = await sharedPref.getString(BLOOD_TYPE);
var loginType = await sharedPref.getInt(LAST_LOGIN);
this.sharedPref.clear();
if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true;
}
this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setInt(LAST_LOGIN, loginType);
this.sharedPref.setObject(MAIN_USER, mainUser);
this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true);
Provider.of<ProjectViewModel>(context, listen: false).user = authenticatedUserObject.user;
Provider.of<ProjectViewModel>(context, listen: false).setUser(authenticatedUserObject.user);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
});
// await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
// if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
// });
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
getToDoCount(),
// Utils.hideProgressDialog(),
GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
@ -577,7 +681,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
.catchError((err) {
print(err);
// Utils.hideProgressDialog();
// GifLoaderDialogUtils.hideDialog(context);
GifLoaderDialogUtils.hideDialog(context);
});
}
@ -610,12 +714,12 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}
getToDoCount() {
toDoProvider.setState(0, true);
toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {}
}).catchError((err) {
print(err);

@ -50,13 +50,12 @@ class NotificationsDetailsPage extends StatelessWidget {
height: 25,
),
Container(
// margin: EdgeInsets.only(left: 30),
width: double.infinity,
color: Colors.grey[400],
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
getDateForm(notification.createdOn),
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false),
fontSize: 16,
),
),

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_
import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -60,8 +61,9 @@ class NotificationsPage extends StatelessWidget {
.map(
(notification) => InkWell(
onTap: () async {
if (!notification.isRead)
if (!notification.isRead) {
model.markAsRead(notification.id);
}
Navigator.push(
context,
FadePage(
@ -82,7 +84,7 @@ class NotificationsPage extends StatelessWidget {
border: Border.all(
color: notification.isRead
? Colors.grey[200]
: Theme.of(context).primaryColor,
: CustomColors.accentColor,
width: 0.5),
),
child: Row(
@ -93,7 +95,7 @@ class NotificationsPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(getDateForm(notification.createdOn)),
Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)),
SizedBox(
height: 5,
),

@ -87,7 +87,7 @@ class _ErOptionsState extends State<ErOptions> {
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: RRTMainScreen()));
if(rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).rrtService,

@ -5,6 +5,10 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class RRTLogPage extends StatefulWidget {
final List<PrescriptionsOrder> orders;
@ -18,10 +22,18 @@ class RRTLogPage extends StatefulWidget {
class RRTLogPageState extends State<RRTLogPage> {
RRTViewModel viewModel;
@override
void initState() {
setState(() {});
super.initState();
}
@override
Widget build(BuildContext context) {
return BaseView<RRTViewModel>(
onModelReady: (vm) => viewModel = vm,
onModelReady: (vm) => {
viewModel = vm,
},
builder: (ctx, vm, widgetState) {
return ListView.builder(
itemCount: widget.orders.length,
@ -36,12 +48,13 @@ class RRTLogPageState extends State<RRTLogPage> {
deleteOrder(PrescriptionsOrder order) async {
GifLoaderDialogUtils.showMyDialog(context);
var success = await viewModel.cancelOrder(order);
GifLoaderDialogUtils.hideDialog(context);
if (success) {
setState(() {
widget.orders.remove(order);
});
viewModel.setState(ViewState.Busy);
await viewModel.getAllOrders();
viewModel.setState(ViewState.Idle);
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RRTMainScreen));
Navigator.push(context, FadePage(page: RRTMainScreen()));
}
await viewModel.getAllOrders();
}
}

@ -9,6 +9,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RRTMainScreen extends StatefulWidget {
final index = 0;
RRTMainScreen({index});
@override
State<StatefulWidget> createState() => RRTMainScreenState();
}

@ -5,26 +5,37 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5));
class RRTLogListItem extends StatelessWidget {
class RRTLogListItem extends StatefulWidget {
final PrescriptionsOrder order;
final Function(PrescriptionsOrder) onCancel;
RRTLogListItem(this.order, {this.onCancel});
@override
State<StatefulWidget> createState() => RRTLogListItemState();
BuildContext _context;
}
class RRTLogListItemState extends State<RRTLogListItem> {
RRTViewModel viewModel;
TranslationBase localize;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
_context = context;
localize = TranslationBase.of(context);
int status = order.status;
String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description;
int status = widget.order.status;
String _statusDisp = projectViewModel.isArabic ? widget.order.descriptionN : widget.order.description;
Color _color;
if (status == 1) {
//pending
@ -39,119 +50,126 @@ class RRTLogListItem extends StatelessWidget {
//cancel // Rejected
_color = Color(0xffD02127);
}
return Container(
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
color: _color,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
),
),
// clipBehavior: Clip.antiAlias,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
return BaseView<RRTViewModel>(
onModelReady: (vm) => {
viewModel = vm,
},
builder: (ctx, vm, widgetState) {
return Container(
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
color: _color,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
),
),
// clipBehavior: Clip.antiAlias,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).locationa + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
!projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
),
],
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${widget.order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).locationa + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
!projectViewModel.isArabic ? widget.order.nearestProjectDescription.trim().toString() : widget.order.nearestProjectDescriptionN.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
localize.pickupDate + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
widget.order.getFormattedDateTime(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
),
),
],
),
],
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
localize.pickupDate + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
DateUtil.getDayMonthYearDateFormattedLang(widget.order.createdOn, projectViewModel.isArabic),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
order.getFormattedDateTime(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
SizedBox(height: 12),
if (widget.order.status == 1 || widget.order.status == 2)
InkWell(
onTap: () {
//onCancel(order);
cancelOrders(widget.order);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
),
],
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.getDayMonthYearDateFormattedLang(order.createdOn, projectViewModel.isArabic),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 12),
if (order.status == 1 || order.status == 2)
InkWell(
onTap: () {
onCancel(order);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
],
),
],
),
),
);
);
});
// return Container(
// padding: EdgeInsets.all(15),
@ -207,4 +225,16 @@ class RRTLogListItem extends StatelessWidget {
// style: TextStyle(color: Colors.white, fontSize: 13),
// ),
// );
cancelOrders(order) async {
GifLoaderDialogUtils.showMyDialog(context);
var success = await viewModel.cancelOrder(order);
if (success) {
viewModel.setState(ViewState.Busy);
await viewModel.getAllOrders();
viewModel.setState(ViewState.Idle);
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RRTMainScreen));
Navigator.push(context, FadePage(page: RRTMainScreen()));
}
}
}

@ -116,9 +116,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
}
void loadAddresses() async {
// GifLoaderDialogUtils.showMyDialog(context);
await viewModel.getCustomerInfo();
// GifLoaderDialogUtils.hideDialog(context);
if (viewModel.addressesList.isNotEmpty) setState(() {});
}

@ -16,6 +16,7 @@ import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
class RRTPlaceOrderPage extends StatelessWidget {
TranslationBase localize;
@ -206,7 +207,11 @@ class RRTPlaceOrderPage extends StatelessWidget {
}
}
gotoRRTRoot() {
Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: ErOptions));
gotoRRTRoot() async {
viewModel.setState(ViewState.Busy);
await viewModel.getAllOrders();
viewModel.setState(ViewState.Idle);
Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen));
Navigator.push(_context, FadePage(page: RRTMainScreen()));
}
}

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-ord
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -190,6 +191,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
else
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
},
color: acceptTerms ? CustomColors.accentColor : Colors.grey,
),
),
],

@ -94,6 +94,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
DoctorHeader(
headerModel: HeaderModel(
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj,
widget.appo.doctorID,
widget.appo.doctorImageURL,
widget.appo.doctorSpeciality,
"",
@ -107,7 +108,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
"",
//model.user.emailAddress,
),
isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false,
@ -136,7 +137,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
onTap: (index) {
setState(() {
if (index == 1) {
if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) {
if (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex;
AppointmentDetails.showFooterButton = false;
} else {
@ -147,7 +148,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
},
tabs: [
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))),
widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment
widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 47 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment
? Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
)
@ -357,13 +358,15 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
),
),
),
),
@ -579,11 +582,11 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}
getToDoCount() {
toDoProvider.setState(0, true);
toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {}
}).catchError((err) {
print(err);

@ -167,7 +167,7 @@ class _SchedulePageState extends State<SchedulePage> {
? Icons
.arrow_back_ios_outlined
: Icons
.arrow_forward_ios_outlined, size: 16.0),
.arrow_forward_outlined, size: 16.0),
],
)
]))),

@ -67,7 +67,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
padding: EdgeInsets.all(21),
shrinkWrap: true,
itemBuilder: (context, index) {
bool shouldEnable = (widget.appo.clinicID == 17 && appoButtonsList[index].caller == "openReschedule");
bool shouldEnable = (widget.appo.clinicID == 17 && widget.appo.clinicID == 47 && appoButtonsList[index].caller == "openReschedule");
return InkWell(
onTap: shouldEnable
? null

@ -74,7 +74,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
.prescriptionReportEnhList[index].itemDescription)),
)),
Icon(
Icons.arrow_forward_ios,
Icons.arrow_forward,
size: 18,
color: Colors.grey[500],
)

@ -47,7 +47,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
updateSelectedPaymentMethod("MADA");
},
child: Card(
elevation: 3.0,
elevation: 0.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
@ -83,7 +83,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
updateSelectedPaymentMethod("VISA");
},
child: Card(
elevation: 3.0,
elevation: 0.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
@ -119,7 +119,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
updateSelectedPaymentMethod("MASTERCARD");
},
child: Card(
elevation: 3.0,
elevation: 0.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
@ -155,7 +155,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
updateSelectedPaymentMethod("Installment");
},
child: Card(
elevation: 3.0,
elevation: 0.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
@ -192,7 +192,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
updateSelectedPaymentMethod("ApplePay");
},
child: Card(
elevation: 3.0,
elevation: 0.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(

@ -5,7 +5,9 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -13,6 +15,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -49,6 +52,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
var reconizedWord;
var event = RobotProvider();
List<AppoitmentAllHistoryResultList> appoList = [];
String getSelected(BuildContext context) {
switch (messageType) {
case MessageType.ComplaintOnAnAppointment:
@ -111,7 +116,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
children: <Widget>[
Text(
TranslationBase.of(context).likeToHear,
textAlign: TextAlign.center,
// textAlign: TextAlign.center,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
),
SizedBox(height: 21),
@ -159,184 +164,50 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
isShowListAppointHistory = true;
});
},
child: Container(
// margin: EdgeInsets.all(8.0),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
child: Row(
children: <Widget>[
Container(
width: projectViewModel.isArabic ? 27 : 20,
height: projectViewModel.isArabic ? 105 : 90,
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: appointHistory.isLiveCareAppointment
? Color(0xff404545)
: !appointHistory.isInOutPatient
? Colors.red[900]
: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
),
),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
appointHistory.isLiveCareAppointment
? TranslationBase.of(context).liveCare.toUpperCase()
: !appointHistory.isInOutPatient
? TranslationBase.of(context).inPatient.toUpperCase()
: TranslationBase.of(context).outpatient.toUpperCase(),
style: TextStyle(color: Colors.white, fontSize: 12),
),
)),
),
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: LargeAvatar(
name: appointHistory.doctorNameObj,
url: appointHistory.doctorImageURL,
),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
appointHistory.doctorNameObj,
bold: true,
),
Texts(
DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)),
variant: 'caption3',
),
StarRating(totalAverage: appointHistory.doctorRate.toDouble(), forceStars: true),
],
),
),
),
],
),
),
],
),
),
Expanded(
flex: 1,
child: Center(
child: Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
)
],
),
child: DoctorCard(
onTap: null,
isInOutPatient: appointHistory.isInOutPatient,
name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj,
// billNo: _appointmentResult.invoiceNo,
profileUrl: appointHistory.doctorImageURL,
subName: appointHistory.projectName,
isLiveCareAppointment: appointHistory.isLiveCareAppointment,
date: DateUtil.convertStringToDate(appointHistory.appointmentDate),
rating: appointHistory.actualDoctorRate + 0.0,
appointmentTime: appointHistory.startTime.substring(0, 5),
),
),
if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory)
SizedBox(height: 12),
if (messageType == MessageType.ComplaintOnAnAppointment && appoList.length != 0 && isShowListAppointHistory)
Container(
height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.25 : MediaQuery.of(context).size.height * 0.15,
margin: EdgeInsets.only(bottom: 10.0),
height: appoList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17,
child: ListView.builder(
itemCount: model.appointHistoryList.length,
itemCount: appoList.length,
itemBuilder: (context, index) => InkWell(
onTap: () {
setState(() {
appointHistory = model.appointHistoryList[index];
appointHistory = appoList[index];
isShowListAppointHistory = false;
});
},
child: Container(
margin: EdgeInsets.only(left: 8, right: 8),
color: Colors.white,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: LargeAvatar(
name: model.appointHistoryList[index].doctorNameObj,
url: model.appointHistoryList[index].doctorImageURL,
),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
model.appointHistoryList[index].doctorNameObj,
bold: true,
),
Texts(
DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)),
variant: 'caption3',
),
StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true),
],
),
),
),
],
),
),
],
),
),
Expanded(
flex: 1,
child: Center(
child: Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
)
],
),
SizedBox(
height: 5,
),
Divider(
height: 0.5,
color: Colors.grey[400],
)
],
),
child: DoctorCard(
onTap: null,
isInOutPatient: appoList[index].isInOutPatient,
name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
profileUrl: appoList[index].doctorImageURL,
subName: appoList[index].projectName,
isLiveCareAppointment: appoList[index].isLiveCareAppointment,
date: DateUtil.convertStringToDate(appoList[index].appointmentDate),
rating: appoList[index].actualDoctorRate + 0.0,
appointmentTime: appoList[index].startTime.substring(0, 5),
),
),
),
),
inputWidget(TranslationBase.of(context).subject, "xxxxxxxx", titleController),
inputWidget(TranslationBase.of(context).subject, "", titleController),
SizedBox(height: 12),
inputWidget(TranslationBase.of(context).message, "xxxxxxxx", messageController, lines: 11, suffixTap: () {
inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () {
openSpeechReco();
}),
SizedBox(height: 12),
@ -492,7 +363,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
keyboardType: TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
@ -515,19 +386,6 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
// prefixIconConstraints: BoxConstraints(minWidth: 50),
// prefixIcon: suffix == null
// ? null
// : Text(
// "+" + suffix,
// style: TextStyle(
// fontSize: 14,
// height: 21 / 14,
// fontWeight: FontWeight.w500,
// color: Color(0xff2E303A),
// letterSpacing: -0.56,
// ),
// ),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
@ -570,19 +428,39 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
// Show Dialog function
void confirmBox(FeedbackViewModel model) {
DoctorsListService service = new DoctorsListService();
showDialog(
context: context,
child: FeedbackTypeDialog(
messageTypeDialog: messageType,
onValueSelected: (MessageType value) {
if (value == MessageType.ComplaintOnAnAppointment) {
appoList.clear();
GifLoaderDialogUtils.showMyDialog(context);
model.getPatentAppointmentHistory().then((value) {
service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
appointHistory = null;
if (res['MessageStatus'] == 1) {
if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) {
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
setState(() {
appointHistory = null;
isShowListAppointHistory = true;
});
} else {}
} else {
}
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
// print(err);
// AppToast.showErrorToast(message: err);
// Navigator.of(context).pop();
});
} else {
isShowListAppointHistory = false;
}
setMessageType(value);
},
@ -694,7 +572,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.NON,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -716,7 +594,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.ComplaintOnAnAppointment,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -738,7 +616,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.ComplaintWithoutAppointment,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -760,7 +638,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.Question,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -782,7 +660,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.Compliment,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -804,7 +682,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
leading: Radio(
value: MessageType.Suggestion,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
activeColor: CustomColors.accentColor,
onChanged: (MessageType value) => setMessageDialogType(value),
),
),
@ -837,7 +715,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
child: Center(
child: Texts(
TranslationBase.of(context).cancel,
color: Theme.of(context).primaryColor,
color: CustomColors.accentColor,
),
),
),

@ -1,13 +1,16 @@
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class StatusFeedbackPage extends StatefulWidget {
@override
@ -17,6 +20,7 @@ class StatusFeedbackPage extends StatefulWidget {
class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<FeedbackViewModel>(
onModelReady: (model) => model.getCOC(),
builder: (_, model, widget) => AppScaffold(
@ -28,67 +32,69 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
child: model.cOCItemList.isNotEmpty
? Container(
margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 80),
padding: EdgeInsets.all(15.0),
child: ListView.builder(
itemCount: model.cOCItemList.length,
itemBuilder: (context, index) => InkWell(
onTap: () {
gotodetails(model.cOCItemList[index]);
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.white,
),
margin: EdgeInsets.all(4),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 8,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts('${model.cOCItemList[index].cOCTitle}'),
Texts(
TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}',
variant: 'overline',
),
],
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts('${model.cOCItemList[index].status}'),
Texts(
'${model.cOCItemList[index].date}',
variant: 'overline',
),
],
),
),
],
),
Texts('${model.cOCItemList[index].formType}'),
Divider(
height: 4.5,
color: Colors.grey[500],
)
],
onTap: () {
},
child: Card(
shape: cardRadius(12),
margin: EdgeInsets.all(10),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(projectViewModel.isArabic ? model.cOCItemList[index].statusAr : model.cOCItemList[index].status,
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(model.cOCItemList[index].formType.toString(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12))),
myRichText(TranslationBase.of(context).number + ": ", model.cOCItemList[index].itemID.toString(), projectViewModel.isArabic),
Text(model.cOCItemList[index].cOCTitle,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12)),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(model.cOCItemList[index].date.split(" ")[0],
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48)),
Text(model.cOCItemList[index].date.split(" ")[1],
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48)),
],
),
],
),
),
),
))),
)),
)
: Center(
child: Column(
@ -117,16 +123,17 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
),
),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).search,
() => {},
),
),
],
),
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).search,
projectViewModel.isLogin ? null : () => {},
disabledColor: Colors.grey,
),
),
),
);
}

@ -1,5 +1,6 @@
import 'dart:io';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:flutter/cupertino.dart';
@ -154,8 +155,12 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
widget.image(file, image);
if(file != null && image != null) {
Navigator.pop(context);
widget.image(file, image);
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).noInsuranceCardAttached);
}
},
child: Padding(
padding: const EdgeInsets.all(8.0),

@ -2,7 +2,9 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -45,7 +47,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
description: TranslationBase.of(context).infoApprovals,
infoList: TranslationBase.of(context).infoApprovalPoints,
imagesInfo: imagesInfo,
body: ListView.separated(
body: model.insuranceApproval.length > 0 ? ListView.separated(
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(),
itemBuilder: (_, index) {
@ -148,7 +150,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
height: 48,
alignment: Alignment.bottomRight,
child: Icon(
Icons.visibility_sharp,
Icons.arrow_forward,
color: Color(0xff2E303A),
),
)
@ -164,7 +166,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
);
},
separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.insuranceApproval.length)),
itemCount: model.insuranceApproval.length) : getNoDataWidget(context)),
);
}

@ -150,7 +150,9 @@ class InsurancePage extends StatelessWidget {
patientID: patientID,
patientIdentificationID: patientIdentificationID,
name: name,
)));
))).then((value) {
model.getInsuranceUpdated();
});
} else {
AppToast.showErrorToast(message: _insuranceCardService.error);
}

@ -77,6 +77,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
SignalRUtil signalRUtil;
ToDoCountProviderModel toDoProvider;
bool _showBottomNavigationBar = true;
///inject the user data
@ -505,6 +507,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
setState(() {
notificationCount =
value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
})
}
@ -555,14 +558,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController.jumpToPage(0);
},
),
projectViewModel.isLogin && notificationCount != ''
projectViewModel.isLogin && model.notificationsCount != null
? new Positioned(
right: projectViewModel.isArabic ? 35 : 0,
top: 5,
child: new Container(
padding: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: Colors.red,
color: CustomColors.accentColor,
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
@ -570,7 +573,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
minHeight: 20,
),
child: new Text(
notificationCount,
model.notificationsCount.toString(),
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
@ -677,6 +680,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}
}),

@ -137,19 +137,20 @@ class LoggedSliderView extends StatelessWidget {
padding: const EdgeInsets.only(left: 20, right: 20),
child: Row(
children: <Widget>[
Expanded( flex: 3,
Expanded(
flex: 3,
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/new/height.svg',
width: 12,
height: 12,
width: 11,
height: 11,
),
mWidth(6),
Texts(
"${TranslationBase.of(context).height}: ${model.heightCm} ${TranslationBase.of(context).cm}",
color: Colors.white,
fontSize: 10,
fontSize: 8,
)
],
),
@ -157,16 +158,21 @@ class LoggedSliderView extends StatelessWidget {
SizedBox(
width: 3,
),
Expanded( flex: 3,
Expanded(
flex: 3,
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/new/weight.svg',
width: 12,
height: 12,
width: 11,
height: 11,
),
mWidth(6),
Texts('${TranslationBase.of(context).weight}: ${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 10)
Texts(
'${TranslationBase.of(context).weight}: ${model.weightKg} ${TranslationBase.of(context).kg}',
color: Colors.white,
fontSize: 8,
)
],
),
),
@ -179,11 +185,15 @@ class LoggedSliderView extends StatelessWidget {
children: <Widget>[
SvgPicture.asset(
'assets/images/new/blood.svg',
width: 12,
height: 12,
width: 11,
height: 11,
),
mWidth(6),
Texts('${TranslationBase.of(context).bloodType1} ${model.booldType}', color: Colors.white, fontSize: 10)
Texts(
'${TranslationBase.of(context).bloodType1} ${model.booldType}',
color: Colors.white,
fontSize: 8,
)
],
),
),

@ -170,11 +170,11 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
),
InkWell(
onTap: (){
Navigator.pop(context, "schedule");
// Navigator.pop(context, "schedule");
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[700],
color: Colors.grey[400],
borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 100.0,
margin: EdgeInsets.only(top: 20.0),

@ -160,9 +160,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
),
Text(
user.editedOn != null
? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn), projectViewModel.isArabic)
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn))
: user.createdOn != null
? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.createdOn), projectViewModel.isArabic)
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.createdOn))
: '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
@ -191,9 +191,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Expanded(child: SizedBox()),
Text(
user.editedOn != null
? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.editedOn))
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn), false)
: user.createdOn != null
? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.createdOn))
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.createdOn), false)
: '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
),
@ -391,14 +391,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
loginWithFingurePrintFace(type, int isActive) async {
if (isActive == 1 || isActive ==0) {
if (isActive == 1 || isActive == 0) {
const iosStrings =
const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID');
try {
authenticated = await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings);
} on PlatformException catch (e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: 'Please enable your Touch or Face ID');
@ -584,11 +582,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
getToDoCount() {
toDoProvider.setState(0, true);
toDoProvider.setState(0, true, "0");
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {}
}).catchError((err) {
print(err);
@ -689,36 +687,36 @@ class _ConfirmLogin extends State<ConfirmLogin> {
),
);
return InkWell(
onTap: () {
if (_flag == 0) {
setState(() {
isMoreOption = true;
});
} else {
authenticateUser(4, isActive: _loginIndex);
}
},
child: RoundedContainer(
height: 150,
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
child: Column(
children: <Widget>[
Image.asset(
_icon,
height: SizeConfig.imageSizeMultiplier * 13,
width: SizeConfig.imageSizeMultiplier * 16,
),
SizedBox(
height: 20,
),
Texts(_title, fontSize: SizeConfig.textMultiplier * 2, color: Colors.black)
],
),
)));
// return InkWell(
// onTap: () {
// if (_flag == 0) {
// setState(() {
// isMoreOption = true;
// });
// } else {
// authenticateUser(4, isActive: _loginIndex);
// }
// },
// child: RoundedContainer(
// height: 150,
// borderColor: Colors.grey,
// showBorder: true,
// child: Padding(
// padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
// child: Column(
// children: <Widget>[
// Image.asset(
// _icon,
// height: SizeConfig.imageSizeMultiplier * 13,
// width: SizeConfig.imageSizeMultiplier * 16,
// ),
// SizedBox(
// height: 20,
// ),
// Texts(_title, fontSize: SizeConfig.textMultiplier * 2, color: Colors.black)
// ],
// ),
// )));
}
// todo 'sikander' optimize this after knowing usage

@ -59,8 +59,7 @@ class LoginType extends StatelessWidget {
RichText(
text: TextSpan(
text: TranslationBase.of(context).forgotPassword,
style: TextStyle(
decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12),
style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12),
recognizer: TapGestureRecognizer()..onTap = () => Navigator.of(context).push(FadePage(page: ForgotPassword())),
),
),
@ -88,141 +87,141 @@ class LoginType extends StatelessWidget {
),
);
AppScaffold(
appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth,
child: Column(
children: <Widget>[
Expanded(
flex: 4,
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/DQ/logo.png',
height: 90,
width: 90,
),
AppText(
TranslationBase.of(context).logintypeRadio,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.start,
marginBottom: 20.0,
marginTop: 20.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
LoginType.loginType = 1,
Navigator.of(context).push(FadePage(page: Login())),
},
child: RoundedContainer(
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/id_card_icon.png',
height: SizeConfig.imageSizeMultiplier * 12,
width: SizeConfig.imageSizeMultiplier * 15,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).idNo,
fontSize: SizeConfig.textMultiplier * 2,
fontWeight: FontWeight.bold,
)
],
),
)))),
Expanded(
child: InkWell(
onTap: () => {
LoginType.loginType = 2,
Navigator.of(context).push(FadePage(page: Login())),
},
child: RoundedContainer(
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(25, 10, 25, 10),
child: Column(
children: <Widget>[
Image.asset(
'assets/images/my_file_white_icon.png',
height: SizeConfig.imageSizeMultiplier * 12,
width: SizeConfig.imageSizeMultiplier * 15,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).fileNo,
fontSize: SizeConfig.textMultiplier * 2,
fontWeight: FontWeight.bold,
)
],
),
))))
],
),
SizedBox(
height: 25,
),
Divider(
color: Colors.grey,
height: 2,
),
Center(
child: InkWell(
onTap: () => {
Navigator.of(context).push(FadePage(page: ForgotPassword())),
},
child: AppText(TranslationBase.of(context).forgotPassword, fontSize: SizeConfig.textMultiplier * 2.5, marginTop: 20.0, underline: true)))
]),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(
height: 10,
),
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).registerNow,
() => {
Navigator.of(context).push(FadePage(page: Register())),
},
)),
],
),
],
))
],
))));
// AppScaffold(
// appBarTitle: TranslationBase.of(context).login,
// isShowAppBar: true,
// isShowDecPage: false,
// body: SingleChildScrollView(
// child: Container(
// padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
// height: SizeConfig.realScreenHeight * .9,
// width: SizeConfig.realScreenWidth,
// child: Column(
// children: <Widget>[
// Expanded(
// flex: 4,
// child: Column(
// // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Image.asset(
// 'assets/images/DQ/logo.png',
// height: 90,
// width: 90,
// ),
// AppText(
// TranslationBase.of(context).logintypeRadio,
// fontSize: SizeConfig.textMultiplier * 3.5,
// textAlign: TextAlign.start,
// marginBottom: 20.0,
// marginTop: 20.0,
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Expanded(
// child: InkWell(
// onTap: () => {
// LoginType.loginType = 1,
// Navigator.of(context).push(FadePage(page: Login())),
// },
// child: RoundedContainer(
// borderColor: Colors.grey,
// showBorder: true,
// child: Padding(
// padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Image.asset(
// 'assets/images/id_card_icon.png',
// height: SizeConfig.imageSizeMultiplier * 12,
// width: SizeConfig.imageSizeMultiplier * 15,
// ),
// SizedBox(
// height: 20,
// ),
// AppText(
// TranslationBase.of(context).idNo,
// fontSize: SizeConfig.textMultiplier * 2,
// fontWeight: FontWeight.bold,
// )
// ],
// ),
// )))),
// Expanded(
// child: InkWell(
// onTap: () => {
// LoginType.loginType = 2,
// Navigator.of(context).push(FadePage(page: Login())),
// },
// child: RoundedContainer(
// borderColor: Colors.grey,
// showBorder: true,
// child: Padding(
// padding: EdgeInsets.fromLTRB(25, 10, 25, 10),
// child: Column(
// children: <Widget>[
// Image.asset(
// 'assets/images/my_file_white_icon.png',
// height: SizeConfig.imageSizeMultiplier * 12,
// width: SizeConfig.imageSizeMultiplier * 15,
// ),
// SizedBox(
// height: 20,
// ),
// AppText(
// TranslationBase.of(context).fileNo,
// fontSize: SizeConfig.textMultiplier * 2,
// fontWeight: FontWeight.bold,
// )
// ],
// ),
// ))))
// ],
// ),
// SizedBox(
// height: 25,
// ),
// Divider(
// color: Colors.grey,
// height: 2,
// ),
// Center(
// child: InkWell(
// onTap: () => {
// Navigator.of(context).push(FadePage(page: ForgotPassword())),
// },
// child: AppText(TranslationBase.of(context).forgotPassword, fontSize: SizeConfig.textMultiplier * 2.5, marginTop: 20.0, underline: true)))
// ]),
// ),
// Expanded(
// flex: 1,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// Divider(
// color: Colors.grey,
// height: 2,
// ),
// SizedBox(
// height: 10,
// ),
// Row(
// children: <Widget>[
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).registerNow,
// () => {
// Navigator.of(context).push(FadePage(page: Register())),
// },
// )),
// ],
// ),
// ],
// ))
// ],
// ))));
}
Widget getButton(BuildContext _context, String _title, String _icon, int _flag) {

@ -359,12 +359,12 @@ class _Login extends State<Login> {
}
getToDoCount() {
toDoProvider.setState(0, true);
toDoProvider.setState(0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {}
}).catchError((err) {
print(err);

@ -24,7 +24,7 @@ class ActiveMedicationsPage extends StatelessWidget {
isShowDecPage: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).activeMedications,
body: Container(
body: model.activePrescriptionReport.length > 0 ? Container(
child: ListView.builder(
itemCount: model.activePrescriptionReport.length,
itemBuilder: (context, index) => Container(
@ -197,7 +197,7 @@ class ActiveMedicationsPage extends StatelessWidget {
),
),
),
),
) : getNoDataWidget(context),
),
);
}

@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -22,7 +24,20 @@ class AskDoctorPage extends StatelessWidget {
onModelReady: (model) => model.getMyDoctor(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
body: _appointmentExpandableList(model.patientDoctorAppointmentListHospital, model),
body: model.patientDoctorAppointmentListHospital.length > 0 ? _appointmentExpandableList(model.patientDoctorAppointmentListHospital, model) : noDoctor(context),
),
);
}
Widget noDoctor(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 50.0, right: 50.0),
child: Center(
child: Text(TranslationBase.of(context).askDocEmpty, textAlign: TextAlign.center, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: CustomColors.accentColor
)),
),
);
}

@ -99,7 +99,7 @@ class DoctorResponse extends StatelessWidget {
),
),
Icon(projectViewModel.isArabic
? Icons.arrow_forward_ios
? Icons.arrow_forward
: Icons.arrow_back_ios)
],
),
@ -169,7 +169,7 @@ class DoctorResponse extends StatelessWidget {
),
),
Icon(projectViewModel.isArabic
? Icons.arrow_forward_ios
? Icons.arrow_forward
: Icons.arrow_back_ios)
],
),

@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -258,16 +259,13 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
),
),
bottomSheet: Container(
height: 70,
width: double.infinity,
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(12),
color: Colors.white,
child: SecondaryButton(
textColor: Colors.white,
label: TranslationBase.of(context).submit,
color: CustomColors.accentColor,
disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null,
onTap: () {
child: DefaultButton(
TranslationBase.of(context).submit,
(amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null) ? null :
() {
var mobileNum;
var patientName;
@ -320,6 +318,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
}
});
},
disabledColor: Colors.grey,
),
)),
);

@ -41,10 +41,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController.addListener(() {
setState(() {
});
setState(() {});
});
}
@ -61,7 +58,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
@ -70,6 +67,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
DoctorHeader(
headerModel: HeaderModel(
widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
widget.appointmentAllHistoryResultList.doctorID,
widget.appointmentAllHistoryResultList.doctorImageURL,
widget.appointmentAllHistoryResultList.doctorSpeciality,
"",
@ -83,7 +81,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
"",
//model.user.emailAddress,
),
isNeedToShowButton: _tabController.index==0?true:projectViewModel.havePrivilege(15),
isNeedToShowButton: _tabController.index == 0 ? true : projectViewModel.havePrivilege(15),
showConfirmMessageDialog: true,
onRatingAndReviewTap: getDoctorRatingsDetails,
onTap: () {

@ -27,8 +27,7 @@ class InvoiceDetail extends StatefulWidget {
final DentalInvoiceDetailResponse dentalInvoiceDetailResponse;
final BuildContext context;
InvoiceDetail(this.doctor, this.listDentalAppointments,
this.dentalInvoiceDetailResponse, this.context);
InvoiceDetail(this.doctor, this.listDentalAppointments, this.dentalInvoiceDetailResponse, this.context);
@override
_InvoiceDetailState createState() => _InvoiceDetailState();
@ -50,11 +49,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
ProjectViewModel projectViewModel = Provider.of(context);
generateInvoiceDetails();
return AppScaffold(
appBarTitle: widget.doctor.doctorTitle != null
? widget.doctor.doctorTitle.toString()
: TranslationBase.of(context).dr +
" " +
widget.doctor.name.toString(),
appBarTitle: widget.doctor.doctorTitle != null ? widget.doctor.doctorTitle.toString() : TranslationBase.of(context).dr + " " + widget.doctor.name.toString(),
isShowAppBar: true,
isShowDecPage: false,
showNewAppBar: true,
@ -67,6 +62,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
widget.doctor.clinicName,
@ -76,7 +72,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
widget.doctor.nationalityFlagURL,
widget.doctor.doctorRate,
widget.doctor.actualDoctorRate,
widget.doctor.noOfPatientsRate,
widget.doctor.noOfPatientsRate ?? 0,
projectViewModel.user.emailAddress),
onTap: () {
sendInvoiceEmail();
@ -86,8 +82,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Card(
elevation: 3.0,
shape: cardRadius(12),
margin: EdgeInsets.only(
left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
@ -112,8 +107,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Card(
elevation: 3.0,
shape: cardRadius(12),
margin: EdgeInsets.only(
left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
@ -121,29 +115,12 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
children: [
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(TranslationBase.of(context).cardDetail,
style: TextStyle(
color: Colors.black,
letterSpacing: -0.64,
fontSize: 18.0,
fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).cardDetail, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)),
),
myRichText(
TranslationBase.of(context).insuranceCompany +
": ",
widget.dentalInvoiceDetailResponse
.listEInvoiceForDental[0].companyName,
projectViewModel.isArabic),
myRichText(TranslationBase.of(context).insuranceCompany + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, projectViewModel.isArabic),
myRichText(
TranslationBase.of(context).insuranceID + ": ",
widget
.dentalInvoiceDetailResponse
.listEInvoiceForDental[0]
.insuranceID !=
null
? widget.dentalInvoiceDetailResponse
.listEInvoiceForDental[0].insuranceID
: "N/A",
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID != null ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID : "N/A",
projectViewModel.isArabic),
],
),
@ -155,8 +132,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Card(
elevation: 3.0,
shape: cardRadius(12),
margin: EdgeInsets.only(
left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
@ -164,13 +140,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
children: [
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(
TranslationBase.of(context).totalBalance,
style: TextStyle(
letterSpacing: -0.64,
color: Colors.black,
fontSize: 18.0,
fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).totalBalance, style: TextStyle(letterSpacing: -0.64, color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.bold)),
),
Container(
width: double.infinity,
@ -178,15 +148,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).discount),
child: _getNormalText(TranslationBase.of(context).discount),
),
Expanded(
child: _getNormalText(
this.totalDiscount.toString() +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(this.totalDiscount.toString() + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -198,26 +163,13 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context)
.totalVAT
.toString() +
" (" +
widget
.dentalInvoiceDetailResponse
.listEInvoiceForDental[0]
.listConsultation[0]
.vATPercentage
.toString() +
"%): "),
child: _getNormalText(TranslationBase.of(context).totalVAT.toString() +
" (" +
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].vATPercentage.toString() +
"%): "),
),
Expanded(
child: _getNormalText(
num.tryParse(this.totalVAT.toString())
.toStringAsFixed(2) +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(num.tryParse(this.totalVAT.toString()).toStringAsFixed(2) + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -229,15 +181,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).total),
child: _getNormalText(TranslationBase.of(context).total),
),
Expanded(
child: _getNormalText(
this.subTotal.toString() +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(this.subTotal.toString() + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -249,15 +196,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).paid),
child: _getNormalText(TranslationBase.of(context).paid),
),
Expanded(
child: _getNormalText(
this.grandTotal.toString() +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(this.grandTotal.toString() + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -284,10 +226,8 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
List<ListConsultation> listConsultations = new List();
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation
.forEach((item) {
var i = listConsultations
.indexWhere((x) => x.procedureID == item.procedureID);
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.forEach((item) {
var i = listConsultations.indexWhere((x) => x.procedureID == item.procedureID);
if (i <= -1) {
listConsultations.add(item);
}
@ -308,16 +248,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
GifLoaderDialogUtils.showMyDialog(widget.context);
MyInvoicesService myInvoicesService = new MyInvoicesService();
myInvoicesService
.sendDentalAppointmentInvoiceEmail(
widget.listDentalAppointments.projectID,
widget.listDentalAppointments.appointmentNo,
widget.context)
.then((res) {
myInvoicesService.sendDentalAppointmentInvoiceEmail(widget.listDentalAppointments.projectID, widget.listDentalAppointments.appointmentNo, widget.context).then((res) {
GifLoaderDialogUtils.hideDialog(widget.context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(
message: TranslationBase.of(widget.context).emailSentSuccessfully);
AppToast.showSuccessToast(message: TranslationBase.of(widget.context).emailSentSuccessfully);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
@ -342,37 +276,17 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
],
),
);
for (int i = 0;
i <
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length;
i++) {
for (int i = 0; i < widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length; i++) {
tableRow.add(
TableRow(children: [
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].procedureName}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].quantity}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].price.toString() + " " + TranslationBase.of(context).sar}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].total.toString() + " " + TranslationBase.of(context).sar}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].procedureName}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].quantity}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].price.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].total.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
]),
);
}

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -49,6 +50,7 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).weight,
backgroundColor: CustomColors.appBackgroudGrey2Color,
appBarIcons: [
IconButton(
icon: Icon(Icons.email),
@ -106,35 +108,22 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
)
],
),
floatingActionButton: Stack(
children: [
Positioned(
bottom: 80,
right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddWeightPage(
model: model,
)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).primaryColor,
),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
)))
],
floatingActionButton: FloatingActionButton(
child: Icon(
Icons.add,
color: Colors.white,
),
backgroundColor: CustomColors.accentColor,
onPressed: () {
Navigator.push(
context,
FadePage(
page: AddWeightPage(
model: model,
),
),
);
},
),
),
),

@ -2,9 +2,11 @@ import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.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';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -20,62 +22,74 @@ class WeightMonthlyPage extends StatelessWidget {
this.model,
}) : super(key: key);
List<List> monthlyGroup = [];
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
groupData();
return AppScaffold(
isShowDecPage: false,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weighMonthTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Column(children: [
for (var monthly in monthlyGroup)
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
// 2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, monthly[1]),
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weighMonthTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
])
])
: Column(children: [
for (var monthly in monthlyGroup)
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
// 2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
])
],
),
)
],
),
)
),
mHeight(80),
],
),
);

@ -1,9 +1,11 @@
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.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';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -25,46 +27,64 @@ class WeightWeeklyPage extends StatelessWidget {
return AppScaffold(
isShowDecPage: false,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
// Container(
// margin: EdgeInsets.only(top: 12, left: 8, right: 8),
// color: Colors.white,
// child: LineChartCurved(
// horizontalInterval: 1.0,
// title: TranslationBase.of(context).weight,
// timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData,
// indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
// ),
// ),
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightWeekTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context, projectViewModel, model),
),
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightWeekTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context, projectViewModel, model),
),
],
),
)
],
),
)
),
mHeight(80),
],
),
);
@ -109,7 +129,11 @@ class WeightWeeklyPage extends StatelessWidget {
model: model,
),
),
);
).then((value) {
if (model.weekWeightMeasurementResult.isEmpty) {
model.weightWeekTimeSeriesData.clear();
}
});
},
child: Container(
// height: 70,

@ -2,9 +2,11 @@ import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.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';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -26,55 +28,63 @@ class WeightYearPage extends StatelessWidget {
groupData();
return AppScaffold(
isShowDecPage: false,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: LineChartCurved(
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "",
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightYearTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Column(children: [
for (var monthly in monthlyGroup)
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
]),
],
crossAxisAlignment: CrossAxisAlignment.start,children: [ Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
)
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightYearTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Column(children: [
for (var monthly in monthlyGroup)
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
]),
],
),
)],
),
),
mHeight(80),
],
),
);

@ -111,7 +111,12 @@ class BloodPressureWeeklyPage extends StatelessWidget {
measureTimeSelectedType: diabtec.measuredArmDesc,
),
),
);
).then((value) {
if(model.weekDiabtecPatientResult.isEmpty) {
model.weightWeekTimeSeriesDataTop.clear();
model.weightWeekTimeSeriesDataLow.clear();
}
});
},
child: Container(
// height: 70,

@ -116,7 +116,11 @@ class BloodSugarWeeklyPage extends StatelessWidget {
bloodSugarViewMode: bloodSugarViewMode,
),
),
);
).then((value) {
if(bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) {
timeSeriesData.clear();
}
});
},
child: Container(
// height: 70,

@ -36,7 +36,7 @@ class LineChartCurved extends StatelessWidget {
),
Text(
title,
style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
style: TextStyle(color: Colors.black, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
SizedBox(
@ -44,7 +44,7 @@ class LineChartCurved extends StatelessWidget {
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15, bottom: 15),
padding: const EdgeInsets.only(right: 18.0, left: 16.0),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
@ -80,6 +80,83 @@ class LineChartCurved extends StatelessWidget {
}
}
}
// LineChartData sampleData1(context) {
// return LineChartData(
// lineTouchData: LineTouchData(
// touchTooltipData: LineTouchTooltipData(
// tooltipBgColor: Colors.white,
// ),
// touchCallback: (LineTouchResponse touchResponse) {},
// handleBuiltInTouches: true,
// ),
// gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
// titlesData: FlTitlesData(
// bottomTitles: SideTitles(
// showTitles: true,
// getTextStyles: (value) => const TextStyle(
// color: Colors.black,
// fontSize: 10,
// ),
// // rotateAngle: 90,
// //rotateAngle:-65,
// margin: 22,
// getTitles: (value) {
// if (timeSeries.length < 15) {
// if (timeSeries.length > value.toInt()) {
// return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
// } else
// return '';
// } else {
// if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
// if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
// if (xAxixs.contains(value.toInt())) {
// return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
// }
// }
// return '';
// },
// ),
// leftTitles: SideTitles(
// showTitles: true,
// // interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
// interval: 3,
// getTextStyles: (value) => const TextStyle(
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 10,
// ),
//
// margin: 12,
// ),
// ),
// borderData: FlBorderData(
// show: true,
// border: const Border(
// bottom: BorderSide(
// color: Colors.black,
// width: 0.5,
// ),
// left: BorderSide(
// color: Colors.black,
// ),
// right: BorderSide(
// color: Colors.black,
// ),
// top: BorderSide(
// color: Colors.transparent,
// ),
// ),
// ),
// minX: 0,
// maxX: (timeSeries.length - 1).toDouble(),
// maxY: getMaxY() + 0.3,
// minY: 0,
// //getMinY(),
// lineBarsData: getData(context),
// );
// }
LineChartData sampleData1(context) {
return LineChartData(
lineTouchData: LineTouchData(
@ -89,8 +166,7 @@ class LineChartCurved extends StatelessWidget {
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(
horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
@ -98,8 +174,7 @@ class LineChartCurved extends StatelessWidget {
color: Colors.black,
fontSize: 10,
),
// rotateAngle: 90,
//rotateAngle:-65,
rotateAngle: -65,
margin: 22,
getTitles: (value) {
if (timeSeries.length < 15) {
@ -108,10 +183,8 @@ class LineChartCurved extends StatelessWidget {
} else
return '';
} else {
if (value.toInt() == 0)
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == timeSeries.length - 1)
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
}
@ -121,13 +194,21 @@ class LineChartCurved extends StatelessWidget {
),
leftTitles: SideTitles(
showTitles: true,
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
getTextStyles: (value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
interval: 3.0,
// interval: getMaxY() - getMinY() <= 500
// ? getMaxY() - getMinY() <= 50
// ? 10
// : 10
// : getMaxY() - getMinY() <= 1000
// ? 100
// : getMaxY() - getMinY() >= 10000
// ? 5000
// : 200,
margin: 12,
),
),
@ -149,14 +230,14 @@ class LineChartCurved extends StatelessWidget {
),
),
),
minX: 0,
maxX: (timeSeries.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: 0,//getMinY(),
minX: 0,
maxX: (timeSeries.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: 0,
//getMinY(),
lineBarsData: getData(context),
);
}
double getMaxY() {
double max = 0;
timeSeries.forEach((element) {
@ -180,9 +261,6 @@ class LineChartCurved extends StatelessWidget {
List<LineChartBarData> getData(context) {
List<FlSpot> spots = List();
if (timeSeries.length == 0) {
spots.add(FlSpot(0, 0));
}
for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
}
@ -191,9 +269,8 @@ class LineChartCurved extends StatelessWidget {
spots: spots,
isCurved: true,
colors: [secondaryColor],
barWidth: 5,
barWidth: 1.5,
isStrokeCapRound: true,
curveSmoothness: 0.12,
dotData: FlDotData(
show: false,
),

@ -36,7 +36,7 @@ class MonthLineChartCurved extends StatelessWidget {
),
Text(
title,
style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
style: TextStyle(color: Colors.black, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
SizedBox(
@ -91,7 +91,12 @@ class MonthLineChartCurved extends StatelessWidget {
handleBuiltInTouches: true,
),
gridData: FlGridData(
horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true),
horizontalInterval: 12,
show: true,
drawVerticalLine: true,
drawHorizontalLine: true,
verticalInterval: 12,
),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
@ -111,7 +116,11 @@ class MonthLineChartCurved extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 10,
),
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
interval: getMaxY() - getMinY() <= 500
? 50
: getMaxY() - getMinY() <= 1000
? 100
: 200,
// getTitles: (value) {
// if (value.toInt() == 0)
@ -184,7 +193,7 @@ class MonthLineChartCurved extends StatelessWidget {
spots: spots,
isCurved: true,
colors: [secondaryColor],
barWidth: 5,
barWidth: 1.5,
isStrokeCapRound: true,
curveSmoothness: 0.0,
dotData: FlDotData(

@ -7,9 +7,12 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
@ -28,20 +31,13 @@ class PrescriptionDeliveryAddressPage extends StatefulWidget {
final List<PrescriptionReport> prescriptionReportList;
final List<PrescriptionReportEnh> prescriptionReportEnhList;
const PrescriptionDeliveryAddressPage(
{Key key,
this.prescriptions,
this.prescriptionReportList,
this.prescriptionReportEnhList})
: super(key: key);
const PrescriptionDeliveryAddressPage({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList}) : super(key: key);
@override
_PrescriptionDeliveryAddressPageState createState() =>
_PrescriptionDeliveryAddressPageState();
_PrescriptionDeliveryAddressPageState createState() => _PrescriptionDeliveryAddressPageState();
}
class _PrescriptionDeliveryAddressPageState
extends State<PrescriptionDeliveryAddressPage> {
class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAddressPage> {
AddressInfo _selectedAddress;
Completer<GoogleMapController> _controller = Completer();
@ -79,218 +75,252 @@ class _PrescriptionDeliveryAddressPageState
return BaseView<PrescriptionDeliveryViewModel>(
onModelReady: (model) => model.getCustomerInfo(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).shippingAddresss,
baseViewModel: model,
body: Container(
height: MediaQuery.of(context).size.height * 0.65,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectLocationDialog(model.addressesList);
},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(7),
color: Colors.white,
shape: BoxShape.rectangle,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text(
getAddressName(),
),
margin: EdgeInsets.only(left: 10, right: 10),
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).shippingAddresss,
baseViewModel: model,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Card(
margin: EdgeInsets.only(left: 12, right: 12, bottom: 12, top: 12),
shape: cardRadius(12),
elevation: 3,
child: Container(
child: InkWell(
onTap: () => confirmSelectLocationDialog(model.addressesList),
child: Container(
padding: EdgeInsets.all(8),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
getAddressName(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.45,
),
),
),
Icon(Icons.arrow_drop_down)
],
),
),
),
Icon(
Icons.arrow_drop_down,
size: 22,
color: Colors.grey,
)
],
height: 50,
width: double.infinity,
),
),
),
),
SizedBox(
height: 10,
),
_selectedAddress == null
? Container(
child: Image.asset(
projectViewModel.isArabic
? 'assets/images/pharmacy/shipping_image_ar.png'
: 'assets/images/pharmacy/shipping_image.png',
height: 300,
),
)
: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey)),
height: 200,
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated:
(GoogleMapController controller) {
_controller.complete(controller);
},
InkWell(
onTap: () async {
Navigator.push(
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
)),
).then((value) {
if (value != null && value is AddNewAddressRequestModel) {
setState(() {
_selectedAddress = AddressInfo(
id: value.customer.id.toString(),
email: value.customer.email,
firstName: value.customer.addresses[0].firstName,
lastName: value.customer.addresses[0].lastName,
address1: value.customer.addresses[0].address1,
address2: value.customer.addresses[0].address2,
city: value.customer.addresses[0].city,
country: value.customer.addresses[0].country,
phoneNumber: value.customer.addresses[0].phoneNumber,
latLong: value.customer.addresses[0].latLong,
company: value.customer.addresses[0].company,
countryId: value.customer.addresses[0].countryId,
createdOnUtc: value.customer.addresses[0].createdOnUtc,
customerAttributes: value.customer.addresses[0].customerAttributes,
faxNumber: value.customer.addresses[0].faxNumber,
province: value.customer.addresses[0].province,
stateProvinceId: value.customer.addresses[0].stateProvinceId,
zipPostalCode: value.customer.addresses[0].zipPostalCode,
);
List latLongArr = _selectedAddress.latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
markers = Set();
markers.add(
Marker(
markerId: MarkerId(
_selectedAddress.latLong.hashCode.toString(),
),
position: LatLng(latitude, longitude),
),
);
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
});
}
});
},
child: Padding(
padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8),
child: Row(
children: [
Icon(Icons.add_circle_outline_sharp),
mWidth(12),
Text(
TranslationBase.of(context).addNewAddress,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
SizedBox(
height: 10,
),
Texts(
TranslationBase.of(context).shippingAddresss),
SizedBox(
height: 10,
),
Texts(
'${model.user.firstName} ${model.user.lastName}'),
SizedBox(
height: 10,
),
Texts(_selectedAddress.address1),
SizedBox(
height: 10,
),
Texts(_selectedAddress.address2),
SizedBox(
height: 10,
),
Texts(_selectedAddress.city +
" " +
_selectedAddress.country),
],
),
),
),
if (_selectedAddress != null)
Card(
shape: cardRadius(12),
color: Colors.white,
margin: EdgeInsets.all(12),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).selectAddress + ":",
fontSize: 12,
color: CustomColors.grey,
fontWeight: FontWeight.w600,
),
mHeight(12),
Container(
height: 175,
decoration: containerColorRadiusBorder(Colors.white, 12, Colors.grey),
clipBehavior: Clip.antiAlias,
child: Card(
shape: cardRadius(12),
clipBehavior: Clip.antiAlias,
elevation: 0,
margin: const EdgeInsets.all(0),
// child: GoogleMap(
// mapType: MapType.normal,
// markers: markers,
// initialCameraPosition: _kGooglePlex,
// onMapCreated: (GoogleMapController controller) {
// _controller.complete(controller);
// },
// ),
child: Image.network(
"https://maps.googleapis.com/maps/api/staticmap?center=" +
_kGooglePlex.target.latitude.toString() +
"," +
_kGooglePlex.target.longitude.toString() +
"&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" +
_kGooglePlex.target.latitude.toString() +
"," +
_kGooglePlex.target.longitude.toString() +
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
width: double.infinity,
height: double.infinity,
fit: BoxFit.cover,
),
),
),
SizedBox(
height: 10,
),
Texts(
TranslationBase.of(context).shippingAddresss + ":",
fontSize: 12,
color: CustomColors.grey,
fontWeight: FontWeight.w600,
),
SizedBox(
height: 2,
),
Texts(
'${model.user.firstName} ${model.user.lastName}',
fontSize: 12,
fontWeight: FontWeight.w600,
),
Texts(
_selectedAddress.address1,
fontSize: 12,
fontWeight: FontWeight.w600,
),
Texts(
_selectedAddress.address2,
fontSize: 12,
fontWeight: FontWeight.w600,
),
Texts(
_selectedAddress.city + " " + _selectedAddress.country,
fontSize: 12,
fontWeight: FontWeight.w600,
),
],
),
),
)
],
],
),
),
),
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.25,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(),
Container(
width: MediaQuery.of(context).size.width * 0.8,
Card(
shape: cardRadius(0),
margin: EdgeInsets.zero,
elevation: 20,
child: Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 16),
child: Button(
label:
TranslationBase.of(context).addNewAddress.toUpperCase(),
label: TranslationBase.of(context).continues.toUpperCase(),
disabled: _selectedAddress == null,
backgroundColor: _selectedAddress == null ? CustomColors.grey2 : CustomColors.accentColor,
onTap: () {
Navigator.push(
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
)),
).then((value) {
if (value != null &&
value is AddNewAddressRequestModel) {
setState(() {
_selectedAddress = AddressInfo(
id: value.customer.id.toString(),
email: value.customer.email,
firstName: value.customer.addresses[0].firstName,
lastName: value.customer.addresses[0].lastName,
address1: value.customer.addresses[0].address1,
address2: value.customer.addresses[0].address2,
city: value.customer.addresses[0].city,
country: value.customer.addresses[0].country,
phoneNumber: value.customer.addresses[0].phoneNumber,
latLong: value.customer.addresses[0].latLong,
company: value.customer.addresses[0].company,
countryId: value.customer.addresses[0].countryId,
createdOnUtc: value.customer.addresses[0].createdOnUtc,
customerAttributes: value.customer.addresses[0].customerAttributes,
faxNumber: value.customer.addresses[0].faxNumber,
province: value.customer.addresses[0].province,
stateProvinceId: value.customer.addresses[0].stateProvinceId,
zipPostalCode: value.customer.addresses[0].zipPostalCode,
);
List latLongArr = _selectedAddress.latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
markers = Set();
markers.add(
Marker(
markerId: MarkerId(
_selectedAddress.latLong.hashCode.toString(),
),
position: LatLng(latitude, longitude),
),
);
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
});
}
});
page: PrescriptionOrderOverview(
latitude: latitude,
longitude: longitude,
prescriptionReportEnhList: widget.prescriptionReportEnhList,
prescriptionReportList: widget.prescriptionReportList,
prescriptions: widget.prescriptions,
selectedAddress: _selectedAddress,
),
),
);
},
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label:
TranslationBase.of(context).continues.toUpperCase(),
disabled: _selectedAddress == null,
backgroundColor: _selectedAddress == null
? Colors.green[300]
: Colors.green[700],
onTap: () {
Navigator.push(
context,
FadePage(
page: PrescriptionOrderOverview(
latitude: latitude,
longitude: longitude,
prescriptionReportEnhList:
widget.prescriptionReportEnhList,
prescriptionReportList:
widget.prescriptionReportList,
prescriptions: widget.prescriptions,
selectedAddress: _selectedAddress,
),
),
);
},
))
],
),
)),
),
],
),
),
),
);
}

@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_repor
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
@ -21,6 +23,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
final AddressInfo selectedAddress;
final double latitude;
final double longitude;
PrescriptionOrderOverview({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList, this.selectedAddress, this.latitude, this.longitude});
@override
@ -30,143 +33,163 @@ class PrescriptionOrderOverview extends StatelessWidget {
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).orderOverview,
baseViewModel: model,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container(
height: MediaQuery.of(context).size.height * 0.8,
height: double.infinity,
child: Column(
children: [
if (!prescriptions.isInOutPatient)
...List.generate(
prescriptionReportList.length,
(index) => Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
Expanded(
child: Column(
children: [
if (!prescriptions.isInOutPatient)
Card(
margin: EdgeInsets.all(12),
shape: cardRadius(12),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: [
...List.generate(
prescriptionReportList.length,
(index) => Card(
margin: EdgeInsets.all(0.0),
color: Colors.white,
shape: cardRadius(0),
elevation: 0,
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(prescriptionReportList[index].itemDescription.isNotEmpty
? prescriptionReportList[index].itemDescription
: prescriptionReportList[index].itemDescriptionN)),
)),
],
),
))
],
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
)
else
Card(
margin: EdgeInsets.all(12),
shape: cardRadius(12),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
prescriptionReportEnhList.length,
(index) => Card(
margin: EdgeInsets.all(0.0),
color: Colors.white,
shape: cardRadius(0),
elevation: 0,
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 10.0),
decoration: BoxDecoration(
border: Border.all(width: 1.0, color: Color(0xffEBEBEB)),
borderRadius: BorderRadius.all(Radius.circular(30.0)),
),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)),
child: Image.network(
prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 48,
height: 48,
),
),
),
SizedBox(width: 14),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(prescriptionReportEnhList[index].itemDescription),
],
),
),
),
],
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
prescriptionReportList[index].itemDescription.isNotEmpty ? prescriptionReportList[index].itemDescription : prescriptionReportList[index].itemDescriptionN)),
)),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
)
],
),
))
else
...List.generate(
prescriptionReportEnhList.length,
(index) => Container(
margin: EdgeInsets.all(8.0),
color: Colors.white,
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(prescriptionReportEnhList[index].itemDescription),
],
),
),
),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
)
],
),
),
)
],
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.15,
color: Colors.grey[100],
child: Column(
children: <Widget>[
SizedBox(
height: 12,
),
],
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: SecondaryButton(
label: TranslationBase.of(context).submit.toUpperCase(),
color: Colors.green[800],
onTap: () async {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).confirmPrescription,
okTitle: TranslationBase.of(context).ok,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model
.insertDeliveryOrder(
lineItemNo: 0,
longitude: longitude,
latitude: latitude,
appointmentNo: prescriptions.appointmentNo,
dischargeID: prescriptions.dischargeNo,
createdBy: model.user.patientID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
showErrorDialog(context, model.error);
else {
Navigator.pop(context);
Navigator.pop(context);
Navigator.pop(context, true);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
});
},
),
);
},
))
Card(
shape: cardRadius(0),
margin: EdgeInsets.zero,
elevation: 20,
child: Container(
width: double.infinity,
margin: EdgeInsets.all(12),
child: SecondaryButton(
label: TranslationBase.of(context).submit.toUpperCase(),
color: CustomColors.accentColor,
onTap: () async {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).confirmPrescription,
okTitle: TranslationBase.of(context).ok,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model
.insertDeliveryOrder(
lineItemNo: 0,
longitude: longitude,
latitude: latitude,
appointmentNo: prescriptions.appointmentNo,
dischargeID: prescriptions.dischargeNo,
createdBy: model.user.patientID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
showErrorDialog(context, model.error);
else {
Navigator.pop(context);
Navigator.pop(context);
Navigator.pop(context, true);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
});
},
),
);
},
)),
)
],
),
),

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:giffy_dialog/giffy_dialog.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:url_launcher/url_launcher.dart';
@ -53,9 +54,7 @@ class PharmacyForPrescriptionsPage extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
child: Texts(prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? ''),
),
),
)
@ -68,70 +67,172 @@ class PharmacyForPrescriptionsPage extends StatelessWidget {
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
itemBuilder: (context, index) => Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
margin: EdgeInsets.all(12.0),
padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
model.pharmacyPrescriptionsList[index].projectImageURL,
fit: BoxFit.cover,
width: 60,
height: 70,
InkWell(
onTap: () {
showDialog(
context: context,
builder: (_) => AssetGiffyDialog(
title: Text(
model.pharmacyPrescriptionsList[index].locationDescription,
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
),
image: Image.network(
model.pharmacyPrescriptionsList[index].projectImageURL.toString(),
fit: BoxFit.cover,
),
buttonCancelText: Text(TranslationBase.of(context).cancel),
buttonCancelColor: Colors.grey,
onlyCancelButton: true,
),
);
},
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Image.network(
model.pharmacyPrescriptionsList[index].projectImageURL.toString(),
width: 48,
height: 48,
fit: BoxFit.cover,
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(model.pharmacyPrescriptionsList[index].locationDescription),
SizedBox(
height: 5,
),
Texts(model.pharmacyPrescriptionsList[index].cityName),
],
padding: EdgeInsets.only(left: 12, right: 12),
child: Text(
model.pharmacyPrescriptionsList[index].locationDescription?.trim().toString() +
"\n" +
model.pharmacyPrescriptionsList[index].cityName.trim().toString() +
"\n" +
model.pharmacyPrescriptionsList[index].distanceInKilometers.toString() +
" " +
TranslationBase.of(context).km_ ??
"",
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
),
),
InkWell(
onTap: () {
MapsLauncher.launchCoordinates(double.parse(model.pharmacyPrescriptionsList[index].latitude), double.parse(model.pharmacyPrescriptionsList[index].longitude));
},
child: Icon(
Icons.pin_drop,
size: 18,
color: Colors.red[900],
), //model.cOCItemList[index].cOCTitl
IconButton(
icon: Icon(
Icons.location_on,
color: Color(0xff2B353E),
),
constraints: BoxConstraints(),
padding: EdgeInsets.all(8),
tooltip: '',
onPressed: () {
// setState(() {
MapsLauncher.launchCoordinates(double.parse(model.pharmacyPrescriptionsList[index].latitude), double.parse(model.pharmacyPrescriptionsList[index].longitude),
model.pharmacyPrescriptionsList[index].locationDescription);
// });
},
),
SizedBox(
width: 15,
),
InkWell(
onTap: Feedback.wrapForTap(() {
launch("tel://${model.pharmacyPrescriptionsList[index].phoneNumber}");
}, context),
child: Container(
child: Icon(
Icons.call,
size: 18,
color: Colors.red[900],
),
IconButton(
icon: Icon(
Icons.phone,
color: Color(0xff2B353E),
),
)
constraints: BoxConstraints(),
padding: EdgeInsets.all(8),
tooltip: '',
onPressed: () {
// setState(() {
launch("tel://" + model.pharmacyPrescriptionsList[index].phoneNumber);
// });
},
),
],
),
),
// Container(
// width: double.infinity,
// margin: EdgeInsets.only(top: 10, left: 10, right: 10),
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.all(
// Radius.circular(10.0),
// ),
// border: Border.all(color: Colors.grey[200], width: 0.5),
// ),
// child: Row(
// children: <Widget>[
// ClipRRect(
// borderRadius: BorderRadius.all(Radius.circular(5)),
// child: Image.network(
// model.pharmacyPrescriptionsList[index].projectImageURL,
// fit: BoxFit.cover,
// width: 60,
// height: 70,
// ),
// ),
// Expanded(
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Texts(model.pharmacyPrescriptionsList[index].locationDescription),
// SizedBox(
// height: 5,
// ),
// Texts(model.pharmacyPrescriptionsList[index].cityName),
// ],
// ),
// ),
// ),
// InkWell(
// onTap: () {
// MapsLauncher.launchCoordinates(double.parse(model.pharmacyPrescriptionsList[index].latitude), double.parse(model.pharmacyPrescriptionsList[index].longitude));
// },
// child: Icon(
// Icons.pin_drop,
// size: 18,
// color: Colors.red[900],
// ),
// ),
// SizedBox(
// width: 15,
// ),
// InkWell(
// onTap: Feedback.wrapForTap(() {
// launch("tel://${model.pharmacyPrescriptionsList[index].phoneNumber}");
// }, context),
// child: Container(
// child: Icon(
// Icons.call,
// size: 18,
// color: Colors.red[900],
// ),
// ),
// )
// ],
// ),
// ),
itemCount: model.pharmacyPrescriptionsList.length,
),
)

@ -38,6 +38,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
DoctorHeader(
headerModel: HeaderModel(
prescriptions.doctorName,
prescriptions.doctorID,
prescriptions.doctorImageURL,
prescriptions.speciality,
"",
@ -180,6 +181,32 @@ class PrescriptionDetailsPage extends StatelessWidget {
},
);
return;
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: PrescriptionReminderDialog(
eventId: prescriptionReport.itemID.toString(),
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate: startDate,
endDate: endDate,
location: prescriptionReport.remarks,
days: 1,
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
},
iconData: Icons.notifications_active,
color: Color(0xffEAEAEA),

@ -49,6 +49,7 @@ class PrescriptionItemsPage extends StatelessWidget {
DoctorHeader(
headerModel: HeaderModel(
prescriptions.doctorName,
prescriptions.doctorID,
prescriptions.doctorImageURL,
prescriptions.speciality,
"",
@ -186,7 +187,7 @@ class PrescriptionItemsPage extends StatelessWidget {
),
),
Icon(
Icons.arrow_forward_ios,
Icons.arrow_forward,
size: 16,
),
],
@ -306,7 +307,7 @@ class PrescriptionItemsPage extends StatelessWidget {
),
),
Icon(
Icons.arrow_forward_ios,
Icons.arrow_forward,
size: 16,
),
],

@ -109,11 +109,11 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.formatDateToDate(prescriptionsOrder.createdOn, projectViewModel.isArabic),
DateUtil.getDayMonthYearDateFormatted(prescriptionsOrder.createdOn),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
Text(
DateUtil.formatDateToTime(prescriptionsOrder.createdOn),
DateUtil.formatDateToTimeLang(prescriptionsOrder.createdOn, false),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
],

@ -119,11 +119,11 @@ class PrescriptionsHistoryPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.formatDateToDate(prescriptionsViewModel.prescriptionsHistory[index].createdOn, projectViewModel.isArabic),
DateUtil.getDayMonthYearDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
Text(
DateUtil.formatDateToTime(prescriptionsViewModel.prescriptionsHistory[index].createdOn),
DateUtil.formatDateToTimeLang(prescriptionsViewModel.prescriptionsHistory[index].createdOn, false),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
],
@ -133,7 +133,7 @@ class PrescriptionsHistoryPage extends StatelessWidget {
),
),
Icon(
Icons.arrow_forward_ios,
Icons.arrow_forward,
size: 16,
),
mWidth(6),

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -26,7 +27,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController = TabController(length: 3, vsync: this);
imagesInfo.add(ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png'));
imagesInfo.add(ImagesInfo(
@ -74,7 +75,8 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
letterSpacing: -0.48,
),
tabs: [
Text(TranslationBase.of(context).prescriptions, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
Text(TranslationBase.of(context).byClinic, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
Text(TranslationBase.of(context).byHospital, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
Text(TranslationBase.of(context).orderLog, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
],
),
@ -84,9 +86,19 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
controller: _tabController,
children: <Widget>[
PrescriptionsPage(
FilterType.Clinic,
prescriptionsViewModel: model,
showOrderLog: () async {
_tabController.animateTo(1);
_tabController.animateTo(2);
await model.getPrescriptionsOrders(showLoading: true);
setState(() {});
},
),
PrescriptionsPage(
FilterType.Hospital,
prescriptionsViewModel: model,
showOrderLog: () async {
_tabController.animateTo(2);
await model.getPrescriptionsOrders(showLoading: true);
setState(() {});
},

@ -16,86 +16,67 @@ import 'package:provider/provider.dart';
class PrescriptionsPage extends StatelessWidget {
final VoidCallback showOrderLog;
final FilterType filterType;
final PrescriptionsViewModel prescriptionsViewModel;
const PrescriptionsPage({Key key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key);
const PrescriptionsPage(this.filterType, {Key key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
baseViewModel: prescriptionsViewModel,
body: FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
baseViewModel: prescriptionsViewModel,
body: ListView.separated(
physics: BouncingScrollPhysics(),
children: <Widget>[
Row(
children: [
MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, prescriptionsViewModel.filterType, () {
prescriptionsViewModel.setFilterType(FilterType.Clinic);
}),
MyTabView(TranslationBase.of(context).byHospital, FilterType.Hospital, prescriptionsViewModel.filterType, () {
prescriptionsViewModel.setFilterType(FilterType.Hospital);
}),
],
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.only(top: 12),
separatorBuilder: (context, index) {
return Container(
height: 12,
margin: EdgeInsets.only(left: 21, right: 21),
// color: Color(0xffD9D9D9),
);
},
itemBuilder: (context, index) {
List<Prescriptions> prescriptionsList = prescriptionsViewModel.prescriptionsOrderList[index].prescriptionsList;
return AppExpandableNotifier(
title: prescriptionsViewModel.prescriptionsOrderList[index].filterName,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
Prescriptions prescriptions = prescriptionsList[_index];
return DoctorCard(
onTap: () async {
final _shouldRecallApi = await Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: prescriptions,
),
),
);
if (_shouldRecallApi != null) {
showOrderLog();
}
},
name: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
rating: prescriptions.actualDoctorRate.toDouble(),
subName: prescriptions.name,
isInOutPatient: prescriptions.isInOutPatient,
isLiveCareAppointment: prescriptions.isLiveCareAppointment,
// appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions
// .appointmentDate)),
date: DateUtil.convertStringToDate(prescriptions
.appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: prescriptionsList.length),
);
},
itemCount: prescriptionsViewModel.prescriptionsOrderList.length,
)
],
),
),
);
padding: EdgeInsets.only(top: 12),
separatorBuilder: (context, index) {
return Container(
height: 12,
margin: EdgeInsets.only(left: 21, right: 21),
// color: Color(0xffD9D9D9),
);
},
itemBuilder: (context, index) {
List<Prescriptions> prescriptionsList = prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].prescriptionsList;
return AppExpandableNotifier(
title: prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].filterName,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
Prescriptions prescriptions = prescriptionsList[_index];
bool _isSortByClinic = filterType == FilterType.Clinic;
return DoctorCard(
onTap: () async {
final _shouldRecallApi = await Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: prescriptions,
),
),
);
if (_shouldRecallApi != null) {
showOrderLog();
}
},
name: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
rating: prescriptions.actualDoctorRate.toDouble(),
subName: _isSortByClinic ? prescriptions.name : prescriptions.clinicDescription,
isSortByClinic: _isSortByClinic,
isInOutPatient: prescriptions.isInOutPatient,
isLiveCareAppointment: prescriptions.isLiveCareAppointment,
date: DateUtil.convertStringToDate(prescriptions
.appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: prescriptionsList.length),
);
},
itemCount: prescriptionsViewModel.prescriptionsOrderListByValue(filterType).length,
));
}
}

@ -40,6 +40,7 @@ class RadiologyDetailsPage extends StatelessWidget {
DoctorHeader(
headerModel: new HeaderModel(
finalRadiology.doctorName,
finalRadiology.doctorID,
finalRadiology.doctorImageURL,
finalRadiology.speciality,
finalRadiology.invoiceNo.toString(),

@ -137,15 +137,6 @@ class LineChartCurved extends StatelessWidget {
fontSize: 10,
),
interval: 3.0,
// interval: getMaxY() - getMinY() <= 500
// ? getMaxY() - getMinY() <= 50
// ? 10
// : 10
// : getMaxY() - getMinY() <= 1000
// ? 100
// : getMaxY() - getMinY() >= 10000
// ? 5000
// : 200,
margin: 12,
),
),

@ -33,7 +33,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
// vitalSigns.add(new VitalSign(TranslationBase.of(context).body, mode.bodyMax, TranslationBase.of(context).mass, "assets/images/new/"));
vitalSigns.add(new VitalSign(TranslationBase.of(context).temperature, mode.temperatureCelcius, TranslationBase.of(context).tempC, "assets/images/new/temperature.svg"));
vitalSigns.add(new VitalSign(TranslationBase.of(context).heart, mode.hartRat, TranslationBase.of(context).bpm, "assets/images/new/heart_rate.svg"));
vitalSigns.add(new VitalSign(TranslationBase.of(context).respirationRate, mode.respirationBeatPerMinute, TranslationBase.of(context).bpm, "assets/images/new/respiration_rate.svg"));
vitalSigns.add(new VitalSign(TranslationBase.of(context).respirationRate, mode.respirationBeatPerMinute, TranslationBase.of(context).respirationBPM, "assets/images/new/respiration_rate.svg"));
vitalSigns.add(new VitalSign(TranslationBase.of(context).bloodPressure, mode.bloodPressure, TranslationBase.of(context).sysDias, "assets/images/new/blood_pressure.svg"));
}
@ -71,7 +71,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Body Mass Index is: " + mode.bodyMax,
TranslationBase.of(context).bodyMassIndex + mode.bodyMax,
style: TextStyle(
fontSize: 16,
letterSpacing: -0.64,
@ -83,15 +83,15 @@ class VitalSignDetailsScreen extends StatelessWidget {
height: MediaQuery.of(context).size.width / 2.8,
child: Row(
children: [
showMass(context, "Underweight", "< 18.5", double.parse(mode.bodyMax) <= 18.5 ? Colors.red : Colors.black, 8),
showMass(context, TranslationBase.of(context).underWeight, "< 18.5", double.parse(mode.bodyMax) <= 18.5 ? Colors.red : Colors.black, 8),
mWidth(12),
showMass(context, "Normal", "18.5 - 24.9", (double.parse(mode.bodyMax) > 18.5 && double.parse(mode.bodyMax) < 25) ? Colors.red : Colors.black, 6),
showMass(context, TranslationBase.of(context).healthy, "18.5 - 24.9", (double.parse(mode.bodyMax) > 18.5 && double.parse(mode.bodyMax) < 25) ? Colors.red : Colors.black, 6),
mWidth(12),
showMass(context, "Overweight", "25 - 29.9", (double.parse(mode.bodyMax) >= 25 && double.parse(mode.bodyMax) < 30) ? Colors.red : Colors.black, 4),
showMass(context, TranslationBase.of(context).overWeight, "25 - 29.9", (double.parse(mode.bodyMax) >= 25 && double.parse(mode.bodyMax) < 30) ? Colors.red : Colors.black, 4),
mWidth(12),
showMass(context, "Obese", "30 - 34.9", (double.parse(mode.bodyMax) >= 30 && double.parse(mode.bodyMax) < 35) ? Colors.red : Colors.black, 2),
showMass(context, TranslationBase.of(context).obese, "30 - 34.9", (double.parse(mode.bodyMax) >= 30 && double.parse(mode.bodyMax) < 35) ? Colors.red : Colors.black, 2),
mWidth(12),
showMass(context, "Extreme Obese", "> 35", (double.parse(mode.bodyMax) >= 35) ? Colors.red : Colors.black, 0),
showMass(context, TranslationBase.of(context).extremeObese, "> 35", (double.parse(mode.bodyMax) >= 35) ? Colors.red : Colors.black, 0),
],
),
),

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save