Merge branch 'haroon-new-design' into 'development_new_design_2.0'

Haroon new design

See merge request Cloud_Solution/diplomatic-quarter!483
merge-update-with-lab-changes
haroon amjad 4 years ago
commit 2e6ebc2933

@ -1625,4 +1625,5 @@ const Map localizedValues = {
"bodyFatTitle": {"en": "Body Fat", "ar": " الدهون في الجسم"}, "bodyFatTitle": {"en": "Body Fat", "ar": " الدهون في الجسم"},
"cholesTitle": {"en": "Blood Cholesterol", "ar": " الكولسترول في الدم"}, "cholesTitle": {"en": "Blood Cholesterol", "ar": " الكولسترول في الدم"},
"laserClinic": {"en": "Laser Clinic", "ar": "عيادة الليزر"}, "laserClinic": {"en": "Laser Clinic", "ar": "عيادة الليزر"},
"noImage": {"en": "No Image", "ar": "لا توجد صورة"},
}; };

@ -1,157 +0,0 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class Prescriptions {
String setupID;
int projectID;
int patientID;
int appointmentNo;
String appointmentDate;
String doctorName;
String clinicDescription;
String name;
int episodeID;
int actualDoctorRate;
int admission;
int clinicID;
String companyName;
String despensedStatus;
DateTime dischargeDate;
int dischargeNo;
int doctorID;
String doctorImageURL;
int doctorRate;
String doctorTitle;
int gender;
String genderDescription;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
bool isInOutPatient;
String isInOutPatientDescription;
String isInOutPatientDescriptionN;
bool isInsurancePatient;
String nationalityFlagURL;
int noOfPatientsRate;
String qR;
List<String> speciality;
Prescriptions(
{this.setupID,
this.projectID,
this.patientID,
this.appointmentNo,
this.appointmentDate,
this.doctorName,
this.clinicDescription,
this.name,
this.episodeID,
this.actualDoctorRate,
this.admission,
this.clinicID,
this.companyName,
this.despensedStatus,
this.dischargeDate,
this.dischargeNo,
this.doctorID,
this.doctorImageURL,
this.doctorRate,
this.doctorTitle,
this.gender,
this.genderDescription,
this.isActiveDoctorProfile,
this.isDoctorAllowVedioCall,
this.isExecludeDoctor,
this.isInOutPatient,
this.isInOutPatientDescription,
this.isInOutPatientDescriptionN,
this.isInsurancePatient,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.qR,
this.speciality});
Prescriptions.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
appointmentNo = json['AppointmentNo'];
appointmentDate = json['AppointmentDate'];
doctorName = json['DoctorName'];
clinicDescription = json['ClinicDescription'];
name = json['Name'];
episodeID = json['EpisodeID'];
actualDoctorRate = json['ActualDoctorRate'];
admission = json['Admission'];
clinicID = json['ClinicID'];
companyName = json['CompanyName'];
despensedStatus = json['Despensed_Status'];
dischargeDate = DateUtil.convertStringToDate(json['DischargeDate']);
dischargeNo = json['DischargeNo'];
doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate'];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isExecludeDoctor = json['IsExecludeDoctor'];
isInOutPatient = json['IsInOutPatient'];
isInOutPatientDescription = json['IsInOutPatientDescription'];
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
isInsurancePatient = json['IsInsurancePatient'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR'];
// speciality = json['Speciality'].cast<String>();
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID;
data['AppointmentNo'] = this.appointmentNo;
data['AppointmentDate'] = this.appointmentDate;
data['DoctorName'] = this.doctorName;
data['ClinicDescription'] = this.clinicDescription;
data['Name'] = this.name;
data['EpisodeID'] = this.episodeID;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['Admission'] = this.admission;
data['ClinicID'] = this.clinicID;
data['CompanyName'] = this.companyName;
data['Despensed_Status'] = this.despensedStatus;
data['DischargeDate'] = this.dischargeDate;
data['DischargeNo'] = this.dischargeNo;
data['DoctorID'] = this.doctorID;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsInOutPatient'] = this.isInOutPatient;
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
data['IsInsurancePatient'] = this.isInsurancePatient;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['QR'] = this.qR;
data['Speciality'] = this.speciality;
return data;
}
}
//class PrescriptionsList {
// String filterName = "";
// List<Prescriptions> prescriptionsList = List();
//
// PrescriptionsList({this.filterName, Prescriptions prescriptions}) {
// prescriptionsList.add(prescriptions);
// }
//}

@ -1,8 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; 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/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
class PrescriptionService extends BaseService { class PrescriptionService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences(); final AppSharedPreferences sharedPref = AppSharedPreferences();
@ -11,14 +10,14 @@ class PrescriptionService extends BaseService {
String errorMsg = ''; String errorMsg = '';
List<Prescriptions> _prescriptionsList = List(); List<Prescriptions> _prescriptionsList = List();
List<Prescriptions> get prescriptionsList => _prescriptionsList; List<Prescriptions> get prescriptionsList => _prescriptionsList;
Future getPrescription() async { Future getPrescription() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(PRESCRIPTION, await baseAppClient.post(PRESCRIPTION, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear(); _prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) { response['PatientPrescriptionList'].forEach((prescriptions) {
_prescriptionsList.add(Prescriptions.fromJson(prescriptions)); _prescriptionsList.add(Prescriptions.fromJson(prescriptions));

@ -8,8 +8,6 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
@ -19,19 +17,17 @@ class OrderPreviewViewModel extends BaseViewModel {
List<Addresses> get addresses => _orderService.addresses; List<Addresses> get addresses => _orderService.addresses;
LacumAccountInformation get lacumInformation => LacumAccountInformation get lacumInformation => _orderService.lacumInformation;
_orderService.lacumInformation;
List<OrderDetailModel> get orderListModel => _orderService.orderList; List<OrderDetailModel> get orderListModel => _orderService.orderList;
PharmacyModuleViewModel pharmacyModuleViewModel = PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
locator<PharmacyModuleViewModel>();
ShoppingCartResponse cartResponse = ShoppingCartResponse(); ShoppingCartResponse cartResponse = ShoppingCartResponse();
PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData(); PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData();
double totalAdditionalShippingCharge = 0; double totalAdditionalShippingCharge = 0;
setShoppingCartResponse(ShoppingCartResponse cart){ setShoppingCartResponse(ShoppingCartResponse cart) {
cartResponse = cart; cartResponse = cart;
notifyListeners(); notifyListeners();
} }
@ -71,8 +67,7 @@ class OrderPreviewViewModel extends BaseViewModel {
} }
} }
Future<ShoppingCartResponse> changeProductQuantity( Future<ShoppingCartResponse> changeProductQuantity(ShoppingCart product) async {
ShoppingCart product) async {
setState(ViewState.Busy); setState(ViewState.Busy);
var resp = await _orderService.changeProductQuantity(product.id, product); var resp = await _orderService.changeProductQuantity(product.id, product);
var object = _handleGetShoppingCartResponse(resp); var object = _handleGetShoppingCartResponse(resp);
@ -125,11 +120,17 @@ class OrderPreviewViewModel extends BaseViewModel {
cartResponse.subtotalVatAmount = res["subtotal_vat_amount"]; cartResponse.subtotalVatAmount = res["subtotal_vat_amount"];
cartResponse.subtotalVatRate = res["subtotal_vat_rate"]; cartResponse.subtotalVatRate = res["subtotal_vat_rate"];
cartResponse.shoppingCarts = List(); cartResponse.shoppingCarts = List();
if (paymentCheckoutData.shippingOption != null) {
totalAdditionalShippingCharge = paymentCheckoutData.shippingOption.rate;
cartResponse.subtotalVatAmount += paymentCheckoutData.shippingOption.rateVat;
cartResponse.subtotal += paymentCheckoutData.shippingOption.rate + paymentCheckoutData.shippingOption.rateVat;
}
res["shopping_carts"].forEach((item) { res["shopping_carts"].forEach((item) {
ShoppingCart shoppingCart = ShoppingCart.fromJson(item); ShoppingCart shoppingCart = ShoppingCart.fromJson(item);
cartResponse.shoppingCarts.add(shoppingCart); cartResponse.shoppingCarts.add(shoppingCart);
totalAdditionalShippingCharge += totalAdditionalShippingCharge += shoppingCart.product.additionalShippingCharge;
shoppingCart.product.additionalShippingCharge;
}); });
return cartResponse; return cartResponse;
} }
@ -173,7 +174,7 @@ class OrderPreviewViewModel extends BaseViewModel {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
getLacumGroupData(identificationNo); if (_orderService.lacumInformation.yahalaAccountNo != 0) getLacumGroupData(identificationNo);
} }
} }
@ -181,8 +182,7 @@ class OrderPreviewViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getLacumGroupInformation(identificationNo); await _orderService.getLacumGroupInformation(identificationNo);
paymentCheckoutData.lacumInformation = _orderService.lacumGroupInformation; paymentCheckoutData.lacumInformation = _orderService.lacumGroupInformation;
paymentCheckoutData.usedLakumPoints = paymentCheckoutData paymentCheckoutData.usedLakumPoints = paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount;
.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount;
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -193,9 +193,7 @@ class OrderPreviewViewModel extends BaseViewModel {
getShippingOption() async { getShippingOption() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService await _orderService.getShippingOption(paymentCheckoutData.address).then((res) {
.getShippingOption(paymentCheckoutData.address)
.then((res) {
paymentCheckoutData.shippingOption = ShippingOption.fromJson(res); paymentCheckoutData.shippingOption = ShippingOption.fromJson(res);
setState(ViewState.Idle); setState(ViewState.Idle);
}); });
@ -211,8 +209,7 @@ class OrderPreviewViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
await pharmacyModuleViewModel.generatePharmacyToken(); await pharmacyModuleViewModel.generatePharmacyToken();
await _orderService.makeOrder( await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts);
paymentCheckoutData, cartResponse.shoppingCarts);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -1,5 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
@ -14,6 +14,7 @@ class PrescriptionViewModel extends BaseViewModel {
getPrescription() async { getPrescription() async {
await getSavedLanguage(); await getSavedLanguage();
prescriptionsList.clear();
if(prescriptionsList.isEmpty){ if(prescriptionsList.isEmpty){
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getPrescription(); await _prescriptionService.getPrescription();

@ -52,7 +52,7 @@ class LocationModel {
int barcode; int barcode;
dynamic companybarcode; dynamic companybarcode;
int cityId; int cityId;
CityName cityName; String cityName;
int distanceInKilometers; int distanceInKilometers;
String latitude; String latitude;
int locationType; int locationType;
@ -78,7 +78,7 @@ class LocationModel {
barcode: json["Barcode"], barcode: json["Barcode"],
companybarcode: json["Companybarcode"], companybarcode: json["Companybarcode"],
cityId: json["CityID"], cityId: json["CityID"],
cityName: cityNameValues.map[json["CityName"]], cityName: json["CityName"],
distanceInKilometers: json["DistanceInKilometers"], distanceInKilometers: json["DistanceInKilometers"],
latitude: json["Latitude"], latitude: json["Latitude"],
locationType: json["LocationType"], locationType: json["LocationType"],
@ -105,7 +105,7 @@ class LocationModel {
"Barcode": barcode, "Barcode": barcode,
"Companybarcode": companybarcode, "Companybarcode": companybarcode,
"CityID": cityId, "CityID": cityId,
"CityName": cityNameValues.reverse[cityName], "CityName": cityName,
"DistanceInKilometers": distanceInKilometers, "DistanceInKilometers": distanceInKilometers,
"Latitude": latitude, "Latitude": latitude,
"LocationType": locationType, "LocationType": locationType,

@ -38,9 +38,6 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
TextEditingController _notesTextController = TextEditingController(); TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
// Gender gender = Gender.Male; //Gender.NON;
// Blood blood = Blood.Aminus; //Blood.NON;
//HospitalsModel _selectedHospital;
CitiesModel _selectedHospital; CitiesModel _selectedHospital;
int _selectedHospitalIndex = 0; int _selectedHospitalIndex = 0;
@ -80,7 +77,6 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
cityID = element.iD; cityID = element.iD;
} }
}); });
return cityID; return cityID;
} }
@ -90,20 +86,22 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getCities().then((value) { if (projectProvider.isLogin) {
model.getBlood().then((value) { model.getCities().then((value) {
if (model.bloodModelList.length > 0) { model.getBlood().then((value) {
CitiesModel citiesModel = new CitiesModel(); if (model.bloodModelList.length > 0) {
citiesModel.iD = getSelectedCityID(model); CitiesModel citiesModel = new CitiesModel();
_selectedHospitalIndex = (citiesModel.iD - 1); citiesModel.iD = getSelectedCityID(model);
citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description; _selectedHospitalIndex = (citiesModel.iD - 1);
citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN; citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
_selectedHospital = citiesModel; citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
} else { _selectedHospital = citiesModel;
_selectedHospital = model.CitiesModelList[0]; } else {
} _selectedHospital = model.CitiesModelList[0];
}
});
}); });
}); }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -130,12 +128,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (projectProvider.isLogin && model.state != ViewState.Busy) if (projectProvider.isLogin && model.state != ViewState.Busy)
CommonDropDownView( CommonDropDownView(TranslationBase.of(context).city, projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description, () {
TranslationBase.of(context).city,
// (model.bloodModelList.isNotEmpty && model.CitiesModelList.isNotEmpty)
// ? model.bloodModelList[0].city
// :
projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description, () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < model.CitiesModelList.length; i++) for (int i = 0; i < model.CitiesModelList.length; i++)
RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i), RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i),

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_mo
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -123,7 +124,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
styleTwo = true; styleTwo = true;
styleIcon = Icon( styleIcon = Icon(
Icons.auto_awesome_mosaic, Icons.auto_awesome_mosaic,
color: Colors.blue, color: CustomColors.green,
size: 29.0, size: 29.0,
); );
} else { } else {
@ -131,7 +132,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
styleTwo = false; styleTwo = false;
styleIcon = Icon( styleIcon = Icon(
Icons.widgets_sharp, Icons.widgets_sharp,
color: Colors.blue, color: CustomColors.green,
size: 29.0, size: 29.0,
); );
} }
@ -401,7 +402,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
height: 4.0, height: 4.0,
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.65, width: MediaQuery.of(context).size.width * 0.64,
child: Texts( child: Texts(
model.finalProducts[index].name, model.finalProducts[index].name,
regular: true, regular: true,
@ -445,7 +446,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
icon: Icon( icon: Icon(
Icons.shopping_cart, Icons.shopping_cart,
size: 18, size: 18,
color: Colors.blue, color: CustomColors.green,
), ),
onPressed: () async { onPressed: () async {
if (model.finalProducts[index].rxMessage == null) { if (model.finalProducts[index].rxMessage == null) {

File diff suppressed because it is too large Load Diff

@ -55,10 +55,10 @@ class _CartOrderPageState extends State<CartOrderPage> {
appBarTitle: TranslationBase.of(context).shoppingCart, appBarTitle: TranslationBase.of(context).shoppingCart,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
//isBottomBar: true,
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
isShowDecPage: false, isShowDecPage: false,
isMainPharmacyPages: true, isMainPharmacyPages: true,
showPharmacyCart: false,
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: !(model.cartResponse.shoppingCarts == null || body: !(model.cartResponse.shoppingCarts == null ||

@ -33,9 +33,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
} }
void getData() async { void getData() async {
if (isLoading) if (isLoading) await Provider.of<OrderPreviewViewModel>(context, listen: false).getShoppingCart();
await Provider.of<OrderPreviewViewModel>(context, listen: false)
.getShoppingCart();
setState(() { setState(() {
isLoading = false; isLoading = false;
}); });
@ -63,7 +61,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
color: Color(0xFFF1F1F1), color: Color(0xFFF1F1F1),
child: Column( child: Column(
children: [ children: [
SelectAddressWidget(model, widget.addresses,changeMainState), SelectAddressWidget(model, widget.addresses, changeMainState),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -97,11 +95,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
color: Colors.black, color: Colors.black,
), ),
...List.generate( ...List.generate(
model.cartResponse.shoppingCarts != null model.cartResponse.shoppingCarts != null ? model.cartResponse.shoppingCarts.length : 0,
? model.cartResponse.shoppingCarts.length (index) => ProductOrderPreviewItem(model.cartResponse.shoppingCarts[index]),
: 0,
(index) => ProductOrderPreviewItem(
model.cartResponse.shoppingCarts[index]),
), ),
], ],
), ),
@ -219,9 +214,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
: Container(), : Container(),
), ),
SizedBox( SizedBox(
height: model.cartResponse.shoppingCarts != null height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
? height * 0.10
: 0,
) )
], ],
), ),
@ -235,9 +228,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
), ),
); );
} }
changeMainState(){
setState(() {
}); changeMainState() {
setState(() {});
} }
} }

@ -1,24 +1,10 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -38,14 +24,15 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
AddressInfo address; AddressInfo address;
_navigateToAddressPage(String identificationNo) { _navigateToAddressPage(String identificationNo) {
Navigator.push(context, FadePage(page: PharmacyAddressesPage())) Navigator.push(context, FadePage(page: PharmacyAddressesPage())).then((result) async {
.then((result) {
if (result != null) { if (result != null) {
GifLoaderDialogUtils.showMyDialog(context);
address = result; address = result;
widget.model.paymentCheckoutData.address = widget.model.paymentCheckoutData.address = Addresses.fromJson(address.toJson());
Addresses.fromJson(address.toJson()); await widget.model.getInformationsByAddress(identificationNo);
widget.model.getInformationsByAddress(identificationNo); await widget.model.getShoppingCart();
widget.changeMainState(); widget.changeMainState();
GifLoaderDialogUtils.hideDialog(context);
} }
}); });
} }
@ -53,8 +40,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
@override @override
void initState() { void initState() {
if (widget.model.paymentCheckoutData.address != null) { if (widget.model.paymentCheckoutData.address != null) {
address = AddressInfo.fromJson( address = AddressInfo.fromJson(widget.model.paymentCheckoutData.address.toJson());
widget.model.paymentCheckoutData.address.toJson());
} }
super.initState(); super.initState();
} }
@ -79,8 +65,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: padding: EdgeInsets.symmetric(vertical: 0, horizontal: 6),
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
child: Texts( child: Texts(
TranslationBase.of(context).selectAddress, TranslationBase.of(context).selectAddress,
fontSize: 14, fontSize: 14,
@ -114,8 +99,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 0, horizontal: 6),
vertical: 0, horizontal: 6),
child: Texts( child: Texts(
TranslationBase.of(context).shippingAddress, TranslationBase.of(context).shippingAddress,
fontSize: 14, fontSize: 14,
@ -190,8 +174,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
fit: BoxFit.scaleDown, fit: BoxFit.scaleDown,
), ),
Container( Container(
padding: padding: EdgeInsets.symmetric(vertical: 0, horizontal: 6),
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
child: Texts( child: Texts(
"${TranslationBase.of(context).shipBy}", "${TranslationBase.of(context).shipBy}",
fontSize: 12, fontSize: 12,
@ -203,9 +186,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
child: Image.asset( child: Image.asset(
model.paymentCheckoutData.shippingOption == null model.paymentCheckoutData.shippingOption == null
? "" ? ""
: model.paymentCheckoutData.shippingOption : model.paymentCheckoutData.shippingOption.shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight"
.shippingRateComputationMethodSystemName ==
"Shipping.FixedOrByWeight"
? "assets/images/pharmacy_module/payment/hmg_shipping_logo.png" ? "assets/images/pharmacy_module/payment/hmg_shipping_logo.png"
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
fit: BoxFit.contain, fit: BoxFit.contain,

@ -39,10 +39,7 @@ class LakumMainPage extends StatelessWidget {
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: (model.lacumGroupInformation != null && child: (model.lacumGroupInformation != null && model.lacumGroupInformation.lakumInquiryInformationObjVersion != null)
model.lacumGroupInformation
.lakumInquiryInformationObjVersion !=
null)
? Column( ? Column(
children: [ children: [
Stack( Stack(
@ -56,10 +53,7 @@ class LakumMainPage extends StatelessWidget {
SizedBox( SizedBox(
height: mediaQuery.size.height * 0.02, height: mediaQuery.size.height * 0.02,
), ),
Container( Container(width: mediaQuery.size.width * 1, child: LakumBannerWidget(model, mediaQuery, true)),
width: mediaQuery.size.width * 1,
child: LakumBannerWidget(
model, mediaQuery, true)),
], ],
) )
], ],
@ -67,20 +61,8 @@ class LakumMainPage extends StatelessWidget {
SizedBox( SizedBox(
width: 8, width: 8,
), ),
LacumPointsWidget( LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear),
2,
TranslationBase.of(context).gained,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model.lacumGroupInformation
.lakumInquiryInformationObjVersion.gainedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPointsAmountPerYear),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
@ -90,38 +72,13 @@ class LakumMainPage extends StatelessWidget {
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
LacumPointsWidget( LacumPointsWidget(mediaQuery, 1, TranslationBase.of(context).balance, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance, null),
1,
TranslationBase.of(context).balance,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalance,
null),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
LacumPointsWidget( LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear),
2,
TranslationBase.of(context).gained,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPointsAmountPerYear),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
@ -129,40 +86,16 @@ class LakumMainPage extends StatelessWidget {
mediaQuery, mediaQuery,
3, 3,
TranslationBase.of(context).consumed, TranslationBase.of(context).consumed,
model model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null
.lacumGroupInformation ? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount)
.lakumInquiryInformationObjVersion
.consumedPointsAmount !=
null
? int.parse(model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount)
: 0, : 0,
model model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints,
.lacumGroupInformation model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear),
.lakumInquiryInformationObjVersion
.consumedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmountPerYear),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
LacumPointsWidget( LacumPointsWidget(mediaQuery, 4, TranslationBase.of(context).transferred, 0, model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPoints,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPointsAmountPerYear),
4,
TranslationBase.of(context).transferred,
0,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPointsAmountPerYear),
], ],
), ),
), ),
@ -170,22 +103,11 @@ class LakumMainPage extends StatelessWidget {
mediaQuery, mediaQuery,
3, 3,
TranslationBase.of(context).consumed, TranslationBase.of(context).consumed,
model model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null
.lacumGroupInformation ? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount)
.lakumInquiryInformationObjVersion
.consumedPointsAmount !=
null
? int.parse(model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount)
: 0, : 0,
model.lacumGroupInformation model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints,
.lakumInquiryInformationObjVersion.consumedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear),
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmountPerYear),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
@ -197,8 +119,7 @@ class LakumMainPage extends StatelessWidget {
), ),
), ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -213,7 +134,7 @@ class LakumMainPage extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
child: Texts( child: Texts(
TranslationBase.of(context).Expired, TranslationBase.of(context).expiryDate,
// "Expired", // "Expired",
fontSize: 14, fontSize: 14,
), ),
@ -234,45 +155,39 @@ class LakumMainPage extends StatelessWidget {
// fontSize: 14, // fontSize: 14,
// ), // ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 8), child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
child: Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Image.asset(
children: [ "assets/images/pharmacy_module/lakum/waiting_gained_icon.png",
Image.asset( fit: BoxFit.fill,
"assets/images/pharmacy_module/lakum/waiting_gained_icon.png", width: 20,
fit: BoxFit.fill, height: 25,
width: 20,
height: 25,
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context)
.Waitinggained,
// "Waiting gained",
fontSize: 14,
),
)
],
),
Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold,
fontSize: 14,
), ),
])), Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context).Waitinggained,
// "Waiting gained",
fontSize: 14,
),
)
],
),
Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold,
fontSize: 14,
),
])),
// Texts( // Texts(
// "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points", // "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points",
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
// fontSize: 14, // fontSize: 14,
// ), // ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -325,11 +240,7 @@ class LakumMainPage extends StatelessWidget {
} }
navigateToLakumRegister(BuildContext context) { navigateToLakumRegister(BuildContext context) {
Navigator.pushReplacement( Navigator.pushReplacement(context, FadePage(page: LakumRegistrationPage(projectViewModel.user.patientIdentificationNo)));
context,
FadePage(
page: LakumRegistrationPage(
projectViewModel.user.patientIdentificationNo)));
} }
} }
@ -339,12 +250,7 @@ List<Widget> _buildAppBarICons(BuildContext context, LacumViewModel model) {
icon: Icon(Icons.settings), icon: Icon(Icons.settings),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(context, FadePage(page: LakumSettingPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData()});
context,
FadePage(
page: LakumSettingPage(
model.lacumInformation, model.lacumGroupInformation)))
.then((result) => {model.getLacumGroupData()});
}, },
), ),
]; ];
@ -366,9 +272,7 @@ class LakumHomeButtons extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
print("Account activate click"); print("Account activate click");
Navigator.push( Navigator.push(context, FadePage(page: LakumActivationVidaPage())).then((result) => {model.getLacumGroupData()});
context, FadePage(page: LakumActivationVidaPage()))
.then((result) => {model.getLacumGroupData()});
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
@ -411,12 +315,7 @@ class LakumHomeButtons extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
print("Lacum transfer click"); print("Lacum transfer click");
Navigator.push( Navigator.push(context, FadePage(page: LacumTransferPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData()});
context,
FadePage(
page: LacumTransferPage(model.lacumInformation,
model.lacumGroupInformation)))
.then((result) => {model.getLacumGroupData()});
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
@ -467,8 +366,7 @@ class LacumPointsWidget extends StatelessWidget {
Color titleColor; Color titleColor;
final List<PointsAmountPerYear> pointsAmountPerYear; final List<PointsAmountPerYear> pointsAmountPerYear;
LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, this.point, this.pointsAmountPerYear) {
this.point, this.pointsAmountPerYear) {
if (pointType == 1) { if (pointType == 1) {
titleColor = Color(0xffefefef); titleColor = Color(0xffefefef);
} else if (pointType == 2) { } else if (pointType == 2) {
@ -486,11 +384,9 @@ class LacumPointsWidget extends StatelessWidget {
onTap: () { onTap: () {
if (pointType != 1) { if (pointType != 1) {
if (pointsAmountPerYear != null && pointsAmountPerYear.length > 0) { if (pointsAmountPerYear != null && pointsAmountPerYear.length > 0) {
Navigator.push(context, Navigator.push(context, FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
} else { } else {
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(context).lakumMsg);
message: TranslationBase.of(context).lakumMsg);
// show snackBar No Details Points are there // show snackBar No Details Points are there
} }
} }

@ -173,7 +173,7 @@ class LacumPointsYearWidget extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Texts(TranslationBase.of(context).RIYAL, Texts(TranslationBase.of(context).sar,
// "RIYAL", // "RIYAL",
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

@ -55,11 +55,11 @@ class _PharmacyPageState extends State<PharmacyPage> {
//crossAxisAlignment: CrossAxisAlignment.start, //crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
BannerPager(model), BannerPager(model),
// GridViewButtons(model),
PrescriptionsWidget(), PrescriptionsWidget(),
ShopByBrandWidget(), // ShopByBrandWidget(),
RecentlyViewedWidget(), RecentlyViewedWidget(),
BestSellerWidget(), BestSellerWidget(),
ShopByBrandWidget(),
], ],
), ),
), ),

@ -1,82 +1,73 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AvailabilityInfo extends StatelessWidget { class AvailabilityInfo extends StatelessWidget {
final ProductDetailViewModel previousModel; final ProductDetailViewModel previousModel;
const AvailabilityInfo({Key key, this.previousModel}) : super(key: key); const AvailabilityInfo({Key key, this.previousModel}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return previousModel.productLocationService.length == 0 return previousModel.productLocationService.length == 0
? Container( ? Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
TranslationBase.of(context).noLocationAvailable, TranslationBase.of(context).noLocationAvailable,
), ),
) )
: ListView.builder( : ListView.builder(
physics: ScrollPhysics(), physics: ScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: previousModel.productLocationService.length, itemCount: previousModel.productLocationService.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Image.network(previousModel child: Image.network(previousModel.productLocationService[index].projectImageUrl),
.productLocationService[index].projectImageUrl), ),
), SizedBox(
SizedBox( width: 10,
width: 10, ),
), Expanded(
Expanded( flex: 4,
flex: 4, child: Text(
child: Text( previousModel.productLocationService[index].locationDescription + "\n" + previousModel.productLocationService[index].cityName.toString(),
previousModel.productLocationService[index] style: TextStyle(fontSize: 12),
.locationDescription +
"\n" +
convertCityName(
previousModel.productLocationService[0].cityName
.toString(),
), ),
style: TextStyle(fontSize: 12), ),
), Expanded(
), flex: 1,
Expanded( child: IconButton(
flex: 1, icon: Icon(Icons.location_on),
child: IconButton( color: Colors.red,
icon: Icon(Icons.location_on), onPressed: () {},
color: Colors.red, ),
onPressed: () {}, ),
), Expanded(
), flex: 1,
Expanded( child: IconButton(
flex: 1, icon: Icon(Icons.phone),
child: IconButton( color: Colors.red,
icon: Icon(Icons.phone), onPressed: () {},
color: Colors.red, ),
onPressed: () {}, ),
],
), ),
), Divider(height: 1.2, color: Colors.grey)
], ],
), ),
Divider(height: 1.2, color: Colors.grey) );
], },
), );
);
},
);
} }
convertCityName(txt) { convertCityName(txt) {

@ -206,11 +206,15 @@ class _FooterWidgetState extends State<FooterWidget> {
WELCOME_LOGIN, WELCOME_LOGIN,
); );
} else { } else {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
Navigator.push( Navigator.of(context).pushNamed(
context, CART_ORDER_PAGE,
FadePage(page: CartOrderPage()), );
);} // Navigator.push(
// context,
// FadePage(page: CartOrderPage()),
// );
}
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderColor: Colors.grey[800], borderColor: Colors.grey[800],
@ -224,7 +228,6 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
], ],
), ),
); );
} }

@ -317,7 +317,9 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
} }
addToShoppingCartFunction({quantity, itemID, ProductDetailViewModel model}) async { addToShoppingCartFunction({quantity, itemID, ProductDetailViewModel model}) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.addToCartData(quantity, itemID); await model.addToCartData(quantity, itemID);
GifLoaderDialogUtils.hideDialog(context);
} }
addToWishlistFunction({itemID, ProductDetailViewModel model}) async { addToWishlistFunction({itemID, ProductDetailViewModel model}) async {

@ -3,19 +3,19 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/Prescription
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_items_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class PrescriptionsWidget extends StatelessWidget { class PrescriptionsWidget extends StatelessWidget {
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,14 +36,25 @@ class PrescriptionsWidget extends StatelessWidget {
ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()), ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()),
Container( Container(
margin: EdgeInsets.only(right: 10.0, left: 10.0), margin: EdgeInsets.only(right: 10.0, left: 10.0),
height: MediaQuery.of(context).size.height * 0.18, height: MediaQuery.of(context).size.height * 0.19,
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
itemCount: model.prescriptionsList.length, itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: model.prescriptionsList[index],
),
),
);
},
child: Container(
padding: EdgeInsets.only(left: 8.0, right: 8.0), padding: EdgeInsets.only(left: 8.0, right: 8.0),
margin: EdgeInsets.only(right: 5.0, left: 5.0), margin: EdgeInsets.only(right: 5.0, left: 5.0),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -57,29 +68,26 @@ class PrescriptionsWidget extends StatelessWidget {
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
Column(children: [ Container(
Container( padding: EdgeInsets.only(
padding: EdgeInsets.only( top: 10.0,
top: 10.0, left: 10.0,
left: 10.0, right: 10.0,
right: 10.0, bottom: 10.0,
bottom: 10.0, ),
), child: CircleAvatar(
child: CircleAvatar( radius: 30,
radius: 30, backgroundColor: Colors.transparent,
backgroundColor: Colors.transparent, child: Image.network(
child: Image.network( model.prescriptionsList[index].doctorImageURL,
model.prescriptionsList[index].doctorImageURL, width: 50,
width: 60, height: 50,
height: 60,
),
), ),
), ),
]), ),
Column( Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 1),
padding: EdgeInsets.only(left: 15.0, right: 15.0), padding: EdgeInsets.only(left: 15.0, right: 15.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
@ -116,77 +124,71 @@ class PrescriptionsWidget extends StatelessWidget {
), ),
], ],
), ),
Row( Container(
crossAxisAlignment: CrossAxisAlignment.start, margin: EdgeInsets.only(left: 5),
children: <Widget>[ child: Row(children: <Widget>[
Container( Text(
margin: EdgeInsets.only(left: 5), model.prescriptionsList[index].doctorTitle.toString(),
child: Row(children: <Widget>[ style: TextStyle(
Text( color: Colors.black,
model.prescriptionsList[index].doctorTitle.toString(), fontSize: 15.0,
style: TextStyle( fontWeight: FontWeight.bold,
color: Colors.black, ),
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
Text(
model.prescriptionsList[index].doctorName.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
]),
), ),
], Text(
), model.prescriptionsList[index].doctorName.toString(),
Row( style: TextStyle(
crossAxisAlignment: CrossAxisAlignment.start, color: Colors.black,
children: <Widget>[ fontSize: 15.0,
Container( fontWeight: FontWeight.bold,
margin: EdgeInsets.only(left: 5),
child: Text(
model.prescriptionsList[index].clinicDescription.toString(),
style: TextStyle(
color: Colors.green,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
),
), ),
), ),
], ]),
), ),
Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Container(
margin: EdgeInsets.only(left: 5),
child: Text(
model.prescriptionsList[index].clinicDescription.toString(),
style: TextStyle(
color: Colors.green,
fontSize: 15.0,
),
),
),
Row(children: <Widget>[
Container( Container(
margin: EdgeInsets.only(left: 5), margin: EdgeInsets.only(left: 5),
child: Align( child: RatingBar.readOnly(
alignment: Alignment.topLeft, initialRating: model.prescriptionsList[index].actualDoctorRate.toDouble(),
child: RatingBar.readOnly( size: 15.0,
initialRating: model.prescriptionsList[index].actualDoctorRate.toDouble(), filledColor: Colors.yellow[700],
// initialRating: productRate, emptyColor: Colors.grey[500],
size: 15.0, isHalfAllowed: true,
filledColor: Colors.yellow[700], halfFilledIcon: Icons.star_half,
emptyColor: Colors.grey[500], filledIcon: Icons.star,
isHalfAllowed: true, emptyIcon: Icons.star,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
), ),
) ),
SizedBox(
width: 130.0,
),
Container(
child: Icon(
Icons.arrow_forward,
color: Theme.of(context).primaryColor,
)),
]), ]),
]), ]),
); ),
}), );
},
),
), ),
], ],
), ),
), ),
) )
: Container( : Container(),
),
); );
} }
} }

@ -125,7 +125,7 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).IDENTIFICATION, Texts(TranslationBase.of(context).identificationNumber,
// "IDENTIFICATION #", // "IDENTIFICATION #",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

File diff suppressed because it is too large Load Diff

@ -14,8 +14,8 @@ import 'package:diplomaticquarterapp/pages/login/register-info.dart';
import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/pages/login/register.dart';
import 'package:diplomaticquarterapp/pages/login/welcome.dart'; import 'package:diplomaticquarterapp/pages/login/welcome.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesCartPage.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesCartPage.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesPage.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/PackageOrderCompletedPage.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/PackageOrderCompletedPage.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/settings/settings.dart'; import 'package:diplomaticquarterapp/pages/settings/settings.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart';
@ -47,6 +47,7 @@ const String PACKAGES_OFFERS_CART = 'packages-offers-cart';
const String PACKAGES_ORDER_COMPLETED = 'packages-offers-cart'; const String PACKAGES_ORDER_COMPLETED = 'packages-offers-cart';
const String TEST_PAGE = 'test-page'; const String TEST_PAGE = 'test-page';
const String OPENTOK_CALL_PAGE = 'OPENTOK_CALL_PAGE'; const String OPENTOK_CALL_PAGE = 'OPENTOK_CALL_PAGE';
const String CART_ORDER_PAGE = 'cart-order-page';
const String HEALTH_WEATHER = 'health-weather'; const String HEALTH_WEATHER = 'health-weather';
const APP_UPDATE = 'app-update'; const APP_UPDATE = 'app-update';
@ -74,9 +75,10 @@ var routes = {
HEALTH_WEATHER: (_) => HealthWeatherIndicator(), HEALTH_WEATHER: (_) => HealthWeatherIndicator(),
APP_UPDATE: (_) => AppUpdatePage(), APP_UPDATE: (_) => AppUpdatePage(),
SETTINGS: (_) => Settings(), SETTINGS: (_) => Settings(),
CART_ORDER_PAGE: (_) => CartOrderPage(),
OPENTOK_CALL_PAGE: (_) => OpenTokConnectCallPage( OPENTOK_CALL_PAGE: (_) => OpenTokConnectCallPage(
apiKey: '46209962', apiKey: '46209962',
sessionId: '1_MX40NjIwOTk2Mn5-MTYzNDY0ODM3NDY2Nn5PcnpnNGM0R1Q3ODZ6UXlFQ01lMDF5YWJ-fg', sessionId: '1_MX40NjIwOTk2Mn5-MTYzNDY0ODM3NDY2Nn5PcnpnNGM0R1Q3ODZ6UXlFQ01lMDF5YWJ-fg',
token: 'T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9Y2ZhZjMzZjA3MWFkMjkxN2JmYjEwZDkxYTRkOTdhN2NmNWE4YjMyYTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWXpORFkwT0RNM05EWTJObjVQY25wbk5HTTBSMVEzT0RaNlVYbEZRMDFsTURGNVlXSi1mZyZjcmVhdGVfdGltZT0xNjM0NjQ4Mzc1Jm5vbmNlPTAuNzczMzcxNDUxMDgzMjQyMyZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjM0NzM0Nzc1JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9' token:
), 'T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9Y2ZhZjMzZjA3MWFkMjkxN2JmYjEwZDkxYTRkOTdhN2NmNWE4YjMyYTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWXpORFkwT0RNM05EWTJObjVQY25wbk5HTTBSMVEzT0RaNlVYbEZRMDFsTURGNVlXSi1mZyZjcmVhdGVfdGltZT0xNjM0NjQ4Mzc1Jm5vbmNlPTAuNzczMzcxNDUxMDgzMjQyMyZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjM0NzM0Nzc1JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9'),
}; };

@ -1421,6 +1421,7 @@ class TranslationBase {
String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode]; String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode];
String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode]; String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode];
String get offerAndPackagesDetails => localizedValues['offerAndPackagesDetails'][locale.languageCode]; String get offerAndPackagesDetails => localizedValues['offerAndPackagesDetails'][locale.languageCode];
String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode];
@ -2608,6 +2609,7 @@ class TranslationBase {
String get laserClinic => localizedValues["laserClinic"][locale.languageCode]; String get laserClinic => localizedValues["laserClinic"][locale.languageCode];
String get noImage => localizedValues["noImage"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/pages/search_products_page.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -493,7 +494,8 @@ class AppBarWidgetState extends State<AppBarWidget> {
icon: Badge(badgeContent: Text(orderPreviewViewModel.cartResponse.quantityCount.toString()), child: Icon(Icons.shopping_cart)), icon: Badge(badgeContent: Text(orderPreviewViewModel.cartResponse.quantityCount.toString()), child: Icon(Icons.shopping_cart)),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.of(context).popUntil(ModalRoute.withName('/')); // Navigator.of(context).popUntil(ModalRoute.withName('/'));
Navigator.of(context).popAndPushNamed(CART_ORDER_PAGE);
}) })
: Container(), : Container(),
(widget.isOfferPackages && widget.showOfferPackagesCart) (widget.isOfferPackages && widget.showOfferPackagesCart)

@ -96,7 +96,7 @@ class BottomNavPharmacyItem extends StatelessWidget {
fontWeight: currentIndex == index fontWeight: currentIndex == index
? FontWeight.normal ? FontWeight.normal
: FontWeight.w400, : FontWeight.w400,
fontSize: currentIndex == index ? 13 : 11, fontSize: currentIndex == index ? 11 : 9,
), ),
], ],
), ),

Loading…
Cancel
Save