Merge branch 'development_new_design_2.0' into Fatima-New-Design

# Conflicts:
#	lib/pages/pharmacies/product-brands.dart
#	lib/pages/pharmacies/screens/lakum-main-page.dart
merge-update-with-lab-changes
Fatimah Alshammari 4 years ago
commit 28678633e7

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -325,6 +325,7 @@ const GET_COVID_DRIVETHRU_PROCEDURES_LIST = 'Services/Doctors.svc/REST/COVID19_G
///Smartwatch Integration Services ///Smartwatch Integration Services
const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord';
const INSERT_PATIENT_HEALTH_DATA = 'Services/Patients.svc/REST/Med_InsertTransactions';
///My Trackers ///My Trackers
const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';

@ -1618,9 +1618,11 @@ const Map localizedValues = {
"android-instructions-2": { "en": "Make sure that you have installed your watch related apps from Google PlayStore.", "ar": "تأكد من أنك قمت بتثبيت التطبيقات المتعلقة بالساعات من Google PlayStore." }, "android-instructions-2": { "en": "Make sure that you have installed your watch related apps from Google PlayStore.", "ar": "تأكد من أنك قمت بتثبيت التطبيقات المتعلقة بالساعات من Google PlayStore." },
"android-instructions-3": { "en": "Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", "ar": "تأكد من أن ساعتك الذكية متصلة بتطبيق WearOS وتطبيقات ساعتك." }, "android-instructions-3": { "en": "Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", "ar": "تأكد من أن ساعتك الذكية متصلة بتطبيق WearOS وتطبيقات ساعتك." },
"android-instructions-4": { "en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit." }, "android-instructions-5": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة." }, "android-instructions-4": { "en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit." }, "android-instructions-5": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة." },
"tamaraInstPlan" : { "en": "Select the tamara installment plan", "ar": "حدد خطة تقسيط تمارة" },
"onlineTag": {"en": "Online", "ar": "متصل"}, "onlineTag": {"en": "Online", "ar": "متصل"},
"offlineTag": {"en": "Offline", "ar": "غير متصل"}, "offlineTag": {"en": "Offline", "ar": "غير متصل"},
"viewDocList": {"en": "View List of Doctors", "ar": "عرض قائمة الأطباء"}, "viewDocList": {"en": "View List of Doctors", "ar": "عرض قائمة الأطباء"},
"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": "عيادة الليزر"},
}; };

@ -26,6 +26,7 @@ class COCItem {
String status; String status;
String statusAr; String statusAr;
dynamic statusEn; dynamic statusEn;
int statusId;
COCItem({ COCItem({
this.appointment, this.appointment,
@ -55,6 +56,7 @@ class COCItem {
this.status, this.status,
this.statusAr, this.statusAr,
this.statusEn, this.statusEn,
this.statusId,
}); });
COCItem.fromJson(Map<String, dynamic> json) { COCItem.fromJson(Map<String, dynamic> json) {
@ -85,6 +87,7 @@ class COCItem {
status = json['Status']; status = json['Status'];
statusAr = json['StatusAr']; statusAr = json['StatusAr'];
statusEn = json['StatusEn']; statusEn = json['StatusEn'];
statusId = json['StatusId'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {

@ -25,9 +25,9 @@ class PrescriptionDeliveryService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['latitude'] = latitude; body['latitude'] = latitude;
body['longitude'] = longitude; body['longitude'] = longitude;
body['AppointmentNo'] = appointmentNo; body['AppointmentNo'] = appointmentNo.toString();
body['CreatedBy'] = createdBy; // body['CreatedBy'] = createdBy;
body['DischargeID'] = dischargeID; body['DischargeID'] = dischargeID.toString();
await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {
var asd = ""; var asd = "";
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
@ -16,8 +17,9 @@ import 'package:flutter/cupertino.dart';
class PrescriptionsService extends BaseService { class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List(); List<Prescriptions> prescriptionsList = List();
List<PrescriptionReportINP> prescriptionReportListINP = List(); List<PrescriptionReportINP> prescriptionReportListINP = List();
List<PrescriptionsOrder> prescriptionsOrderList = List(); List<GetCMCAllOrdersResponseModel> prescriptionsOrderList = List();
var isMedDeliveryAllowed; var isMedDeliveryAllowed;
Future getPrescriptions() async { Future getPrescriptions() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -36,10 +38,24 @@ class PrescriptionsService extends BaseService {
Future getPrescriptionsOrders() async { Future getPrescriptionsOrders() async {
prescriptionsOrderList.clear(); prescriptionsOrderList.clear();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; // body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) {
response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) { response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) {
prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder)); // prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPrescriptionsOrdersRC() async {
prescriptionsOrderList.clear();
Map<String, dynamic> body = Map();
// body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_ALL_PRESCRIPTION_ORDERS_RC, onSuccess: (dynamic response, int statusCode) {
response['response'].forEach((prescriptionsOrder) {
prescriptionsOrderList.add(GetCMCAllOrdersResponseModel.fromJson(prescriptionsOrder));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -147,6 +147,18 @@ class OffersAndPackagesServices extends BaseService {
var finished = 0; var finished = 0;
var totalCalls = 3; var totalCalls = 3;
completedAll(){
finished++;
if(completion != null && finished == totalCalls) {
_hideLoading(context, showLoading);
completion();
}
}
_showLoading(context, showLoading);
final auth_token = await baseAppClient.generatePackagesToken(); final auth_token = await baseAppClient.generatePackagesToken();
if(auth_token == null){ if(auth_token == null){
throw 'Something went wrong while authentication, Please try again letter'; throw 'Something went wrong while authentication, Please try again letter';
@ -162,18 +174,6 @@ class OffersAndPackagesServices extends BaseService {
} }
} }
completedAll(){
finished++;
if(completion != null && finished == totalCalls) {
_hideLoading(context, showLoading);
completion();
}
}
_showLoading(context, showLoading);
// Performing Parallel Request on same time // Performing Parallel Request on same time
// # 1 // # 1
getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){ getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){
@ -283,7 +283,7 @@ class OffersAndPackagesServices extends BaseService {
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
var jsonCartItem = jsonResponse["shopping_carts"][0]; var jsonCartItem = jsonResponse["shopping_carts"][0];
response = ResponseModel(status: true, data: PackagesCartItemsResponseModel.fromJson(jsonCartItem), error: null); response = ResponseModel(status: true, data: PackagesCartItemsResponseModel.fromJson(jsonCartItem), error: null);
cartItemCount = response.data.quantity.toString(); cartItemCount = (jsonResponse['count'] ?? 0).toString();
}, onFailure: (String error, int statusCode){ }, onFailure: (String error, int statusCode){
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
@ -334,19 +334,18 @@ class OffersAndPackagesServices extends BaseService {
// -------------------- // --------------------
// Place Order // Place Order
// -------------------- // --------------------
Future placeOrder({@required Map paymentParams, @required BuildContext context, bool showLoading = true}) async{ Future placeOrder({@required Map<dynamic,dynamic> paymentParams, @required BuildContext context, bool showLoading = true}) async{
Future errorThrow; Future errorThrow;
var jsonBody = <String,dynamic>{ Map<dynamic,dynamic> jsonBody = {
"order": { "customer_id" : customer.id,
"customer_id" : customer.id, "billing_address": {
"billing_address": { "email": patientUser.emailAddress,
"email": patientUser.emailAddress, "phone_number": patientUser.mobileNumber
"phone_number": patientUser.mobileNumber },
},
}
}; };
jsonBody.addAll(paymentParams); jsonBody.addAll(paymentParams);
jsonBody = {'order' : jsonBody};
int order_id; int order_id;
_showLoading(context, showLoading); _showLoading(context, showLoading);

@ -144,12 +144,12 @@ class OrderPreviewService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future getLacumAccountInformation() async { Future getLacumAccountInformation(String identificationNo) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = identificationNo;
try { try {
await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION,
@ -164,12 +164,12 @@ class OrderPreviewService extends BaseService {
} }
} }
Future getLacumGroupInformation() async { Future getLacumGroupInformation(String identificationNo) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = identificationNo;
body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}";
try { try {

@ -0,0 +1,17 @@
import 'package:flutter/cupertino.dart';
class PharmacyPagesViewModel with ChangeNotifier {
int currentTab = 0;
PageController pageController;
PharmacyPagesViewModel() {
pageController = PageController(keepPage: true);
}
changeCurrentTab(int tab) {
if (pageController.hasClients) {
currentTab = tab;
pageController.jumpToPage(tab);
notifyListeners();
}
}
}

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
@ -26,7 +27,7 @@ class PrescriptionsViewModel extends BaseViewModel {
List<Prescriptions> get prescriptionsList => _prescriptionsService.prescriptionsList; List<Prescriptions> get prescriptionsList => _prescriptionsService.prescriptionsList;
List<PrescriptionsOrder> get prescriptionsHistory => _prescriptionsService.prescriptionsOrderList; List<GetCMCAllOrdersResponseModel> get prescriptionsHistory => _prescriptionsService.prescriptionsOrderList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
@ -79,7 +80,8 @@ class PrescriptionsViewModel extends BaseViewModel {
getPrescriptionsOrders({bool showLoading = false}) async { getPrescriptionsOrders({bool showLoading = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
Future.delayed(new Duration(milliseconds: 300)).then((value) async { Future.delayed(new Duration(milliseconds: 300)).then((value) async {
await _prescriptionsService.getPrescriptionsOrders(); // await _prescriptionsService.getPrescriptionsOrders();
await _prescriptionsService.getPrescriptionsOrdersRC();
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -31,6 +31,11 @@ class OrderPreviewViewModel extends BaseViewModel {
PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData(); PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData();
double totalAdditionalShippingCharge = 0; double totalAdditionalShippingCharge = 0;
setShoppingCartResponse(ShoppingCartResponse cart){
cartResponse = cart;
notifyListeners();
}
Future getOrderPreviewData() async { Future getOrderPreviewData() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getAddresses(); await _orderService.getAddresses();
@ -156,25 +161,25 @@ class OrderPreviewViewModel extends BaseViewModel {
return _orderService.getPaymentOptionName(paymentOption); return _orderService.getPaymentOptionName(paymentOption);
} }
getInformationsByAddress() async { getInformationsByAddress(String identificationNo) async {
await getLacumAccountInformation();
await getShippingOption(); await getShippingOption();
await getLacumAccountInformation(identificationNo);
} }
getLacumAccountInformation() async { getLacumAccountInformation(String identificationNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getLacumAccountInformation(); await _orderService.getLacumAccountInformation(identificationNo);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
getLacumGroupData(); getLacumGroupData(identificationNo);
} }
} }
Future getLacumGroupData() async { Future getLacumGroupData(String identificationNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getLacumGroupInformation(); await _orderService.getLacumGroupInformation(identificationNo);
paymentCheckoutData.lacumInformation = _orderService.lacumGroupInformation; paymentCheckoutData.lacumInformation = _orderService.lacumGroupInformation;
paymentCheckoutData.usedLakumPoints = paymentCheckoutData paymentCheckoutData.usedLakumPoints = paymentCheckoutData
.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount; .lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount;

@ -1,13 +1,17 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/product_detail_service.dart';
import 'package:diplomaticquarterapp/models/pharmacy/specification.dart'; import 'package:diplomaticquarterapp/models/pharmacy/specification.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/product_detail_service.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../locator.dart'; import '../../../locator.dart';
@ -61,12 +65,39 @@ class ProductDetailViewModel extends BaseViewModel{
Future addToCartData(quantity, itemID) async { Future addToCartData(quantity, itemID) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _productDetailService.addToCart(quantity, itemID); var resp = await _productDetailService.addToCart(quantity, itemID);
ShoppingCartResponse object = _handleGetShoppingCartResponse(resp);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {
error = _productDetailService.error; error = _productDetailService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else {
setState(ViewState.Idle); setState(ViewState.Idle);
Provider.of<OrderPreviewViewModel>(locator<NavigationService>().navigatorKey.currentContext, listen: false)
.setShoppingCartResponse( object);
}
}
ShoppingCartResponse _handleGetShoppingCartResponse(Map res) {
ShoppingCartResponse cartResponse = ShoppingCartResponse();
if (res == null) {
error = "response is null";
setState(ViewState.Error);
return null;
}
print(res);
cartResponse.itemCount = res["item_count"];
cartResponse.quantityCount = res["quantity_count"];
cartResponse.subtotal = res["subtotal"];
cartResponse.subtotalWithVat = res["subtotal_with_vat"];
cartResponse.subtotalVatAmount = res["subtotal_vat_amount"];
cartResponse.subtotalVatRate = res["subtotal_vat_rate"];
cartResponse.shoppingCarts = List();
res["shopping_carts"].forEach((item) {
ShoppingCart shoppingCart = ShoppingCart.fromJson(item);
cartResponse.shoppingCarts.add(shoppingCart);
});
return cartResponse;
} }
Future addToWishlistData(itemID) async { Future addToWishlistData(itemID) async {

@ -1,5 +1,4 @@
import 'dart:io'; import 'package:diplomaticquarterapp/core/viewModels/PharmacyPagesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
@ -84,6 +83,9 @@ class _MyApp extends State<MyApp> {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
return MultiProvider( return MultiProvider(
providers: [ providers: [
ChangeNotifierProvider<PharmacyPagesViewModel>(
create: (context) => PharmacyPagesViewModel(),
),
ChangeNotifierProvider<ProjectViewModel>( ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(), create: (context) => ProjectViewModel(),
), ),

@ -1,8 +1,37 @@
class healthData { class healthData {
int MedCategoryID; int MedCategoryID;
int MedSubCategoryID; int MedSubCategoryID;
String Value;
String Notes;
String MachineDate; String MachineDate;
double Value;
int TransactionsListID; int TransactionsListID;
String Notes;
healthData({
this.MedCategoryID,
this.MedSubCategoryID,
this.MachineDate,
this.Value,
this.TransactionsListID,
this.Notes,
});
healthData.fromJson(Map<String, dynamic> json) {
MedCategoryID = json['MedCategoryID'];
MedSubCategoryID = json['MedSubCategoryID'];
MachineDate = json['MachineDate'];
Value = json['Value'];
TransactionsListID = json['TransactionsListID'];
Notes = json['Notes'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['MedCategoryID'] = this.MedCategoryID;
data['MedSubCategoryID'] = this.MedSubCategoryID;
data['MachineDate'] = this.MachineDate;
data['Value'] = this.Value;
data['TransactionsListID'] = this.TransactionsListID;
data['Notes'] = this.Notes;
return data;
}
} }

@ -223,8 +223,6 @@ class _AllHabibMedicalSevicePage2State extends State<AllHabibMedicalSevicePage2>
var data = await this.sharedPref.getObject(WEATHER); var data = await this.sharedPref.getObject(WEATHER);
if (data == null) { if (data == null) {
var d = await _weatherService.getWeatherData(); var d = await _weatherService.getWeatherData();
print(d);
weatherNum = d.temperature; weatherNum = d.temperature;
setState(() { setState(() {
weather = d != null ? d.temperature.toString() + '\u2103' : '--'; weather = d != null ? d.temperature.toString() + '\u2103' : '--';

@ -6,7 +6,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class H2OPageIndexPage extends StatelessWidget { class H2OPageIndexPage extends StatelessWidget {
@override @override
@ -23,7 +22,7 @@ class H2OPageIndexPage extends StatelessWidget {
"Water Tracker:", "Water Tracker:",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 25, fontSize: 25,
color: HexColor("#60686b"), color: Color(0xFF60686b),
), ),
SizedBox( SizedBox(
height: 12, height: 12,

@ -3,8 +3,6 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_v
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart';
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';

@ -11,8 +11,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:wave/config.dart'; import 'package:wave/config.dart';
import 'package:wave/wave.dart'; import 'package:wave/wave.dart';

@ -27,6 +27,8 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
LocationUtils locationUtils; LocationUtils locationUtils;
var weather = '--'; var weather = '--';
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
@ -37,7 +39,7 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<WeatherViewModel>( return BaseView<WeatherViewModel>(
onModelReady: (model) => model.getWeatherData(), onModelReady: (model) => model.getWeatherData(),
allowAny: true, allowAny: true,
@ -131,7 +133,7 @@ class _HospitalsPageState extends State<HealthWeatherIndicator> {
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: Column( child: Column(
children: mode.weatherIndicatorData.map((data) { children: mode.weatherIndicatorData.map((data) {
return WeatherSlider(data); return WeatherSlider(data, projectViewModel);
}).toList())) }).toList()))
])) ]))
: Center(child: AppCircularProgressIndicator())), : Center(child: AppCircularProgressIndicator())),

@ -2,8 +2,6 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
//import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
@ -20,10 +18,10 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/show_zoom_image_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:giffy_dialog/giffy_dialog.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
@ -74,14 +72,38 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
super.initState(); super.initState();
} }
int getSelectedCityID(MyBalanceViewModel model) {
int cityID = 1;
model.CitiesModelList.forEach((element) {
if (element.description == model.bloodModelList[0].city) {
cityID = element.iD;
}
});
return cityID;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getCities(); model.getCities().then((value) {
model.getBlood(); model.getBlood().then((value) {
if (model.bloodModelList.length > 0) {
CitiesModel citiesModel = new CitiesModel();
citiesModel.iD = getSelectedCityID(model);
_selectedHospitalIndex = (citiesModel.iD - 1);
citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
_selectedHospital = citiesModel;
} else {
_selectedHospital = model.CitiesModelList[0];
}
});
});
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -89,6 +111,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
backgroundColor: Color(0xffF7F7F7), backgroundColor: Color(0xffF7F7F7),
showNewAppBarTitle: true, showNewAppBarTitle: true,
baseViewModel: model, baseViewModel: model,
isShowDecPage: true,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
description: TranslationBase.of(context).bloodDonationInfo, description: TranslationBase.of(context).bloodDonationInfo,
appBarTitle: TranslationBase.of(context).bloodD, appBarTitle: TranslationBase.of(context).bloodD,
@ -106,31 +129,32 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
), ),
SizedBox(height: 12), SizedBox(height: 12),
CommonDropDownView( if (projectProvider.isLogin && model.state != ViewState.Busy)
TranslationBase.of(context).city, CommonDropDownView(
model.bloodModelList.isNotEmpty TranslationBase.of(context).city,
? model.bloodModelList[0].city // (model.bloodModelList.isNotEmpty && model.CitiesModelList.isNotEmpty)
: projectProvider.isArabic // ? model.bloodModelList[0].city
? model.CitiesModelList[_selectedHospitalIndex].descriptionN // :
: model.CitiesModelList[_selectedHospitalIndex].description, () { 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),
]; ];
showDialog( showDialog(
context: context, context: context,
child: RadioSelectionDialog( child: RadioSelectionDialog(
listData: list, listData: list,
selectedIndex: _selectedHospitalIndex, selectedIndex: _selectedHospitalIndex,
isScrollable: true, isScrollable: true,
onValueSelected: (index) { onValueSelected: (index) {
_selectedHospitalIndex = index; _selectedHospitalIndex = index;
_selectedHospital = model.CitiesModelList[index]; _selectedHospital = model.CitiesModelList[index];
}, setState(() {});
), },
); ),
}).withBorderedContainer, );
}).withBorderedContainer,
SizedBox(height: 12), SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () { CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
@ -226,19 +250,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
width: 350, width: 350,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
showDialog( showZoomImageDialog(context, 'assets/images/BloodChrt_EN.png', isNetworkImage: false);
context: context,
builder: (_) => AssetGiffyDialog(
title: Text(
"",
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
),
image: Image.asset('assets/images/BloodChrt_EN.png'),
buttonCancelText: Text(TranslationBase.of(context).cancel),
buttonCancelColor: Colors.grey,
onlyCancelButton: true,
),
);
}, },
child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white), child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white),
), ),
@ -261,7 +273,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
return; return;
} }
bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; bloodDetails.city = _selectedHospital.description;
bloodDetails.cityCode = _selectedHospital.iD.toString(); bloodDetails.cityCode = _selectedHospital.iD.toString();
bloodDetails.gender = _selectedGenderIndex; bloodDetails.gender = _selectedGenderIndex;
bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex); bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex);

@ -0,0 +1,15 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class LaserBooking extends StatefulWidget {
@override
_LaserBookingState createState() => _LaserBookingState();
}
class _LaserBookingState extends State<LaserBooking> {
@override
Widget build(BuildContext context) {
return AppScaffold(isShowDecPage: false, isShowAppBar: true, showNewAppBarTitle: true, showNewAppBar: true, appBarTitle: TranslationBase.of(context).laserClinic, body: Container());
}
}

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/LaserBooking.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -176,9 +177,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
), ),
], ],
), ),
Container(
Container(child: inputWidget("Age", "", ageController),margin: EdgeInsets.only(left: 20, right: 20),), child: inputWidget("Age", "", ageController),
margin: EdgeInsets.only(left: 20, right: 20),
),
], ],
), ),
Padding( Padding(
@ -421,15 +423,15 @@ class _SearchByClinicState extends State<SearchByClinic> {
prefixIcon: prefix == null prefixIcon: prefix == null
? null ? null
: Text( : Text(
"+" + prefix, "+" + prefix,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
height: 21 / 14, height: 21 / 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xff2E303A), color: Color(0xff2E303A),
letterSpacing: -0.56, letterSpacing: -0.56,
), ),
), ),
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
border: InputBorder.none, border: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
@ -446,7 +448,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
); );
} }
void openDropdown(GlobalKey key) { void openDropdown(GlobalKey key) {
GestureDetector detector; GestureDetector detector;
void searchForGestureDetector(BuildContext element) { void searchForGestureDetector(BuildContext element) {
@ -537,6 +538,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
searchInfo.date = DateTime.now(); searchInfo.date = DateTime.now();
navigateToDentalComplaints(context, searchInfo); navigateToDentalComplaints(context, searchInfo);
} else if (dropdownValue.split("-")[0] == "253") {
navigateToLaserClinic(context);
// callDoctorsSearchAPI();
} else if (dropdownValue.split("-")[1] == "true" } else if (dropdownValue.split("-")[1] == "true"
// && authProvider.isLogin && // && authProvider.isLogin &&
// authUser.patientType == 1 // authUser.patientType == 1
@ -625,6 +629,19 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
} }
Future navigateToLaserClinic(BuildContext context) async {
Navigator.push(
context,
FadePage(
page: LaserBooking(),
),
).then((value) {
setState(() {
dropdownValue = null;
});
});
}
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async { Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
isProjectLoaded = false; isProjectLoaded = false;
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))) Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))

@ -1,10 +1,7 @@
import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/hospital_location.dart'; import 'package:diplomaticquarterapp/widgets/hospital_location.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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'; import 'package:url_launcher/url_launcher.dart';
class HospitalsPage extends StatefulWidget { class HospitalsPage extends StatefulWidget {

@ -10,7 +10,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
import 'widgets/card_position.dart';
class NearestEr extends StatefulWidget { class NearestEr extends StatefulWidget {
static const String _url = "assets/images/"; static const String _url = "assets/images/";

@ -1,61 +0,0 @@
import 'package:flutter/material.dart';
class CardCommonEr extends StatelessWidget {
final image;
final text;
final subText;
final bool locked;
final Function onTap;
const CardCommonEr({
this.locked = false,
@required this.image,
@required this.text,
@required this.subText,
@required this.onTap,
});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: locked ? null : onTap,
child: Opacity(
opacity: locked ? 0.25 : 1.0,
child: Stack(
children: [
Container(
width: double.infinity,
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>[
Image.asset(this.image, width: 42.0, height: 42.0),
Text(
text + "${subText.isEmpty ? "" : "\n$subText"}",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),
),
],
),
),
if (locked) Align(alignment: Alignment.center, child: lock())
],
),
),
);
}
Widget lock() {
return Container(
child: Icon(Icons.lock_rounded, size: 80),
);
}
}

@ -1,106 +0,0 @@
//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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';
class CardPosition extends StatelessWidget {
final image;
final text;
final subText;
final type;
final telephone;
final networkImage;
final latitude;
final longitude;
final projectname;
final cardSize;
final String waitingTime;
const CardPosition({
@required this.image,
@required this.text,
@required this.subText,
@required this.type,
@required this.telephone,
@required this.networkImage,
@required this.latitude,
@required this.longitude,
@required this.projectname,
@required this.cardSize,
@required this.waitingTime,
});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
navigateToSearch(context, this.type, this.telephone, this.networkImage, this.latitude, this.longitude, this.projectname);
},
child: Container(
// width:MediaQuery.of(context).size.width * 0.47,//165,
margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 8.0),
decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
height: cardSize * 0.2 - 8,
margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0),
child: Text(this.text, overflow: TextOverflow.clip, style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 2 * SizeConfig.textMultiplier)),
),
Container(
height: cardSize * 0.5 - 8,
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(0.0, 0.0, 8.0, 8.0),
child: Image.asset(this.image, width: 60.0, height: cardSize * 0.4),
),
Container(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
height: cardSize * 0.2 - 8,
child: Text(this.subText, overflow: TextOverflow.clip, style: TextStyle(color: Color(0xFFc5272d), letterSpacing: 1.0, fontSize: 15.0)),
),
],
),
),
);
}
Future navigateToSearch(context, type, telephone, networkImage, latitude, longitude, projectname) async {
var localize = TranslationBase.of(context);
showDialog(
context: context,
builder: (_) => AssetGiffyDialog(
entryAnimation: EntryAnimation.BOTTOM,
image: Image.network(
networkImage,
fit: BoxFit.cover,
),
title: Text(
projectname,
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
),
description: Text(
"${localize.averageWaitingTime}\n\n$waitingTime ${localize.minute}",
textAlign: TextAlign.center,
),
buttonOkText: Text(
"LOCATION",
style: TextStyle(color: Colors.white),
),
buttonOkColor: Colors.grey,
buttonCancelText: Text(
'CAll',
style: TextStyle(color: Colors.white),
),
buttonCancelColor: Colors.grey,
onOkButtonPressed: () {
MapsLauncher.launchCoordinates(double.parse(latitude), double.parse(longitude), projectname);
},
onCancelButtonPressed: () {
launch("tel://" + telephone);
}));
}
}

@ -408,6 +408,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
prescriptions.actualDoctorRate = widget.appo.actualDoctorRate; prescriptions.actualDoctorRate = widget.appo.actualDoctorRate;
prescriptions.noOfPatientsRate = widget.appo.noOfPatientsRate; prescriptions.noOfPatientsRate = widget.appo.noOfPatientsRate;
prescriptions.isInOutPatient = widget.appo.isInOutPatient; prescriptions.isInOutPatient = widget.appo.isInOutPatient;
prescriptions.doctorID = widget.appo.doctorID;
navigateToMedicinePrescriptionReport(prescriptions); navigateToMedicinePrescriptionReport(prescriptions);
} }

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback-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/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
@ -28,10 +29,10 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
TextEditingController complainNumberController = TextEditingController(); TextEditingController complainNumberController = TextEditingController();
StatusType statusType = StatusType.ComplaintNumber; StatusType statusType = StatusType.ComplaintNumber;
int selectedStatusIndex = 3; int selectedStatusIndex = 3;
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<FeedbackViewModel>( return BaseView<FeedbackViewModel>(
allowAny: true, allowAny: true,
onModelReady: (model) { onModelReady: (model) {
@ -202,38 +203,67 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
shrinkWrap: isLogin ? false : true, shrinkWrap: isLogin ? false : true,
physics: isLogin ? null : NeverScrollableScrollPhysics(), physics: isLogin ? null : NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => InkWell( itemBuilder: (context, index) => InkWell(
onTap: () {}, onTap: () {
// sss
},
child: Container( child: Container(
decoration: cardRadius(12), margin: EdgeInsets.only(top: 12),
margin: EdgeInsets.all(10), decoration: BoxDecoration(
child: Padding( color: (cOCItemList[index].statusId==7||cOCItemList[index].statusId==8)?CustomColors.accentColor:(cOCItemList[index].statusId==10||cOCItemList[index].statusId==6||cOCItemList[index].statusId==9)?CustomColors.green:CustomColors.orange,
padding: const EdgeInsets.all(12.0), borderRadius: BorderRadius.all(
child: Row( Radius.circular(10.0),
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: [ boxShadow: [
Column( BoxShadow(
crossAxisAlignment: CrossAxisAlignment.start, color: Color(0xff000000).withOpacity(.05),
children: [ blurRadius: 27,
Text(isArabic ? cOCItemList[index].statusAr : cOCItemList[index].status, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), offset: Offset(0, -3),
Container( ),
margin: EdgeInsets.only(top: 5.0), ],
child: Text(cOCItemList[index].formType.toString(), ),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12))),
MyRichText(TranslationBase.of(context).number + ": ", cOCItemList[index].itemID.toString(), isArabic), child: Container(
Text(cOCItemList[index].cOCTitle, margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
], decoration: BoxDecoration(
), color: Colors.white,
Column( border: Border.all(color: Colors.white, width: 1),
crossAxisAlignment: CrossAxisAlignment.end, borderRadius: BorderRadius.only(
children: [ bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
Text(cOCItemList[index].date.split(" ")[0], topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)), bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
Text(cOCItemList[index].date.split(" ")[1].substring(0, 4), topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)), ),
], ),
), child: Padding(
], padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(isArabic ? cOCItemList[index].statusAr : cOCItemList[index].status, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(cOCItemList[index].formType.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12))),
MyRichText(TranslationBase.of(context).number + ": ", cOCItemList[index].itemID.toString(), isArabic),
Text(cOCItemList[index].cOCTitle,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(cOCItemList[index].date.split(" ")[0],
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)),
Text(cOCItemList[index].date.split(" ")[1].substring(0, 4),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)),
],
),
],
),
), ),
), ),
), ),

@ -4,17 +4,17 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
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/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';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/image.dart' as flutterImage;
import 'base/base_view.dart'; import 'base/base_view.dart';
dynamic languageID; dynamic languageID;
@ -22,8 +22,7 @@ dynamic languageID;
class FinalProductsPage extends StatefulWidget { class FinalProductsPage extends StatefulWidget {
final String id; final String id;
final int productType; // 1 : default, 2 : manufacturer , 3 : recently viewed final int productType; // 1 : default, 2 : manufacturer , 3 : recently viewed
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
FinalProductsPage({this.id, this.productType = 1}); FinalProductsPage({this.id, this.productType = 1});
@ -33,7 +32,9 @@ class FinalProductsPage extends StatefulWidget {
class _FinalProductsPageState extends State<FinalProductsPage> { class _FinalProductsPageState extends State<FinalProductsPage> {
String id; String id;
_FinalProductsPageState({this.id}); _FinalProductsPageState({this.id});
String categoriseName = "Personal Care"; String categoriseName = "Personal Care";
String appBarTitle = ""; String appBarTitle = "";
bool styleOne = true; bool styleOne = true;
@ -77,11 +78,10 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
} }
}, },
allowAny: true, allowAny: true,
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold(
Widget child) => isPharmacy: true,
PharmacyAppScaffold(
appBarTitle: appBarTitle, appBarTitle: appBarTitle,
isBottomBar: false, isBottomBar: true,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
isShowDecPage: false, isShowDecPage: false,
@ -91,16 +91,13 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
//Expanded widget heree if nassery
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Texts( child: Texts(
"$appBarTitle " + "$appBarTitle " + TranslationBase.of(context).products,
TranslationBase.of(context).products,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -154,29 +151,21 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
? Expanded( ? Expanded(
child: model.finalProducts.length > 0 child: model.finalProducts.length > 0
? Container( ? Container(
height: MediaQuery.of(context).size.height * height: MediaQuery.of(context).size.height * 3.90,
3.90,
child: GridView.builder( child: GridView.builder(
gridDelegate: gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
crossAxisSpacing: 0.5, crossAxisSpacing: 0.5,
mainAxisSpacing: 2.0, mainAxisSpacing: 2.0,
childAspectRatio: 1.0, childAspectRatio: 1.0,
), ),
itemCount: model.finalProducts.length, itemCount: model.finalProducts.length,
itemBuilder: itemBuilder: (BuildContext context, int index) {
(BuildContext context, int index) {
return NetworkBaseView( return NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: InkWell( child: InkWell(
child: Card( child: Card(
color: color: model.finalProducts[index].discountName != null ? Color(0xffFFFF00) : Colors.white,
model.finalProducts[index]
.discountName !=
null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0, elevation: 0,
shape: Border( shape: Border(
right: BorderSide( right: BorderSide(
@ -198,226 +187,84 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 8, horizontal: 8,
vertical: 1, vertical: 4,
// vertical: 2,
), ),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.only(
BorderRadius.only( topLeft: Radius.circular(110.0),
topLeft: Radius.circular(
110.0),
), ),
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 0),
horizontal: 4,
),
width: MediaQuery.of(context).size.width / 3, width: MediaQuery.of(context).size.width / 3,
// width: MediaQuery.of(context)
// .size
// .width /
// 1,
// height: MediaQuery.of(context)
// .size
// .width /
// 1,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
Stack( Stack(
children: [ children: [
Container( Container(
margin: EdgeInsets margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
.fromLTRB(0, 1, alignment: Alignment.center,
0, 0), child: Image.network(
alignment: Alignment model.finalProducts[index].images.isNotEmpty
.center, ? model.finalProducts[index].images[0].thumb
child:
Image.network(
model
.finalProducts[
index]
.images
.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover, fit: BoxFit.cover,
height: 70, height: 80,
), ),
), ),
// Container( Container(
// width: model width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 2.8 : 0,
// .finalProducts[ padding: EdgeInsets.all(4),
// index] decoration: BoxDecoration(
// .rxMessage != color: Color(0xffb23838),
// null borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
// ? MediaQuery.of(
// context)
// .size
// .width /
// 2.8
// : 0,
// padding:
// EdgeInsets.all(
// 4),
// decoration:
// BoxDecoration(
// color: Color(
// 0xffb23838),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
// ),
// child: model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? Texts(
// languageID ==
// 'ar'
// ? model
// .finalProducts[
// index]
// .rxMessagen
// : model
// .finalProducts[index]
// .rxMessage,
// color: Colors
// .white,
// regular:
// true,
// fontSize:
// 10,
// fontWeight:
// FontWeight
// .w600,
// )
// : Texts(""),
// ),
],
),
Container(
margin: EdgeInsets
.symmetric(
horizontal: 0,
vertical: 2,
),
width: model
.finalProducts[
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
2.0
: 0,
padding:
EdgeInsets.fromLTRB(8,4,8,4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
), ),
child: model child: model.finalProducts[index].rxMessage != null
.finalProducts[
index]
.rxMessage !=
null
? Texts( ? Texts(
languageID == languageID == 'ar' ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage,
'ar' color: Colors.white,
? model regular: true,
.finalProducts[ fontSize: 10,
index] fontWeight: FontWeight.w600,
.rxMessagen
: model
.finalProducts[index]
.rxMessage,
color: Colors
.white,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight
.w600,
) )
: Texts(""), : Texts(""),
), ),
],
),
Container( Container(
margin: EdgeInsets margin: EdgeInsets.symmetric(
.symmetric(
horizontal: 6, horizontal: 6,
vertical: 0, vertical: 0,
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
if (model if (model.finalProducts[index].discountName != null)
.finalProducts[
index]
.discountName !=
null)
Container( Container(
width: double width: double.infinity,
.infinity,
height: 13.0, height: 13.0,
decoration: decoration: BoxDecoration(
BoxDecoration( color: Color(0xff5AB145),
color: Color(
0xff5AB145),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
model model.finalProducts[index].discountName,
.finalProducts[ regular: true,
index] color: Colors.white,
.discountName, fontSize: 10.4,
regular:
true,
color: Colors
.white,
fontSize:
10.4,
), ),
), ),
), ),
Texts( Texts(
model model.finalProducts[index].name,
.finalProducts[
index]
.name,
regular: true, regular: true,
fontSize: 12, fontSize: 12,
fontWeight: fontWeight: FontWeight.w400,
FontWeight
.w400,
), ),
Padding( Padding(
padding: padding: const EdgeInsets.only(top: 4, bottom: 4),
const EdgeInsets
.only(
top: 4,
bottom:
4),
child: Texts( child: Texts(
"SAR ${model.finalProducts[index].price}", "SAR ${model.finalProducts[index].price}",
bold: true, bold: true,
@ -427,20 +274,15 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Row( Row(
children: [ children: [
StarRating( StarRating(
totalAverage: model.finalProducts[index].approvedRatingSum > totalAverage: model.finalProducts[index].approvedRatingSum > 0
0 ? (model.finalProducts[index].approvedRatingSum.toDouble() / model.finalProducts[index].approvedRatingSum.toDouble()).toDouble()
? (model.finalProducts[index].approvedRatingSum.toDouble() / model.finalProducts[index].approvedRatingSum.toDouble())
.toDouble()
: 0, : 0,
forceStars: forceStars: true),
true),
Texts( Texts(
"(${model.finalProducts[index].approvedTotalReviews})", "(${model.finalProducts[index].approvedTotalReviews})",
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight
.w400,
) )
], ],
), ),
@ -455,9 +297,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ProductDetailPage( page: ProductDetailPage(model.finalProducts[index]),
model.finalProducts[
index]),
)), )),
}, },
)); ));
@ -466,10 +306,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
) )
: Container( : Container(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Align( Align(
alignment: Alignment.center, alignment: Alignment.center,
@ -493,285 +331,143 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
: Expanded( : Expanded(
child: model.finalProducts.length > 0 child: model.finalProducts.length > 0
? Container( ? Container(
height: MediaQuery.of(context).size.height * height: MediaQuery.of(context).size.height * 5.0,
5.0,
child: ListView.builder( child: ListView.builder(
itemCount: model.finalProducts.length, itemCount: model.finalProducts.length,
itemBuilder: itemBuilder: (BuildContext context, int index) {
(BuildContext context, int index) {
return InkWell( return InkWell(
child: Card( child: Card(
child: Padding( child: Row(
padding: const EdgeInsets.all(4.0), children: [
child: Row( Stack(
children: [ children: [
Stack( Column(
children: [ children: [
Column( Container(
children: [ decoration: BoxDecoration(),
Container( child: Padding(
decoration: padding: EdgeInsets.only(
BoxDecoration(), left: 9.0,
child: Padding( top: 8.0,
padding: right: 10.0,
EdgeInsets
.only(
left: 2.0,
top: 2.0,
right: 2.0,
),
), ),
), ),
Container( ),
// margin: EdgeInsets Container(
// .fromLTRB( margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
// 8, 0, 8, 0), alignment: Alignment.center,
alignment: Alignment child: Image.network(
.center, model.finalProducts[index].images.isNotEmpty
child: ? model.finalProducts[index].images[0].thumb
Image.network( : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
model fit: BoxFit.contain,
.finalProducts[ height: 80,
index]
.images
.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit
.contain,
height: 70,
),
), ),
], ),
), ],
// Column(
// children: [
// Container(
// width: model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? MediaQuery.of(
// context)
// .size
// .width /
// 5.3
// : 0,
// padding:
// EdgeInsets.all(
// 4),
// decoration:
// BoxDecoration(
// color: Color(
// 0xffb23838),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
// ),
// child: Texts(
// model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? model
// .finalProducts[
// index]
// .rxMessage
// : "",
// color:
// Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight:
// FontWeight
// .w600,
// ),
// ),
// ],
// ),
],
),
Container(
height: 130.0,
margin:
EdgeInsets.symmetric(
horizontal: 0,
vertical: 6,
), ),
child: Column( Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
Container( Container(
margin: EdgeInsets width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 5.3 : 0,
.symmetric( padding: EdgeInsets.all(4),
horizontal: 4, decoration: BoxDecoration(
vertical: 0, color: Color(0xffb23838),
), borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
width: model
.finalProducts[
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
2.0
: 0,
padding:
EdgeInsets.all(
4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
), ),
child: model
.finalProducts[
index]
.rxMessage !=
null
? Texts(
languageID ==
'ar'
? model
.finalProducts[
index]
.rxMessagen
: model
.finalProducts[index]
.rxMessage,
color: Colors
.white,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight
.w600,
)
: Texts(""),
),
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(
context)
.size
.width *
0.65,
child: Texts( child: Texts(
model model.finalProducts[index].rxMessage != null ? model.finalProducts[index].rxMessage : "",
.finalProducts[ color: Colors.white,
index]
.name,
regular: true, regular: true,
fontSize: 13.2, fontSize: 10,
fontWeight: fontWeight: FontWeight.w600,
FontWeight.w500,
maxLines: 5,
), ),
), ),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model.finalProducts[index].approvedRatingSum.toDouble() /
model.finalProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars:
true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
],
),
], ],
), ),
],
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
), ),
child: Column(
widget.authenticatedUserObject.isLogin mainAxisAlignment: MainAxisAlignment.spaceAround,
? Container( crossAxisAlignment: CrossAxisAlignment.start,
child: IconButton( children: [
icon: Icon(Icons.shopping_cart, SizedBox(
size: 18, height: 4.0,
color: Colors.blue,), ),
onPressed: () async { Container(
if(model.finalProducts[index].rxMessage == null){ width: MediaQuery.of(context).size.width * 0.65,
GifLoaderDialogUtils.showMyDialog(context); child: Texts(
await addToCartFunction(1, model.finalProducts[index].id); model.finalProducts[index].name,
GifLoaderDialogUtils.hideDialog(context); regular: true,
Navigator.push( fontSize: 13.2,
context, fontWeight: FontWeight.w500,
FadePage(page: CartOrderPage())); maxLines: 5,
} ),
else{ ),
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); SizedBox(
} height: 8.0,
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
),
),
Row(
children: [
StarRating(
totalAverage: model.finalProducts[index].approvedRatingSum > 0
? (model.finalProducts[index].approvedRatingSum.toDouble() / model.finalProducts[index].approvedRatingSum.toDouble()).toDouble()
: 0,
forceStars: true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
),
],
),
),
widget.authenticatedUserObject.isLogin
? Container(
child: IconButton(
icon: Icon(
Icons.shopping_cart,
size: 18,
color: Colors.blue,
),
onPressed: () async {
if (model.finalProducts[index].rxMessage == null) {
GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, model.finalProducts[index].id);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: CartOrderPage()));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
}
// //
} }),
)
), : Container(),
):Container(), ],
],
),
), ),
), ),
onTap: () => { onTap: () => {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ProductDetailPage( page: ProductDetailPage(model.finalProducts[index]),
model.finalProducts[
index]),
)), )),
}, },
); );
@ -779,10 +475,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
) )
: Container( : Container(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Align( Align(
alignment: Alignment.center, alignment: Alignment.center,

@ -23,7 +23,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'landing_page_pharmcy.dart'; import 'landing_page_pharmcy.dart';
@ -196,7 +195,7 @@ class _HomePageState extends State<HomePage> {
width: double.infinity, width: double.infinity,
height: 125, height: 125,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: Color(0xFFA59E9E),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all(color: Colors.transparent, width: 0.5), border: Border.all(color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(9)), borderRadius: BorderRadius.all(Radius.circular(9)),
@ -231,7 +230,7 @@ class _HomePageState extends State<HomePage> {
width: 90, width: 90,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#D81A2E'), color: Color(0xFFD81A2E),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all(color: Colors.transparent, width: 0.5), border: Border.all(color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(0)), borderRadius: BorderRadius.all(Radius.circular(0)),
@ -255,7 +254,7 @@ class _HomePageState extends State<HomePage> {
width: double.infinity, width: double.infinity,
height: projectViewModel.isArabic ? 160 : 130, height: projectViewModel.isArabic ? 160 : 130,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: Color(0xFFA59E9E),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all(color: Colors.transparent, width: 0.5), border: Border.all(color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(9)), borderRadius: BorderRadius.all(Radius.circular(9)),
@ -341,7 +340,7 @@ class _HomePageState extends State<HomePage> {
width: 90, width: 90,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#D81A2E'), color: Color(0xFFD81A2E),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all(color: Colors.transparent, width: 0.5), border: Border.all(color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -593,7 +592,7 @@ class _HomePageState extends State<HomePage> {
)), )),
), ),
height: MediaQuery.of(context).size.width * 0.4, height: MediaQuery.of(context).size.width * 0.4,
color: HexColor("#747C80"), color: Color(0xFF747C80),
imageName: 'emergency_service_image.png', imageName: 'emergency_service_image.png',
), ),
], ],
@ -826,7 +825,6 @@ class _HomePageState extends State<HomePage> {
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
await pharmacyModuleViewModel.verifyCustomer().then((value) { await pharmacyModuleViewModel.verifyCustomer().then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: LandingPagePharmacy())); Navigator.push(context, FadePage(page: LandingPagePharmacy()));
@ -868,7 +866,7 @@ class DashboardItem extends StatelessWidget {
color: !hasBorder color: !hasBorder
? color != null ? color != null
? color ? color
: HexColor('#050705').withOpacity(opacity) : Color(0xFF050705).withOpacity(opacity)
: Colors.white, : Colors.white,
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent),

@ -29,7 +29,6 @@ import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart';
@ -242,15 +241,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
// signalRUtil = new SignalRUtil(hubName: "http://192.168.8.101:5001/chatHub", context: context); signalRUtil = new SignalRUtil(hubName: "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273", context: context);
// signalRUtil = new SignalRUtil(hubName: "https://api.cssynapses.com/chatsocket", context: context);
locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus(); familyFileProvider.getSharedRecordByStatus();
} }
// signalRUtil.startSignalRConnection(); if (!signalRUtil.getConnectionState()) signalRUtil.startSignalRConnection();
}); });
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
//for now commented to reduce this call will enable it when needed //for now commented to reduce this call will enable it when needed
@ -507,91 +505,93 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
model = Provider.of<ToDoCountProviderModel>(context); model = Provider.of<ToDoCountProviderModel>(context);
// currentTab == 0 ? 45 : 0.0 // currentTab == 0 ? 45 : 0.0
return Scaffold( return Scaffold(
appBar: currentTab == 0 ? PreferredSize( appBar: currentTab == 0
preferredSize: Size.fromHeight(currentTab == 0 ? 45 : 0.0), ? PreferredSize(
child: AppBar( preferredSize: Size.fromHeight(currentTab == 0 ? 45 : 0.0),
elevation: 0, child: AppBar(
backgroundColor: CustomColors.backgroudGreyColor, elevation: 0,
textTheme: TextTheme( backgroundColor: CustomColors.backgroudGreyColor,
headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), textTheme: TextTheme(
), headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold),
title: Text( ),
getText(currentTab).toUpperCase(), title: Text(
style: TextStyle( getText(currentTab).toUpperCase(),
fontWeight: FontWeight.bold, style: TextStyle(
color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1.color,
// bold: true, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), // bold: true,
leading: Builder( ),
builder: (BuildContext context) { leading: Builder(
return new Stack( builder: (BuildContext context) {
children: <Widget>[ return new Stack(
currentTab == 0 children: <Widget>[
? IconButton( currentTab == 0
icon: SvgPicture.asset("assets/images/new/menu.svg"), ? IconButton(
color: Theme.of(context).textTheme.headline1.color, icon: SvgPicture.asset("assets/images/new/menu.svg"),
onPressed: () => Scaffold.of(context).openDrawer(), color: Theme.of(context).textTheme.headline1.color,
) onPressed: () => Scaffold.of(context).openDrawer(),
: IconButton( )
icon: Icon(Icons.arrow_back), : IconButton(
onPressed: () { icon: Icon(Icons.arrow_back),
setState(() { onPressed: () {
currentTab = 0; setState(() {
}); currentTab = 0;
});
pageController.jumpToPage(0);
}, pageController.jumpToPage(0);
), },
projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild
? new Positioned(
right: projectViewModel.isArabic ? 35 : 0,
top: 5,
child: new Container(
padding: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: CustomColors.accentColor,
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
model.notificationsCount.toString(),
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
), ),
textAlign: TextAlign.center, projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild
), ? new Positioned(
), right: projectViewModel.isArabic ? 35 : 0,
) top: 5,
: SizedBox() child: new Container(
padding: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: CustomColors.accentColor,
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
model.notificationsCount.toString(),
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
),
),
)
: SizedBox()
],
);
},
),
actions: [
// IconButton(
// //iconSize: 70,
// icon: Icon(
// projectViewModel.isLogin ? Icons.settings : Icons.login,
// color: Theme.of(context).textTheme.headline1.color,
// ),
// onPressed: () {
// if (projectViewModel.isLogin)
// Navigator.of(context).pushNamed(
// SETTINGS,
// );
// else
// login();
// }, //do something,
// )
], ],
); centerTitle: true,
}, ),
), )
actions: [ : null,
// IconButton(
// //iconSize: 70,
// icon: Icon(
// projectViewModel.isLogin ? Icons.settings : Icons.login,
// color: Theme.of(context).textTheme.headline1.color,
// ),
// onPressed: () {
// if (projectViewModel.isLogin)
// Navigator.of(context).pushNamed(
// SETTINGS,
// );
// else
// login();
// }, //do something,
// )
],
centerTitle: true,
),
) : null,
drawer: SafeArea(child: AppDrawer()), drawer: SafeArea(child: AppDrawer()),
extendBody: false, extendBody: false,
body: WillPopScope( body: WillPopScope(

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/PharmacyPagesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
@ -14,36 +15,46 @@ 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';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart'; import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.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 '../../locator.dart'; import '../../locator.dart';
class LandingPagePharmacy extends StatefulWidget { class LandingPagePharmacy extends StatefulWidget {
final int currentTab;
const LandingPagePharmacy({Key key, this.currentTab = 0}) : super(key: key);
@override @override
_LandingPagePharmacyState createState() => _LandingPagePharmacyState(); _LandingPagePharmacyState createState() => _LandingPagePharmacyState();
} }
class _LandingPagePharmacyState extends State<LandingPagePharmacy> { class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
ProjectViewModel projectProvider;
int currentTab = 0; int currentTab = 0;
PageController pageController; PageController pageController;
ProjectViewModel projectProvider;
_changeCurrentTab(int tab) {
setState(() {
currentTab = tab;
pageController.jumpToPage(tab);
});
}
void initState() { void initState() {
super.initState(); super.initState();
locator<PharmacyModuleService>().manufacturerList = []; locator<PharmacyModuleService>().manufacturerList = [];
locator<PharmacyModuleService>().bestSellerProducts = []; locator<PharmacyModuleService>().bestSellerProducts = [];
locator<PharmacyModuleService>().lastVisitedProducts = []; locator<PharmacyModuleService>().lastVisitedProducts = [];
pageController =
PageController(keepPage: true, initialPage: widget.currentTab);
setState(() {
currentTab = widget.currentTab;
});
}
pageController = PageController(keepPage: true); changeCurrentTab(int tab) {
if (pageController.hasClients) {
setState(() {
currentTab = tab;
pageController.jumpToPage(tab);
});
}
} }
@override @override
@ -52,75 +63,13 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
onWillPop: () async { onWillPop: () async {
return false; return false;
}, },
child: Scaffold( child: AppScaffold(
appBar: currentTab != 4 && currentTab != 3 isBottomBar: true,
? AppBar(
backgroundColor: Color(0xff5AB145),
elevation: 0,
title: Container(
height: MediaQuery.of(context).size.height * 0.056,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
),
child: InkWell(
child: Padding(
padding: EdgeInsets.all(5.0),
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
),
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
),
onTap: () {
Navigator.push(
context,
FadePage(page: SearchProductsPage()),
);
},
),
),
leading: Builder(
builder: (BuildContext context) {
return InkWell(
onTap: () {
setState(() {
currentTab = 0;
pageController.jumpToPage(0);
});
},
child: Container(
height: 2.0,
width: 10.0,
child: Image.asset(
'assets/images/pharmacy_logo.png',
),
),
);
},
),
actions: [
IconButton(
// iconSize: 70,
icon: Image.asset(
'assets/images/new-design/qr-code.png',
),
onPressed: _scanQrAndGetProduct //do something,
)
],
centerTitle: true,
)
: null,
extendBody: false, extendBody: false,
isShowDecPage: false,
isMainPharmacyPages: true,
currentTab: currentTab,
changeCurrentTab: changeCurrentTab,
body: PageView( body: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,
@ -128,13 +77,9 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
PharmacyPage(), PharmacyPage(),
PharmacyCategorisePage(), PharmacyCategorisePage(),
PharmacyProfilePage(), PharmacyProfilePage(),
CartOrderPage(changeTab: _changeCurrentTab), CartOrderPage(changeTab: changeCurrentTab),
], ],
), ),
bottomNavigationBar: BottomNavPharmacyBar(
changeIndex: _changeCurrentTab,
index: currentTab,
),
), ),
); );
} }

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; import 'package:diplomaticquarterapp/pages/login/confirm-login.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart';
@ -39,7 +40,7 @@ class _Login extends State<Login> {
final util = Utils(); final util = Utils();
final nationalIDorFile = TextEditingController(); final nationalIDorFile = TextEditingController();
final mobileNumberController = TextEditingController(); final mobileNumberController = TextEditingController();
final int loginType = LoginType.loginType; int loginType = LoginType.loginType;
String mobileNo; String mobileNo;
String countryCode = '966'; String countryCode = '966';
bool isButtonDisabled = true; bool isButtonDisabled = true;
@ -61,10 +62,12 @@ class _Login extends State<Login> {
// getDeviceToken(); // getDeviceToken();
super.initState(); super.initState();
if (BASE_URL.contains("uat.")) { // if (BASE_URL.contains("uat.")) {
nationalIDorFile.text = "2001273"; // nationalIDorFile.text = "2001273";
mobileNumberController.text = mobileNo = "0555416043"; // mobileNumberController.text = mobileNo = "0555416043";
}/* else { // }
getRegisterData();
/* else {
nationalIDorFile.text = "3376044"; nationalIDorFile.text = "3376044";
mobileNumberController.text = mobileNo = "0555416575"; mobileNumberController.text = mobileNo = "0555416575";
}*/ }*/
@ -107,7 +110,11 @@ class _Login extends State<Login> {
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
), ),
SizedBox(height: 20), SizedBox(height: 20),
PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), PhoneNumberSelectorWidget(
onNumberChange: (value) => {mobileNo = value, validateForm()},
onCountryChange: (value) => countryCode = value,
mobileNo: this.mobileNo,
),
SizedBox(height: 12), SizedBox(height: 12),
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
@ -375,9 +382,17 @@ class _Login extends State<Login> {
projectViewModel.platformBridge().registerHmgGeofences(); projectViewModel.platformBridge().registerHmgGeofences();
} }
// showLoader(bool isTrue) { getRegisterData() async {
// setState(() { var registerData = await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN);
// isLoading = isTrue; await sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
// });
// } if (registerData != null) {
setState(() {
this.nationalIDorFile.text = registerData['PatientIdentificationID'].toString();
this.isButtonDisabled = false;
this.loginType = 1;
this.mobileNo = registerData['PatientMobileNumber'].toString();
});
}
}
} }

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req
import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart'; import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart';
import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; import 'package:diplomaticquarterapp/pages/login/confirm-login.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/pages/login/login.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -19,11 +20,12 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart' as intl;
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:intl/intl.dart' as intl;
class Register extends StatefulWidget { class Register extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
const Register({Key key, this.changePageViewIndex}) : super(key: key); const Register({Key key, this.changePageViewIndex}) : super(key: key);
@override @override
@ -326,15 +328,18 @@ class _Register extends State<Register> {
var nRequest = request.toJson(); var nRequest = request.toJson();
nRequest['LogInTokenID'] = response['LogInTokenID']; nRequest['LogInTokenID'] = response['LogInTokenID'];
if (response['hasFile'] == true) { if (response['hasFile'] == true) {
// AppToast.showErrorToast(message: response['ErrorEndUserMessage']); ConfirmDialog dialog = new ConfirmDialog(
AlertDialogBox( context: context,
context: context, confirmMessage: response['ErrorEndUserMessage'],
confirmMessage: response['ErrorEndUserMessage'], okText: TranslationBase.of(context).ok,
okText: TranslationBase.of(context).ok, cancelText: TranslationBase.of(context).cancel,
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
Navigator.of(context).pop(); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest);
}).showAlertDialog(context); Navigator.of(context).push(FadePage(page: Login()));
},
cancelFunction: () {})
.showAlertDialog(context);
} else { } else {
nRequest['forRegister'] = true; nRequest['forRegister'] = true;
nRequest['isRegister'] = true; nRequest['isRegister'] = true;

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/pages/login/register.dart';
import 'package:diplomaticquarterapp/pages/login/register_new.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
@ -78,7 +79,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).no, TranslationBase.of(context).no,
() => { () => {
Navigator.of(context).push(FadePage(page: Register())), Navigator.of(context).push(FadePage(page: RegisterNew())),
}, },
color: CustomColors.accentColor, color: CustomColors.accentColor,
textColor: Colors.white, textColor: Colors.white,

@ -9,9 +9,10 @@ import 'package:diplomaticquarterapp/theme/colors.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';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/show_zoom_image_dialog.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -101,23 +102,43 @@ class PrescriptionOrderOverview extends StatelessWidget {
prescriptionReportEnhList.length, prescriptionReportEnhList.length,
(index) => Container( (index) => Container(
margin: EdgeInsets.all(0.0), margin: EdgeInsets.all(0.0),
decoration: cardRadius(0), // decoration: cardRadius(0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container( InkWell(
margin: EdgeInsets.only(bottom: 10.0), onTap: () {
decoration: BoxDecoration( showZoomImageDialog(context, prescriptionReportEnhList[index].imageSRCUrl);
border: Border.all(width: 1.0, color: Color(0xffEBEBEB)), },
borderRadius: BorderRadius.all(Radius.circular(30.0)), child: Stack(
), alignment: Alignment.center,
child: ClipRRect( children: [
borderRadius: BorderRadius.all(Radius.circular(30)), Container(
child: Image.network( margin: EdgeInsets.only(bottom: 10.0),
prescriptionReportEnhList[index].imageSRCUrl, decoration: BoxDecoration(
fit: BoxFit.cover, border: Border.all(width: 1.0, color: Color(0xffEBEBEB)),
width: 48, borderRadius: BorderRadius.all(Radius.circular(30.0)),
height: 48, ),
), child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)),
child: Image.network(
prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 48,
height: 48,
),
),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Icon(
Icons.search,
size: 18,
color: Colors.white,
),
padding: EdgeInsets.all(3),
decoration: containerRadius(Colors.black.withOpacity(0.3), 200),
)
],
), ),
), ),
SizedBox(width: 14), SizedBox(width: 14),
@ -153,15 +174,14 @@ class PrescriptionOrderOverview extends StatelessWidget {
), ),
), ),
Container( Container(
decoration: cardRadius(0), // decoration: cardRadius(0),
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
child: Container( child: Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: SecondaryButton( child: DefaultButton(
label: TranslationBase.of(context).submit.toUpperCase(), TranslationBase.of(context).submit.toUpperCase(),
color: CustomColors.accentColor, () async {
onTap: () async {
showDialog( showDialog(
context: context, context: context,
child: ConfirmWithMessageDialog( child: ConfirmWithMessageDialog(

@ -23,6 +23,7 @@ import 'package:provider/provider.dart';
class PrescriptionDetailsPage extends StatelessWidget { class PrescriptionDetailsPage extends StatelessWidget {
final PrescriptionReport prescriptionReport; final PrescriptionReport prescriptionReport;
final Prescriptions prescriptions; final Prescriptions prescriptions;
PrescriptionDetailsPage({Key key, this.prescriptionReport, this.prescriptions}); PrescriptionDetailsPage({Key key, this.prescriptionReport, this.prescriptions});
@override @override
@ -111,14 +112,18 @@ class PrescriptionDetailsPage extends StatelessWidget {
decoration: cardRadius(2000), decoration: cardRadius(2000),
), ),
Container( Container(
child: Icon(Icons.search,size: 18,color: Colors.white,), child: Icon(
Icons.search,
size: 18,
color: Colors.white,
),
padding: EdgeInsets.all(6), padding: EdgeInsets.all(6),
decoration: containerRadius(Colors.black.withOpacity(0.3), 200), decoration: containerRadius(Colors.black.withOpacity(0.3), 200),
) )
], ],
), ),
onTap: (){ onTap: () {
showZoomImageDialog(context, prescriptionReport.imageSRCUrl); showZoomImageDialog(context, prescriptionReport.imageSRCUrl);
}, },
), ),
SizedBox(width: 12), SizedBox(width: 12),

@ -62,107 +62,135 @@ class PrescriptionItemsPage extends StatelessWidget {
prescriptions.noOfPatientsRate, prescriptions.noOfPatientsRate,
model.user.emailAddress, model.user.emailAddress,
), ),
isNeedToShowButton: projectViewModel.havePrivilege(13), isNeedToShowButton: (model.prescriptionReportListINP.length > 0 || model.prescriptionReportEnhList.length > 0) ? projectViewModel.havePrivilege(13) : false,
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
onTap: () { onTap: () {
showConfirmMessage(context, model); showConfirmMessage(context, model);
}, },
), ),
if (!prescriptions.isInOutPatient) if (!prescriptions.isInOutPatient)
ListView.separated( model.prescriptionReportListINP.length > 0
itemBuilder: (context, index) { ? ListView.separated(
return InkWell( itemBuilder: (context, index) {
onTap: () { return InkWell(
Navigator.push( onTap: () {
context, Navigator.push(
FadePage( context,
page: PrescriptionDetailsPageINP( FadePage(
prescriptionReport: model.prescriptionReportListINP[index], page: PrescriptionDetailsPageINP(
), prescriptionReport: model.prescriptionReportListINP[index],
), ),
); ),
}, );
child: Container( },
width: double.infinity, child: Container(
child: Container( width: double.infinity,
margin: EdgeInsets.only(left: 16, right: 16, top: index == 0 ? 16 : 4, bottom: 4), child: Container(
decoration: cardRadius(12), margin: EdgeInsets.only(left: 16, right: 16, top: index == 0 ? 16 : 4, bottom: 4),
child: Padding( decoration: cardRadius(12),
padding: EdgeInsets.only(top: 12, bottom: 20, left: projectViewModel.isArabic ? 12 : 20, right: projectViewModel.isArabic ? 20 : 12), child: Padding(
child: Row( padding: EdgeInsets.only(top: 12, bottom: 20, left: projectViewModel.isArabic ? 12 : 20, right: projectViewModel.isArabic ? 20 : 12),
children: [ child: Row(
Flexible( children: [
child: Column( Flexible(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Text(
model.prescriptionReportListINP[index].itemDescription.isNotEmpty
? model.prescriptionReportListINP[index].itemDescription
: model.prescriptionReportListINP[index].itemDescriptionN ?? '',
style: TextStyle(
fontSize: 16,
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
),
mHeight(10),
Row(
children: [ children: [
InkWell( Text(
child: Stack( model.prescriptionReportListINP[index].itemDescription.isNotEmpty
alignment: Alignment.center, ? model.prescriptionReportListINP[index].itemDescription
children: [ : model.prescriptionReportListINP[index].itemDescriptionN ?? '',
Container( style: TextStyle(
child: Image.network( fontSize: 16,
model.prescriptionReportListINP[index].imageSRCUrl, letterSpacing: -0.64,
fit: BoxFit.cover, fontWeight: FontWeight.w600,
width: 60,
height: 60,
),
margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias,
decoration: cardRadius(2000),
),
Container(
child: Icon(Icons.search,size: 18,color: Colors.white,),
padding: EdgeInsets.all(6),
decoration: containerRadius(Colors.black.withOpacity(0.3), 200),
)
],
), ),
onTap: (){
showZoomImageDialog(context, model.prescriptionReportListINP[index].imageSRCUrl,);
},
), ),
mWidth(12), mHeight(10),
Column( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( InkWell(
children: [ child: Stack(
Text( alignment: Alignment.center,
TranslationBase.of(context).route + ": ", children: [
style: TextStyle( Container(
color: Colors.grey, child: Image.network(
fontSize: 10, model.prescriptionReportListINP[index].imageSRCUrl,
letterSpacing: -0.4, fit: BoxFit.cover,
fontWeight: FontWeight.w600, width: 60,
height: 60,
),
margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias,
decoration: cardRadius(2000),
), ),
), Container(
Text( child: Icon(
model.prescriptionReportListINP[index].route, Icons.search,
style: TextStyle( size: 18,
fontSize: 12, color: Colors.white,
letterSpacing: -0.48, ),
fontWeight: FontWeight.w600, padding: EdgeInsets.all(6),
), decoration: containerRadius(Colors.black.withOpacity(0.3), 200),
), )
], ],
),
onTap: () {
showZoomImageDialog(
context,
model.prescriptionReportListINP[index].imageSRCUrl,
);
},
), ),
Row( mWidth(12),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row(
children: [
Text(
TranslationBase.of(context).route + ": ",
style: TextStyle(
color: Colors.grey,
fontSize: 10,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
Text(
model.prescriptionReportListINP[index].route,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).dailyDoses + ": ",
style: TextStyle(
color: Colors.grey,
fontSize: 10,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
Text(
model.prescriptionReportListINP[index].doseDailyQuantity.toString(),
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
mHeight(12),
Text( Text(
TranslationBase.of(context).dailyDoses + ": ", model.prescriptionReportListINP[index].remarks,
style: TextStyle( style: TextStyle(
color: Colors.grey, color: Colors.grey,
fontSize: 10, fontSize: 10,
@ -170,184 +198,180 @@ class PrescriptionItemsPage extends StatelessWidget {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
Text(
model.prescriptionReportListINP[index].doseDailyQuantity.toString(),
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
], ],
), )
mHeight(12),
Text(
model.prescriptionReportListINP[index].remarks,
style: TextStyle(
color: Colors.grey,
fontSize: 10,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
], ],
) ),
], ],
), ),
], ),
), Icon(
), Icons.arrow_forward,
Icon( size: 16,
Icons.arrow_forward, ),
size: 16, ],
), ),
], ),
),
),
),
),
);
},
separatorBuilder: (context, index) {
return mHeight(8);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: model.prescriptionReportListINP.length)
else
ListView.separated(
padding: EdgeInsets.all(21),
itemBuilder: (context, index) {
return InkWell(
onTap: () {
PrescriptionReport prescriptionReport = PrescriptionReport(
imageSRCUrl: model.prescriptionReportEnhList[index].imageSRCUrl,
itemDescription: model.prescriptionReportEnhList[index].itemDescription,
itemDescriptionN: model.prescriptionReportEnhList[index].itemDescription,
routeN: model.prescriptionReportEnhList[index].route,
frequency: model.prescriptionReportEnhList[index].frequency,
frequencyN: model.prescriptionReportEnhList[index].frequency,
doseDailyQuantity: model.prescriptionReportEnhList[index].doseDailyQuantity,
days: model.prescriptionReportEnhList[index].days,
itemID: model.prescriptionReportEnhList[index].itemID,
remarks: model.prescriptionReportEnhList[index].remarks);
Navigator.push(
context,
FadePage(
page: PrescriptionDetailsPage(
prescriptionReport: prescriptionReport,
prescriptions: prescriptions,
), ),
), ),
); );
}, },
child: Container( separatorBuilder: (context, index) {
decoration: BoxDecoration( return mHeight(8);
color: Colors.white, },
borderRadius: BorderRadius.all( physics: NeverScrollableScrollPhysics(),
Radius.circular(10.0), shrinkWrap: true,
), itemCount: model.prescriptionReportListINP.length)
boxShadow: [ : Padding(
BoxShadow( padding: const EdgeInsets.only(top: 150.0),
color: Color(0xff000000).withOpacity(.05), child: getNoDataWidget(context),
blurRadius: 27, )
offset: Offset(0, -3), else
model.prescriptionReportEnhList.length > 0
? ListView.separated(
padding: EdgeInsets.all(21),
itemBuilder: (context, index) {
return InkWell(
onTap: () {
PrescriptionReport prescriptionReport = PrescriptionReport(
imageSRCUrl: model.prescriptionReportEnhList[index].imageSRCUrl,
itemDescription: model.prescriptionReportEnhList[index].itemDescription,
itemDescriptionN: model.prescriptionReportEnhList[index].itemDescription,
routeN: model.prescriptionReportEnhList[index].route,
frequency: model.prescriptionReportEnhList[index].frequency,
frequencyN: model.prescriptionReportEnhList[index].frequency,
doseDailyQuantity: model.prescriptionReportEnhList[index].doseDailyQuantity,
days: model.prescriptionReportEnhList[index].days,
itemID: model.prescriptionReportEnhList[index].itemID,
remarks: model.prescriptionReportEnhList[index].remarks);
Navigator.push(
context,
FadePage(
page: PrescriptionDetailsPage(
prescriptionReport: prescriptionReport,
prescriptions: prescriptions,
),
),
);
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
), ),
], child: Padding(
), padding: EdgeInsets.only(top: 12, bottom: 20, left: projectViewModel.isArabic ? 12 : 20, right: projectViewModel.isArabic ? 20 : 12),
child: Padding( child: Row(
padding: EdgeInsets.only(top: 12, bottom: 20, left: projectViewModel.isArabic ? 12 : 20, right: projectViewModel.isArabic ? 20 : 12), children: [
child: Row( Flexible(
children: [ child: Column(
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
(model.prescriptionReportEnhList[index].itemDescription.isNotEmpty
? model.prescriptionReportEnhList[index].itemDescription
: model.prescriptionReportEnhList[index].itemDescriptionN ?? '')
.toLowerCase()
.capitalizeFirstofEach,
style: TextStyle(
fontSize: 16,
color: Color(0xff2E303A),
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
),
mHeight(10),
Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
InkWell( Text(
child: Stack( (model.prescriptionReportEnhList[index].itemDescription.isNotEmpty
alignment: Alignment.center, ? model.prescriptionReportEnhList[index].itemDescription
children: [ : model.prescriptionReportEnhList[index].itemDescriptionN ?? '')
Container( .toLowerCase()
child: Image.network( .capitalizeFirstofEach,
model.prescriptionReportEnhList[index].imageSRCUrl, style: TextStyle(
fit: BoxFit.cover, fontSize: 16,
width: 60, color: Color(0xff2E303A),
height: 60, letterSpacing: -0.64,
), fontWeight: FontWeight.w600,
margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias,
decoration: cardRadius(2000),
),
Container(
child: Icon(Icons.search,size: 18,color: Colors.white,),
padding: EdgeInsets.all(6),
decoration: containerRadius(Colors.black.withOpacity(0.3), 200),
)
],
), ),
onTap: (){
showZoomImageDialog(context, model.prescriptionReportEnhList[index].imageSRCUrl,);
},
), ),
mWidth(12), mHeight(10),
Expanded( Row(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ InkWell(
MyRichText(TranslationBase.of(context).route + ": ", model.prescriptionReportEnhList[index].route, projectViewModel.isArabic), child: Stack(
MyRichText(TranslationBase.of(context).dailyDoses + ": ", model.prescriptionReportEnhList[index].doseDailyQuantity.toString(), alignment: Alignment.center,
projectViewModel.isArabic), children: [
mHeight(9), Container(
Text( child: Image.network(
model.prescriptionReportEnhList[index].remarks, model.prescriptionReportEnhList[index].imageSRCUrl,
style: TextStyle( fit: BoxFit.cover,
color: Color(0xff575757), width: 60,
fontSize: 12, height: 60,
letterSpacing: -0.4, ),
fontWeight: FontWeight.w600, margin: EdgeInsets.zero,
), clipBehavior: Clip.antiAlias,
decoration: cardRadius(2000),
),
Container(
child: Icon(
Icons.search,
size: 18,
color: Colors.white,
),
padding: EdgeInsets.all(6),
decoration: containerRadius(Colors.black.withOpacity(0.3), 200),
)
],
), ),
], onTap: () {
), showZoomImageDialog(
) context,
model.prescriptionReportEnhList[index].imageSRCUrl,
);
},
),
mWidth(12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MyRichText(TranslationBase.of(context).route + ": ", model.prescriptionReportEnhList[index].route, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).dailyDoses + ": ", model.prescriptionReportEnhList[index].doseDailyQuantity.toString(),
projectViewModel.isArabic),
mHeight(9),
Text(
model.prescriptionReportEnhList[index].remarks,
style: TextStyle(
color: Color(0xff575757),
fontSize: 12,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
],
),
)
],
),
], ],
), ),
], ),
), Icon(
), Icons.arrow_forward,
Icon( size: 16,
Icons.arrow_forward, ),
size: 16, ],
), ),
], ),
), ),
), );
), },
); separatorBuilder: (context, index) {
}, return mHeight(12);
separatorBuilder: (context, index) { },
return mHeight(12); shrinkWrap: true,
}, physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, itemCount: model.prescriptionReportEnhList.length)
physics: NeverScrollableScrollPhysics(), : Padding(
itemCount: model.prescriptionReportEnhList.length), padding: const EdgeInsets.only(top: 150.0),
child: getNoDataWidget(context),
),
], ],
), ),
), ),

@ -1,12 +1,11 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -25,126 +24,130 @@ class PrescriptionsHistoryPage extends StatelessWidget {
onModelReady: (model) => model.getPrescriptionsOrders(showLoading: true), onModelReady: (model) => model.getPrescriptionsOrders(showLoading: true),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
baseViewModel: prescriptionsViewModel, baseViewModel: prescriptionsViewModel,
body: ListView.separated( body: model.state != ViewState.Busy
physics: BouncingScrollPhysics(), ? prescriptionsViewModel.prescriptionsHistory.length > 0
padding: EdgeInsets.all(21), ? ListView.separated(
separatorBuilder: (context, index) { physics: BouncingScrollPhysics(),
return SizedBox(height: 12); padding: EdgeInsets.all(21),
}, separatorBuilder: (context, index) {
itemBuilder: (context, index) { return SizedBox(height: 12);
int status = prescriptionsViewModel.prescriptionsHistory[index].status; },
String _statusDisp = projectViewModel.isArabic ? prescriptionsViewModel.prescriptionsHistory[index].descriptionN : prescriptionsViewModel.prescriptionsHistory[index].description; itemBuilder: (context, index) {
Color _color; int status = prescriptionsViewModel.prescriptionsHistory[index].statusId;
if (status == 1) { String _statusDisp = prescriptionsViewModel.prescriptionsHistory[index].statusText;
//pending Color _color;
_color = Color(0xffCC9B14); if (status == 1) {
} else if (status == 2) { //pending
//processing _color = Color(0xffCC9B14);
_color = Color(0xff2E303A); } else if (status == 2) {
} else if (status == 3) { //processing
//completed _color = Color(0xff2E303A);
_color = Color(0xff359846); } else if (status == 3) {
} else if (status == 4) { //completed
//cancel // Rejected _color = Color(0xff359846);
_color = Color(0xffD02127); } else if (status == 4 || status == 6 || status == 7) {
} //cancel // Rejected
_color = Color(0xffD02127);
}
return InkWell( return InkWell(
onTap: () async { onTap: () async {
final result = await Navigator.push( // final result = await Navigator.push(
context, // context,
FadePage( // FadePage(
page: PrescriptionsHistoryDetailsPage( // page: PrescriptionsHistoryDetailsPage(
prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index], // prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index],
), // ),
), // ),
); // );
if (result != null) { // if (result != null) {
showOrderLog(); // showOrderLog();
} // }
}, },
child: Container( child: Container(
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 6,
decoration: BoxDecoration(
color: _color,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
bottomRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
),
Expanded(
child: Padding(
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 6 : 12, right: projectViewModel.isArabic ? 12 : 6),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
Text(
'${TranslationBase.of(context).orderNo}. ${prescriptionsViewModel.prescriptionsHistory[index].iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
],
),
), ),
Column( boxShadow: [
mainAxisSize: MainAxisSize.min, BoxShadow(
crossAxisAlignment: CrossAxisAlignment.end, color: Color(0xff000000).withOpacity(.05),
children: [ blurRadius: 27,
Text( offset: Offset(0, -3),
DateUtil.getDayMonthYearDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn), ),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ],
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 6,
decoration: BoxDecoration(
color: _color,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
bottomRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
), ),
Text( ),
DateUtil.formatDateToTimeLang(prescriptionsViewModel.prescriptionsHistory[index].createdOn, false), Expanded(
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), child: Padding(
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 6 : 12, right: projectViewModel.isArabic ? 12 : 6),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
Text(
'${TranslationBase.of(context).orderNo}. ${prescriptionsViewModel.prescriptionsHistory[index].iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
],
),
),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(prescriptionsViewModel.prescriptionsHistory[index].created)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
Text(
DateUtil.formatDateToTimeLang(DateTime.tryParse(prescriptionsViewModel.prescriptionsHistory[index].created), false),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
],
)
],
),
), ),
], ),
) Icon(
], Icons.arrow_forward,
), size: 16,
), ),
), mWidth(6),
Icon( ],
Icons.arrow_forward, ),
size: 16, ));
), },
mWidth(6), itemCount: prescriptionsViewModel.prescriptionsHistory.length,
], )
), : getNoDataWidget(context)
)); : Container(),
},
itemCount: prescriptionsViewModel.prescriptionsHistory.length,
),
)); ));
} }
} }

@ -90,7 +90,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
prescriptionsViewModel: model, prescriptionsViewModel: model,
showOrderLog: () async { showOrderLog: () async {
_tabController.animateTo(2); _tabController.animateTo(2);
await model.getPrescriptionsOrders(showLoading: true); // await model.getPrescriptionsOrders(showLoading: true);
setState(() {}); setState(() {});
}, },
), ),
@ -99,7 +99,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
prescriptionsViewModel: model, prescriptionsViewModel: model,
showOrderLog: () async { showOrderLog: () async {
_tabController.animateTo(2); _tabController.animateTo(2);
await model.getPrescriptionsOrders(showLoading: true); // await model.getPrescriptionsOrders(showLoading: true);
setState(() {}); setState(() {});
}, },
), ),

@ -1,8 +1,8 @@
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/Steps/stepsTracker.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/Steps/stepsTracker.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/distance/distanceTracker.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/distance/distanceTracker.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/heartrate/heartrateTracker.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/syncHealthData.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -64,20 +64,10 @@ class _HealthDataListState extends State<HealthDataList> {
), ),
), ),
), ),
bottomSheet: Container( bottomSheet: syncHealthDataButton(),
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton(TranslationBase.of(context).syncHealthData, () {
print("ReadLast");
// readLast();
}),
),
),
); );
} }
List<Widget> myOptionsList(BuildContext context) { List<Widget> myOptionsList(BuildContext context) {
List<Widget> medical = List(); List<Widget> medical = List();
@ -123,7 +113,6 @@ class _HealthDataListState extends State<HealthDataList> {
return medical; return medical;
} }
// void readLast() async { // void readLast() async {
// print("ReadLast"); // print("ReadLast");
// final result = await FitKit.readLast(DataType.DISTANCE); // final result = await FitKit.readLast(DataType.DISTANCE);

@ -0,0 +1,274 @@
import 'package:collection/collection.dart';
import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart';
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.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/dialogs/alert_dialog.dart';
import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class syncHealthDataButton extends StatefulWidget {
double marginTop;
double hight;
double minWidth;
syncHealthDataButton({this.marginTop, this.hight, this.minWidth});
@override
_syncHealthDataButtonState createState() => _syncHealthDataButtonState();
}
class _syncHealthDataButtonState extends State<syncHealthDataButton> {
List<DataType> dataTypes = List();
List<healthData> Med_InsertTransactionsInputsList = new List();
List<healthData> Med_InsertTransactionsInputsList2 = new List();
List<healthData> sleepDataList = new List();
List<healthData> healthDataList = new List();
int TransactionsListID = 1;
int MedCategoryID = 0;
@override
void initState() {
dataTypes.add(DataType.DISTANCE);
dataTypes.add(DataType.STEP_COUNT);
dataTypes.add(DataType.HEART_RATE);
// dataTypes.add(DataType.SLEEP);
// dataTypes.add(DataType.ENERGY);
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: DefaultButton(TranslationBase.of(context).syncHealthData, () {
print("ReadAll");
readAll();
}),
),
);
}
void readAll() async {
TransactionsListID = 1;
var MedSubCategoryID = 0;
double value = 0.0;
GifLoaderDialogUtils.showMyDialog(context);
Med_InsertTransactionsInputsList.clear();
var date;
var differenceInHours;
String strDifferenceInHours;
var differenceInMinutes;
String strDifferenceInMinutes;
var today = DateTime.now();
var yearNum = DateFormat('y').format(today).toString();
var firstDayOfTheYear = DateTime.parse(yearNum + "-" + "01" + "-" + "01");
if (await FitKit.requestPermissions(dataTypes)) {
for (DataType type in dataTypes) {
final results = await FitKit.read(
type,
dateFrom: firstDayOfTheYear,
dateTo: DateTime.now(),
limit: 1000500,
);
if (type == DataType.DISTANCE) {
MedCategoryID = 7;
} else if (type == DataType.STEP_COUNT) {
MedCategoryID = 6;
} else if (type == DataType.HEART_RATE) {
MedCategoryID = 3;
}
results.forEach((result) {
// print("in forEach");
date = result.dateTo;
if (result.value.runtimeType.toString() == "int") {
value = double.parse(result.value.toString());
} else {
value = result.value;
}
MedSubCategoryID = 0;
if (MedCategoryID == 4) {
differenceInHours = null;
var sleepDate = result.dateFrom.toString().substring(0, 10);
DateTime dateFrom = result.dateFrom;
DateTime dateTo = result.dateTo;
differenceInMinutes = dateTo.difference(dateFrom).inMinutes;
differenceInMinutes > 59 ? differenceInHours = differenceInMinutes / 60 : differenceInMinutes = differenceInMinutes;
if (differenceInHours != null && differenceInHours != 0) {
differenceInHours = differenceInHours.toInt();
differenceInMinutes = differenceInMinutes % 60;
differenceInHours < 10 ? strDifferenceInHours = "0" + differenceInHours.toString() : strDifferenceInHours = differenceInHours.toString();
} else {
strDifferenceInHours = "00";
differenceInHours = 00;
}
differenceInMinutes < 10 ? strDifferenceInMinutes = "0" + differenceInMinutes.toString() : strDifferenceInMinutes = differenceInMinutes.toString();
sleepDate = DateTime.parse(sleepDate + " " + strDifferenceInHours + ":" + strDifferenceInMinutes + ":" + "00.00").toString();
String hours = sleepDate.substring(11, sleepDate.indexOf(":"));
print(hours);
String minutes = sleepDate.substring(sleepDate.indexOf(":") + 1, sleepDate.indexOf(":") + 3);
print(minutes);
if (value == 0 || value == 109) {
print("in Bed");
MedSubCategoryID = 1;
value = double.parse(hours + "." + minutes);
print("value");
print(value);
} else if (value == 1 || value == 110) {
print("Sleep");
MedSubCategoryID = 2;
value = double.parse(hours + "." + minutes);
print("value");
print(value);
}
}
date = DateUtil.convertDateToString(date);
Med_InsertTransactionsInputsList.add(
healthData(MedCategoryID: MedCategoryID, MedSubCategoryID: MedSubCategoryID, MachineDate: date, Value: value, TransactionsListID: TransactionsListID++, Notes: ""));
});
}
}
getAllHealthDataLists();
}
void getAllHealthDataLists() {
var totalSteps = 0.0;
var totalDistance = 0.0;
// double totalCalories = 0.0 ;
double totalHeartRate = 0.0;
double avgTotalHeartRate = 0.0;
var counter = 0;
List data = [];
TransactionsListID = 1;
DateTime date;
sleepDataList.clear();
Med_InsertTransactionsInputsList.forEach((result) {
data.add(result.toJson());
});
Med_InsertTransactionsInputsList2.clear();
var newMap = groupBy(data, (obj) => DateUtil.convertStringToDate(obj['MachineDate']).toString().substring(0, 10));
newMap.forEach((key, value) {
totalSteps = 0.0;
totalDistance = 0.0;
totalHeartRate = 0.0;
avgTotalHeartRate = 0.0;
counter = 0;
date = DateTime.parse(key);
value.forEach((element) {
if (element['MedCategoryID'] == 6) {
MedCategoryID = 6;
totalSteps += element['Value'];
} else if (element['MedCategoryID'] == 7) {
MedCategoryID = 7;
// to convert from meter to km
totalDistance += (element['Value'] * 0.001);
} else if (element['MedCategoryID'] == 3) {
print("HeartRate");
MedCategoryID = 3;
counter++;
totalHeartRate += element['Value'];
} else if (element['MedCategoryID'] == 4) {
print("sleeeeep");
sleepDataList.add(new healthData(
MedCategoryID: 4,
MedSubCategoryID: element['MedSubCategoryID'],
MachineDate: DateUtil.convertDateToString(date),
Value: element['Value'],
TransactionsListID: TransactionsListID++,
Notes: ""));
Med_InsertTransactionsInputsList2.add(new healthData(
MedCategoryID: 4,
MedSubCategoryID: element['MedSubCategoryID'],
MachineDate: DateUtil.convertDateToString(date),
Value: element['Value'],
TransactionsListID: TransactionsListID++,
Notes: ""));
}
// else if(element['MedCategoryID'] == 8){
//
// totalCalories += element['Value'] ;
// }
});
if (counter == 0) {
counter = 1;
}
if (totalHeartRate == 0) {
avgTotalHeartRate = 0;
} else {
avgTotalHeartRate = totalHeartRate / counter;
}
Med_InsertTransactionsInputsList2.add(
new healthData(MedCategoryID: 6, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: totalSteps, TransactionsListID: TransactionsListID++, Notes: ""));
Med_InsertTransactionsInputsList2.add(
new healthData(MedCategoryID: 7, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: totalDistance, TransactionsListID: TransactionsListID++, Notes: ""));
Med_InsertTransactionsInputsList2.add(
new healthData(MedCategoryID: 3, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: avgTotalHeartRate, TransactionsListID: TransactionsListID++, Notes: ""));
// Med_InsertTransactionsInputsList2.add(new healthData(MedCategoryID: 8 , MedSubCategoryID: 0 , MachineDate: DateUtil.convertDateToStringWithBackSlash(date) , Value: totalCalories , TransactionsListID: TransactionsListID++ , Notes: ""));
});
GifLoaderDialogUtils.hideDialog(context);
AlertDialogBox dialog = new AlertDialogBox(
context: context,
confirmMessage: TranslationBase.of(context).alreadySynced,
okText: TranslationBase.of(context).ok,
okFunction: () => {
AlertDialogBox.closeAlertDialog(context),
},
);
dialog.showAlertDialog(context);
}
addInsertTransactionsInputsList() {
if (Med_InsertTransactionsInputsList2.isNotEmpty) {
SmartWatchIntegrationService service = new SmartWatchIntegrationService();
service.insertPatientHealthData(Med_InsertTransactionsInputsList2, context).then((res) {
print(res);
}).catchError((err) {
print(err);
});
} else {
return;
}
}
}

@ -40,7 +40,7 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayo
if(viewModel.service.customer != null) { if(viewModel.service.customer != null) {
var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id); var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id);
await viewModel.service.addProductToCart(request, context: context).then((response){ await viewModel.service.addProductToCart(request, context: context).then((response){
appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount); // appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error);
}); });
@ -50,7 +50,7 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayo
@override @override
void afterFirstLayout(BuildContext context) async{ void afterFirstLayout(BuildContext context) async{
appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount); // appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
} }
@override @override

@ -87,7 +87,7 @@ class _PackagesCartPageState extends State<PackagesCartPage>
'Failed to place order, please try again later'); 'Failed to place order, please try again later');
} }
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error.toString());
}); });
} }
@ -217,7 +217,7 @@ class _PackagesCartPageState extends State<PackagesCartPage>
{@required int orderId, @required bool withStatus, dynamic data}) async { {@required int orderId, @required bool withStatus, dynamic data}) async {
viewModel.service.getOrderById(orderId, context: context).then((value) { viewModel.service.getOrderById(orderId, context: context).then((value) {
var heading = withStatus ? "Success" : "Failed"; var heading = withStatus ? "Success" : "Failed";
var title = "Your order has been placed successfully"; var title = withStatus ? "Your order has been placed successfully" : "Failed to place your order";
var subTitle = "Order# ${value.data.customOrderNumber}"; var subTitle = "Order# ${value.data.customOrderNumber}";
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => PackageOrderCompletedPage( builder: (context) => PackageOrderCompletedPage(
@ -231,7 +231,7 @@ class _PackagesCartPageState extends State<PackagesCartPage>
// /* Payment Footer Widgets */ // /* Payment Footer Widgets */
// --------------------------- // ---------------------------
String _selectedPaymentMethod; String _selectedPaymentMethod;
Map _selectedPaymentParams; Map<dynamic,dynamic> _selectedPaymentParams;
Widget _paymentOptions(BuildContext context, Function(String) onSelected, {PackagesViewModel viewModel}) { Widget _paymentOptions(BuildContext context, Function(String) onSelected, {PackagesViewModel viewModel}) {
double height = 30; double height = 30;
@ -258,7 +258,7 @@ Widget _paymentOptions(BuildContext context, Function(String) onSelected, {Packa
Future<String> selectTamaraPaymentOption() async{ Future<String> selectTamaraPaymentOption() async{
final tamara_options = await viewModel.service.getTamaraOptions(context: context, showLoading: true); final tamara_options = await viewModel.service.getTamaraOptions(context: context, showLoading: true);
final selected = await SingleSelectionDialog<TamaraPaymentOption>(tamara_options, title: 'Select the tamara installment plan').show(context); final selected = await SingleSelectionDialog<TamaraPaymentOption>(tamara_options, icon: Image.asset('assets/images/new-design/tamara.png'), title: TranslationBase.of(context).tamaraInstPlan).show(context);
return selected.name; return selected.name;
} }
@ -271,13 +271,16 @@ Widget _paymentOptions(BuildContext context, Function(String) onSelected, {Packa
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
InkWell( InkWell(
child: buttonContent(_selectedPaymentMethod == "tamara", 'mada.png'), child: buttonContent(_selectedPaymentMethod == "tamara", 'tamara.png'),
onTap: () async{ onTap: () async{
final tamara_option = await selectTamaraPaymentOption(); final tamara_option = await selectTamaraPaymentOption();
_selectedPaymentParams = {"channel" : "Web", "payment_method_system_name" : "Payments.Tamara", "payment_option" : tamara_option}; _selectedPaymentParams = {"channel" : "Web", "payment_method_system_name" : "Payments.Tamara", "payment_option" : tamara_option};
onSelected("tamara"); onSelected("tamara");
}, },
), ),
SizedBox(
width: 5,
),
InkWell( InkWell(
child: buttonContent(_selectedPaymentMethod == "mada", 'mada.png'), child: buttonContent(_selectedPaymentMethod == "mada", 'mada.png'),
onTap: () { onTap: () {
@ -305,17 +308,17 @@ Widget _paymentOptions(BuildContext context, Function(String) onSelected, {Packa
onSelected("mastercard"); onSelected("mastercard");
}, },
), ),
SizedBox( // SizedBox(
width: 5, // width: 5,
), // ),
InkWell( // InkWell(
child: buttonContent( // child: buttonContent(
_selectedPaymentMethod == "installment", 'installment.png'), // _selectedPaymentMethod == "installment", 'installment.png'),
onTap: () { // onTap: () {
_selectedPaymentParams = {"payment_method_system_name" : "Payments.PayFort", "payment_option" : "INSTALLMENT"}; // _selectedPaymentParams = {"payment_method_system_name" : "Payments.PayFort", "payment_option" : "INSTALLMENT"};
onSelected("installment"); // onSelected("installment");
}, // },
), // ),
], ],
), ),
), ),

@ -96,9 +96,9 @@ class _PackagesHomePageState extends State<PackagesHomePage> with AfterLayoutMix
if(viewModel.service.customer != null) { if(viewModel.service.customer != null) {
var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id); var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id);
await viewModel.service.addProductToCart(request, context: context).then((response){ await viewModel.service.addProductToCart(request, context: context).then((response){
appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount); // appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error.toString());
}); });
} }
} }

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/entity_checkbox_list.dart'; import 'package:diplomaticquarterapp/widgets/others/entity_checkbox_list.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -26,13 +27,12 @@ import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/pages/sub_categories_modalsheet.dart'; import 'package:diplomaticquarterapp/pages/sub_categories_modalsheet.dart';
import 'base/base_view.dart'; import 'base/base_view.dart';
class ParentCategorisePage extends StatefulWidget { class ParentCategorisePage extends StatefulWidget {
String id; String id;
String titleName; String titleName;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
ParentCategorisePage({this.id, this.titleName}); ParentCategorisePage({this.id, this.titleName});
@ -46,9 +46,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
String titleName; String titleName;
final dynamic productID; final dynamic productID;
_ParentCategorisePageState({
this.id,
_ParentCategorisePageState({this.id, this.titleName, this.productID,}); this.titleName,
this.productID,
});
Map<String, bool> values = {'huusam': false, 'ali': false, 'noor': false}; Map<String, bool> values = {'huusam': false, 'ali': false, 'noor': false};
bool checkedBrands = false; bool checkedBrands = false;
@ -75,9 +77,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
allowAny: true, allowAny: true,
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model,
Widget child) => Widget child) =>
PharmacyAppScaffold( AppScaffold(
isPharmacy: true,
appBarTitle: titleName, appBarTitle: titleName,
isBottomBar: false, isBottomBar: true,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
isShowDecPage: false, isShowDecPage: false,
@ -139,8 +142,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
page: SubCategoriseModalsheet( page: SubCategoriseModalsheet(
// id: model.categorise[0].id, // id: model.categorise[0].id,
// titleName: model.categorise[0].name, // titleName: model.categorise[0].name,
) )),
),
); );
// showModalBottomSheet<void>( // showModalBottomSheet<void>(
// isScrollControlled: true, // isScrollControlled: true,
@ -348,13 +350,13 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
width: 10.0, width: 10.0,
), ),
Texts( Texts(
TranslationBase.of(
TranslationBase.of(context).refine, context)
.refine,
// 'Refine', // 'Refine',
fontWeight: fontWeight:
FontWeight.w600, FontWeight.w600,
), ),
SizedBox( SizedBox(
width: 250.0, width: 250.0,
@ -362,7 +364,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
InkWell( InkWell(
child: Texts( child: Texts(
// 'Close', // 'Close',
TranslationBase.of(context).closeIt, TranslationBase.of(
context)
.closeIt,
color: Colors.red, color: Colors.red,
fontWeight: fontWeight:
FontWeight.w600, FontWeight.w600,
@ -383,10 +387,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Column( Column(
children: [ children: [
ExpansionTile( ExpansionTile(
title: Texts(
title: Texts( TranslationBase.of( TranslationBase.of(
context) context)
.categorise), .categorise),
children: [ children: [
ProcedureListWidget( ProcedureListWidget(
model: model, model: model,
@ -424,9 +428,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
color: Colors.black12, color: Colors.black12,
), ),
ExpansionTile( ExpansionTile(
title: Texts( TranslationBase.of( title: Texts(
context) TranslationBase.of(
.brands), context)
.brands),
children: [ children: [
ProcedureListWidget( ProcedureListWidget(
model: model, model: model,
@ -465,9 +470,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
color: Colors.black12, color: Colors.black12,
), ),
ExpansionTile( ExpansionTile(
title: Texts( TranslationBase.of( title: Texts(
context) TranslationBase.of(
.price), context)
.price),
children: [ children: [
Container( Container(
color: Color( color: Color(
@ -558,14 +564,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Container( Container(
width: 100, width: 100,
child: Button( child: Button(
label: TranslationBase.of(
label: TranslationBase.of( context)
context)
.reset, .reset,
backgroundColor: Colors.red, backgroundColor:
Colors.red,
), ),
), ),
SizedBox( SizedBox(
@ -629,13 +632,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Navigator.pop( Navigator.pop(
context); context);
}, },
label: TranslationBase.of(
label: TranslationBase.of( context)
context)
.apply, .apply,
backgroundColor: Colors.green, backgroundColor:
Colors
.green,
), ),
), ),
], ],
@ -1131,7 +1133,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
padding: padding:
const EdgeInsets const EdgeInsets
.only( .only(
top: 4, bottom: 4), top: 4,
bottom: 4),
child: Texts( child: Texts(
"SAR ${model.parentProducts[index].price}", "SAR ${model.parentProducts[index].price}",
bold: true, bold: true,
@ -1167,30 +1170,50 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
], ],
), ),
), ),
widget.authenticatedUserObject
widget.authenticatedUserObject.isLogin ? .isLogin
Container( ? Container(
child: IconButton( child: IconButton(
icon: Icon(Icons.shopping_cart, icon: Icon(
size: 18, Icons
color: Colors.blue,), .shopping_cart,
onPressed: () async { size: 18,
if(model.parentProducts[index].rxMessage == null){ color:
GifLoaderDialogUtils.showMyDialog(context); Colors.blue,
await addToCartFunction(1, model.parentProducts[index].id); ),
GifLoaderDialogUtils.hideDialog(context); onPressed:
Navigator.push( () async {
context, if (model
FadePage(page: CartOrderPage())); .parentProducts[
} index]
else{ .rxMessage ==
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); null) {
} GifLoaderDialogUtils
.showMyDialog(
} context);
await addToCartFunction(
), 1,
): Container(), model
.parentProducts[
index]
.id);
GifLoaderDialogUtils
.hideDialog(
context);
Navigator.push(
context,
FadePage(
page:
CartOrderPage()));
} else {
AppToast.showErrorToast(
message: TranslationBase.of(
context)
.needPrescription);
}
}),
)
: Container(),
], ],
), ),
), ),
@ -1238,8 +1261,6 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
), ),
), ),
)); ));
} }
addToCartFunction(quantity, itemID) async { addToCartFunction(quantity, itemID) async {
@ -1264,7 +1285,4 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
} }
return false; return false;
} }
} }

@ -33,105 +33,119 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
body: Container( body: SingleChildScrollView(
child: Column( child: Container(
children: [ child: Column(
Container( children: [
color: Colors.white, Container(
alignment: color: Colors.white,
languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, alignment: languageID == 'ar'
padding: languageID == 'ar' ? Alignment.topRight
? EdgeInsets.only(right: 10.0, top: 10.0) : Alignment.topLeft,
: EdgeInsets.only(left: 10.0, top: 10.0), padding: languageID == 'ar'
child: Text( ? EdgeInsets.only(right: 10.0, top: 10.0)
TranslationBase.of(context).topBrands, : EdgeInsets.only(left: 10.0, top: 10.0),
style: TextStyle( child: Text(
fontWeight: FontWeight.bold, TranslationBase.of(context).topBrands,
style: TextStyle(
fontWeight: FontWeight.bold,
),
), ),
), ),
), Container(
Container( height: 220,
height: 220, width: double.infinity,
width: double.infinity,
color: Colors.white,
child: topBrand(context),
),
SizedBox(
height: 10,
),
Container(
height: MediaQuery.of(context).size.height * 0.076,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white, color: Colors.white,
child: topBrand(context),
), ),
child: InkWell( SizedBox(
child: Padding( height: 10,
padding: EdgeInsets.all(8.0), ),
child: Row( Container(
//crossAxisAlignment: CrossAxisAlignment.center, height: MediaQuery.of(context).size.height * 0.076,
mainAxisAlignment: MainAxisAlignment.start, decoration: BoxDecoration(
children: [ borderRadius: BorderRadius.circular(5.0),
Icon(Icons.search, size: 25.0), color: Colors.white,
SizedBox(
width: 15.0,
),
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
), ),
onTap: () { child: topBrand(context),
Navigator.push(
context,
FadePage(page: SearchBrandsPage()),
);
},
), ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Container(
Container( height: MediaQuery.of(context).size.height * 0.056,
height: 250, decoration: BoxDecoration(
width: double.infinity, borderRadius: BorderRadius.circular(5.0),
color: Colors.white, color: Colors.white,
child: ListView.builder( ),
itemCount: model.brandsListList.length, child: InkWell(
itemBuilder: (BuildContext context, int index) { child: Padding(
return InkWell( padding: EdgeInsets.all(8.0),
child: Container( child: Row(
margin: EdgeInsets.only(top: 50, left: 10), //crossAxisAlignment: CrossAxisAlignment.center,
child: Column( mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
mainAxisAlignment: MainAxisAlignment.start, Icon(Icons.search, size: 25.0),
children: [ SizedBox(
languageID == 'ar' width: 15.0,
? Text(model.brandsListList[index].namen)
: Text(model.brandsListList[index].name),
SizedBox(
height: 3,
),
Divider(height: 1, color: Colors.grey)
],
), ),
), Texts(
onTap: () { TranslationBase.of(context).searchProductHere,
Navigator.push( fontSize: 13,
context, )
MaterialPageRoute( ],
builder: (context) => FinalProductsPage( ),
id: model.brandsListList[index].id ),
.toString(), onTap: () {
)), Navigator.push(
); context,
}, FadePage(page: SearchBrandsPage()),
); );
}), },
), ),
], ),
SizedBox(
height: 10,
),
Container(
height: 250,
width: double.infinity,
color: Colors.white,
child: ListView.builder(
itemCount: model.brandsListList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
child: Container(
margin: EdgeInsets.only(top: 50, left: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
languageID == 'ar'
? Text(model.brandsListList[index].namen)
: Text(model.brandsListList[index].name),
SizedBox(
height: 3,
),
Divider(height: 1, color: Colors.grey)
],
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(
id: model.brandsListList[index].id
.toString(),
)),
);
},
);
}),
),
],
),
), ),
), ),
), ),

@ -55,8 +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: true, isShowDecPage: false,
isMainPharmacyPages: true,
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: !(model.cartResponse.shoppingCarts == null || body: !(model.cartResponse.shoppingCarts == null ||
@ -103,8 +105,8 @@ class _CartOrderPageState extends State<CartOrderPage> {
.shoppingCarts[index]) .shoppingCarts[index])
.then((value) { .then((value) {
if (model.state != ViewState.Error) { if (model.state != ViewState.Error) {
appScaffold.appBar.badgeUpdater( // appScaffold.appBar.badgeUpdater(
'${value.quantityCount ?? 0}'); // '${value.quantityCount ?? 0}');
} }
if (model.state == if (model.state ==
ViewState.ErrorLocal) { ViewState.ErrorLocal) {
@ -117,8 +119,8 @@ class _CartOrderPageState extends State<CartOrderPage> {
.shoppingCarts[index]) .shoppingCarts[index])
.then((value) { .then((value) {
if (model.state != ViewState.Error) { if (model.state != ViewState.Error) {
appScaffold.appBar.badgeUpdater( // appScaffold.appBar.badgeUpdater(
'${value.quantityCount ?? 0}'); // '${value.quantityCount ?? 0}');
} }
}); });
})) }))

@ -63,11 +63,11 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
color: Color(0xFFF1F1F1), color: Color(0xFFF1F1F1),
child: Column( child: Column(
children: [ children: [
SelectAddressWidget(model, widget.addresses), SelectAddressWidget(model, widget.addresses,changeMainState),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SelectPaymentOptionWidget(model), SelectPaymentOptionWidget(model, changeMainState),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -235,4 +235,9 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
), ),
); );
} }
changeMainState(){
setState(() {
});
}
} }

@ -89,7 +89,7 @@ class PaymentBottomWidget extends StatelessWidget {
message: message:
"Order has been placed successfully!!"); "Order has been placed successfully!!");
openPayment( openPayment(
model.orderListModel[0], model.user); model.orderListModel[0], model.authenticatedUserObject.user);
} else { } else {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
} }

@ -2,6 +2,7 @@ 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/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/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/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -25,39 +26,35 @@ import 'package:provider/provider.dart';
class SelectAddressWidget extends StatefulWidget { class SelectAddressWidget extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
final List<Addresses> addresses; final List<Addresses> addresses;
final Function changeMainState;
SelectAddressWidget(this.model, this.addresses); SelectAddressWidget(this.model, this.addresses, this.changeMainState);
@override @override
_SelectAddressWidgetState createState() => _SelectAddressWidgetState(); _SelectAddressWidgetState createState() => _SelectAddressWidgetState();
} }
class _SelectAddressWidgetState extends State<SelectAddressWidget> { class _SelectAddressWidgetState extends State<SelectAddressWidget> {
Addresses address; AddressInfo address;
_navigateToAddressPage() { _navigateToAddressPage(String identificationNo) {
Navigator.push(context, FadePage(page: PharmacyAddressesPage())) Navigator.push(context, FadePage(page: PharmacyAddressesPage()))
.then((result) { .then((result) {
if (result != null) { if (result != null) {
address = result; address = result;
widget.model.paymentCheckoutData.address = address; widget.model.paymentCheckoutData.address =
widget.model.getInformationsByAddress(); Addresses.fromJson(address.toJson());
widget.model.getInformationsByAddress(identificationNo);
widget.changeMainState();
} }
/* setState(() {
if (result != null) {
address = result;
widget.model.paymentCheckoutData.address = address;
widget.model.getInformationsByAddress();
}
})*/
}); });
} }
@override @override
void initState() { void initState() {
if (widget.model.paymentCheckoutData.address != null) { if (widget.model.paymentCheckoutData.address != null) {
address = widget.model.paymentCheckoutData.address; address = AddressInfo.fromJson(
widget.model.paymentCheckoutData.address.toJson());
} }
super.initState(); super.initState();
} }
@ -69,7 +66,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
color: Colors.white, color: Colors.white,
child: address == null child: address == null
? InkWell( ? InkWell(
onTap: () => {_navigateToAddressPage()}, onTap: () => {_navigateToAddressPage(model.user.patientIdentificationNo)},
child: Container( child: Container(
margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12), margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
child: Row( child: Row(
@ -128,7 +125,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
), ),
), ),
InkWell( InkWell(
onTap: () => {_navigateToAddressPage()}, onTap: () => {_navigateToAddressPage(model.authenticatedUserObject.user.patientIdentificationNo)},
child: Texts( child: Texts(
TranslationBase.of(context).changeAddress, TranslationBase.of(context).changeAddress,
fontSize: 12, fontSize: 12,

@ -8,8 +8,9 @@ import 'package:flutter/material.dart';
class SelectPaymentOptionWidget extends StatefulWidget { class SelectPaymentOptionWidget extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
final Function changeMainState;
SelectPaymentOptionWidget(this.model); SelectPaymentOptionWidget(this.model, this.changeMainState);
@override @override
_SelectPaymentOptionWidgetState createState() => _SelectPaymentOptionWidgetState(); _SelectPaymentOptionWidgetState createState() => _SelectPaymentOptionWidgetState();
@ -19,14 +20,17 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
PaymentOption paymentOption; PaymentOption paymentOption;
_navigateToPaymentOption() { _navigateToPaymentOption() {
Navigator.push(context, FadePage(page: PaymentMethodSelectPage())).then((result) => { Navigator.push(context, FadePage(page: PaymentMethodSelectPage()))
setState(() { .then((result) => {
if (result != null) { setState(() {
paymentOption = result; if (result != null) {
widget.model.paymentCheckoutData.paymentOption = paymentOption; paymentOption = result;
} widget.model.paymentCheckoutData.paymentOption =
}) paymentOption;
}); }
widget.changeMainState();
})
});
} }
@override @override

@ -48,18 +48,18 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
return BaseView<LacumRegistrationViewModel>( return BaseView<LacumRegistrationViewModel>(
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: appBarTitle: "${TranslationBase.of(context).register} ${TranslationBase.of(context).lakum}",
"${TranslationBase.of(context).register} ${TranslationBase.of(context).lakum}",
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
isPharmacy: true,
showPharmacyCart: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: SizedBox( child: SizedBox(
height: height: mediaQuery.size.height - 60 - mediaQuery.padding.top,
mediaQuery.size.height - 60 - mediaQuery.padding.top,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -130,35 +130,26 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).prefferedLanguage,
.prefferedLanguage,
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Color(0xff8a8a8a), color: Color(0xff8a8a8a),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
RadioGroupDialog dialog = RadioGroupDialog dialog = new RadioGroupDialog(
new RadioGroupDialog( context: context,
context: context, title: TranslationBase.of(context).prefferedLanguage,
title: TranslationBase.of(context) okText: TranslationBase.of(context).confirm,
.prefferedLanguage, cancelText: TranslationBase.of(context).cancel_nocaps,
okText: list: languages,
TranslationBase.of(context) okFunction: (selectedValue) {
.confirm, setState(() {
cancelText: selectedLanguage = selectedValue;
TranslationBase.of(context) });
.cancel_nocaps, print("selectedLanguage = ${selectedValue.name}");
list: languages, },
okFunction: (selectedValue) { cancelFunction: () => {});
setState(() {
selectedLanguage =
selectedValue;
});
print(
"selectedLanguage = ${selectedValue.name}");
},
cancelFunction: () => {});
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
@ -170,11 +161,8 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
child: TextField( child: TextField(
enabled: false, enabled: false,
decoration: InputDecoration( decoration: InputDecoration(
suffixIcon: suffixIcon: Icon(Icons.arrow_drop_down),
Icon(Icons.arrow_drop_down), hintText: selectedLanguage == null ? "${TranslationBase.of(context).prefferedLanguage}" : "${selectedLanguage.name}",
hintText: selectedLanguage == null
? "${TranslationBase.of(context).prefferedLanguage}"
: "${selectedLanguage.name}",
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 16, fontSize: 16,
color: Colors.black, color: Colors.black,
@ -192,12 +180,10 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
), ),
Container( Container(
color: Colors.green, color: Colors.green,
margin: EdgeInsets.all(8), margin: EdgeInsets.all(40),
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).register, TranslationBase.of(context).register,
backgroundColor: canSubmit backgroundColor: canSubmit ? Color(0xff339933) : Color(0xff99cc99),
? Color(0xff339933)
: Color(0xff99cc99),
textColor: Colors.white, textColor: Colors.white,
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
@ -208,18 +194,13 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
context, context,
FadePage( FadePage(
page: LakumTermsConditions( page: LakumTermsConditions(
widget widget.patientIdentificationNo, _firstNameController.text, _lastNameController.text, _mobileNumberController.text, selectedLanguage.id)))
.patientIdentificationNo, .then(
_firstNameController.text, (status) => {
_lastNameController.text, if (status == 200) {Navigator.pop(context, "")}
_mobileNumberController // back to previous page
.text, },
selectedLanguage.id))) );
.then((status) => {
if (status == 200)
{Navigator.pop(context, "")}
// back to previous page
});
} }
: null, : null,
), ),

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerYear.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerYear.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-registration-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-setting-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-setting-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-transfer-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-transfer-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-points-year-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-points-year-page.dart';
@ -11,278 +13,323 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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 'lacum-activitaion-vida-page.dart'; import 'lacum-activitaion-vida-page.dart';
class LakumMainPage extends StatelessWidget { class LakumMainPage extends StatelessWidget {
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
projectViewModel = Provider.of(context);
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
onModelReady: (model) => model.getLacumData(), onModelReady: (model) => model.getLacumData(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).lakum, appBarTitle: TranslationBase.of(context).lakum,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
appBarIcons: _buildAppBarICons(context, model), appBarIcons: _buildAppBarICons(context, model),
// preferredSize: mediaQuery.size.height * 0.20, // preferredSize: mediaQuery.size.height * 0.20,
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)
? Column(
children: [
Stack(
children: [
Container(
height: mediaQuery.size.height * 0.15,
color: Colors.green,
),
Column(
children: [
SizedBox(
height: mediaQuery.size.height * 0.02,
),
Container(
width: mediaQuery.size.width * 1,
child: LakumBannerWidget(
model, mediaQuery, true)),
],
)
],
),
SizedBox(
width: 8,
),
LacumPointsWidget(
mediaQuery,
2,
TranslationBase.of(context).gained,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model.lacumGroupInformation model.lacumGroupInformation
.lakumInquiryInformationObjVersion != .lakumInquiryInformationObjVersion.gainedPoints,
null) model
? Column( .lacumGroupInformation
children: [ .lakumInquiryInformationObjVersion
Stack( .gainedPointsAmountPerYear),
children: [ SizedBox(
Container( height: 20,
height: mediaQuery.size.height * 0.15, ),
color: Colors.green, Container(
), height: 125,
Column( margin: EdgeInsets.symmetric(horizontal: 16),
children: [ child: ListView(
SizedBox( scrollDirection: Axis.horizontal,
height: mediaQuery.size.height * 0.02, children: <Widget>[
), LacumPointsWidget(
Container( mediaQuery,
width: mediaQuery.size.width * 1, 1,
child: LakumBannerWidget( TranslationBase.of(context).balance,
model, mediaQuery, true)), model
], .lacumGroupInformation
) .lakumInquiryInformationObjVersion
], .pointsBalanceAmount,
), model
SizedBox( .lacumGroupInformation
height: 20, .lakumInquiryInformationObjVersion
), .pointsBalance,
LakumHomeButtons(mediaQuery, model), null),
SizedBox( SizedBox(
height: 20, width: 8,
),
Container(
height: 125,
margin: EdgeInsets.symmetric(horizontal: 16),
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
LacumPointsWidget(
mediaQuery,
1,
TranslationBase.of(context).balance,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalance,
null),
SizedBox(
width: 8,
),
LacumPointsWidget(
mediaQuery,
2,
TranslationBase.of(context).gained,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPointsAmountPerYear),
SizedBox(
width: 8,
),
LacumPointsWidget(
mediaQuery,
3,
TranslationBase.of(context).consumed,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount !=
null
? int.parse(model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount)
: 0,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmountPerYear),
SizedBox(
width: 8,
),
LacumPointsWidget(
mediaQuery,
4,
TranslationBase.of(context).transferred,
0,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPointsAmountPerYear),
],
),
), ),
LacumPointsWidget(
mediaQuery,
2,
TranslationBase.of(context).gained,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPointsAmountPerYear),
SizedBox( SizedBox(
height: 20, width: 8,
), ),
LacumPointsWidget(
mediaQuery,
3,
TranslationBase.of(context).consumed,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount !=
null
? int.parse(model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount)
: 0,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmountPerYear),
SizedBox( SizedBox(
height: 8, width: 8,
width: double.infinity,
child: Container(
color: Color(0xffefefef),
),
), ),
Container( LacumPointsWidget(
margin: EdgeInsets.symmetric( mediaQuery,
vertical: 16, horizontal: 8), 4,
child: Row( TranslationBase.of(context).transferred,
mainAxisAlignment: 0,
MainAxisAlignment.spaceBetween, model
children: [ .lacumGroupInformation
Row( .lakumInquiryInformationObjVersion
children: [ .transferPoints,
Image.asset( model
"assets/images/pharmacy_module/lakum/expired_icon.png", .lacumGroupInformation
fit: BoxFit.fill, .lakumInquiryInformationObjVersion
width: 25, .transferPointsAmountPerYear),
height: 25, ],
), ),
Padding( ),
padding: LacumPointsWidget(
EdgeInsets.symmetric(horizontal: 8), mediaQuery,
child: Texts(TranslationBase.of(context).Expired, 3,
TranslationBase.of(context).consumed,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount !=
null
? int.parse(model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount)
: 0,
model.lacumGroupInformation
.lakumInquiryInformationObjVersion.consumedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmountPerYear),
SizedBox(
width: 8,
),
SizedBox(
height: 8,
width: double.infinity,
child: Container(
color: Color(0xffefefef),
),
),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset(
"assets/images/pharmacy_module/lakum/expired_icon.png",
fit: BoxFit.fill,
width: 25,
height: 25,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context).Expired,
// "Expired", // "Expired",
fontSize: 14,
),
)
],
),
Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.expiredPoints}${TranslationBase.of(context).lakumPoint} " ,
fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
], )
), ],
), ),
SizedBox( Texts(
height: 2, "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.expiredPoints}${TranslationBase.of(context).lakumPoint} ",
width: double.infinity, fontWeight: FontWeight.bold,
child: Container( fontSize: 14,
color: Color(0xffefefef),
),
), ),
Container( ],
margin: EdgeInsets.symmetric( ),
vertical: 16, horizontal: 8), ),
child: Row( // Texts(
mainAxisAlignment: // "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.expiredPoints} Points",
MainAxisAlignment.spaceBetween, // fontWeight: FontWeight.bold,
children: [ // fontSize: 14,
Row( // ),
children: [ Container(
Image.asset( margin:
"assets/images/pharmacy_module/lakum/waiting_gained_icon.png", EdgeInsets.symmetric(vertical: 16, horizontal: 8),
fit: BoxFit.fill, child: Row(
width: 20, mainAxisAlignment: MainAxisAlignment.spaceBetween,
height: 25, children: [
), Row(
Padding( children: [
padding: Image.asset(
EdgeInsets.symmetric(horizontal: 8), "assets/images/pharmacy_module/lakum/waiting_gained_icon.png",
child: Texts(TranslationBase.of(context).Waitinggained, fit: BoxFit.fill,
width: 20,
height: 25,
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context)
.Waitinggained,
// "Waiting gained", // "Waiting gained",
fontSize: 14, fontSize: 14,
),
)
],
),
Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold,
fontSize: 14,
),
],
),
),
SizedBox(
height: 2,
width: double.infinity,
child: Container(
color: Color(0xffefefef),
),
),
Container(
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 8),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset(
"assets/images/pharmacy_module/lakum/will_be_expired_icon.png",
fit: BoxFit.fill,
width: 25,
height: 25,
), ),
Padding( )
padding: ],
EdgeInsets.symmetric(horizontal: 8), ),
child: Texts(TranslationBase.of(context).WillBeExpired, Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold,
fontSize: 14,
),
])),
// Texts(
// "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points",
// fontWeight: FontWeight.bold,
// fontSize: 14,
// ),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset(
"assets/images/pharmacy_module/lakum/will_be_expired_icon.png",
fit: BoxFit.fill,
width: 25,
height: 25,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context).WillBeExpired,
// "Will Be Expired", // "Will Be Expired",
fontSize: 14,
),
)
],
),
Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsWillBeExpired} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
], )
), ],
), ),
SizedBox( Texts(
height: 2, "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsWillBeExpired} ${TranslationBase.of(context).lakumPoint}",
width: double.infinity, fontWeight: FontWeight.bold,
child: Container( fontSize: 14,
color: Color(0xffefefef),
),
), ),
], ],
) ),
: Container(), // Texts(
), // "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsWillBeExpired} Points",
), // fontWeight: FontWeight.bold,
)); // fontSize: 14,
// ),
),
SizedBox(
height: 2,
width: double.infinity,
child: Container(
color: Color(0xffefefef),
),
),
],
)
: Container(),
),
),
),
);
}
navigateToLakumRegister(BuildContext context) {
Navigator.pushReplacement(
context,
FadePage(
page: LakumRegistrationPage(
projectViewModel.user.patientIdentificationNo)));
} }
} }
@ -443,8 +490,7 @@ class LacumPointsWidget extends StatelessWidget {
FadePage(page: LakumPointsYearPage(pointsAmountPerYear))); FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
} else { } else {
AppToast.showErrorToast( AppToast.showErrorToast(
message: TranslationBase.of(context) message: TranslationBase.of(context).lakumMsg);
.lakumMsg);
// show snackBar No Details Points are there // show snackBar No Details Points are there
} }
} }
@ -497,7 +543,8 @@ class LacumPointsWidget extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).RIYAL, Texts(
TranslationBase.of(context).RIYAL,
// "RIYAL", // "RIYAL",
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -528,7 +575,8 @@ class LacumPointsWidget extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).point, Texts(
TranslationBase.of(context).point,
// "POINT", // "POINT",
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

@ -42,21 +42,24 @@ class _PharmacyPageState extends State<PharmacyPage> {
allowAny: true, allowAny: true,
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
title: "", title: "",
isShowAppBar: false,
isShowDecPage: false, isShowDecPage: false,
baseViewModel: model, baseViewModel: model,
isMainPharmacyPages: true,
isPharmacy: true,
isShowPharmacyAppbar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
//crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
BannerPager(model), BannerPager(model),
// GridViewButtons(model),
PrescriptionsWidget(), PrescriptionsWidget(),
// ShopByBrandWidget(), ShopByBrandWidget(),
RecentlyViewedWidget(), RecentlyViewedWidget(),
BestSellerWidget(), BestSellerWidget(),
ShopByBrandWidget(),
], ],
), ),
), ),

@ -7,7 +7,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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:hexcolor/hexcolor.dart';
import '../../../../../locator.dart'; import '../../../../../locator.dart';
import '../../../../../routes.dart'; import '../../../../../routes.dart';
@ -45,7 +44,7 @@ class _FooterWidgetState extends State<FooterWidget> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(0.0), Radius.circular(0.0),
), ),
border: Border.all(color: HexColor('#707070'), width: 0), border: Border.all(color: Color(0xFF707070), width: 0),
), ),
width: double.infinity, width: double.infinity,
height: quantityUI, height: quantityUI,

@ -1,10 +1,7 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
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/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/reviews_info.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/reviews_info.dart';
@ -14,7 +11,6 @@ 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/others/app_scaffold_widget.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/material.dart';
import 'availability_info.dart'; import 'availability_info.dart';
@ -106,8 +102,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
deleteFromWishlistFunction: () async { deleteFromWishlistFunction: () async {
await deleteFromWishlistFunction(itemID: itemID, model: model); await deleteFromWishlistFunction(itemID: itemID, model: model);
}, },
isInWishList:isInWishList, isInWishList: isInWishList,
addToCartFunction:addToCartFunction , addToCartFunction: addToCartFunction,
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
@ -125,8 +121,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
if (widget.product.discountDescription != null) if (widget.product.discountDescription != null) DiscountDescription(product: widget.product)
DiscountDescription(product: widget.product)
], ],
), ),
), ),
@ -144,15 +139,11 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
setState(() {}); setState(() {});
}, },
deleteFromWishlistFunction: (item) { deleteFromWishlistFunction: (item) {
deleteFromWishlistFunction( deleteFromWishlistFunction(itemID: item, model: model);
itemID: item, model: model);
setState(() {}); setState(() {});
}, },
notifyMeWhenAvailable: (context, itemId) { notifyMeWhenAvailable: (context, itemId) {
notifyMeWhenAvailable( notifyMeWhenAvailable(itemId: itemId, customerId: customerId, model: model);
itemId: itemId,
customerId: customerId,
model: model);
}, },
isInWishList: isInWishList, isInWishList: isInWishList,
), ),
@ -167,8 +158,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
vertical: 15, horizontal: 10),
child: Texts( child: Texts(
TranslationBase.of(context).specification, TranslationBase.of(context).specification,
fontSize: 15, fontSize: 15,
@ -205,16 +195,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
child: Text( child: Text(
TranslationBase.of(context).details, TranslationBase.of(context).details,
style: TextStyle( style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
fontSize: 16,
fontWeight: FontWeight.bold),
), ),
color: Colors.white, color: Colors.white,
), ),
CustomDivider( CustomDivider(
color: isDetails color: isDetails ? Colors.green : Colors.transparent,
? Colors.green
: Colors.transparent,
) )
], ],
), ),
@ -225,14 +211,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
children: [ children: [
FlatButton( FlatButton(
onPressed: () async { onPressed: () async {
if (widget.product.approvedTotalReviews > if (widget.product.approvedTotalReviews > 0) {
0) { GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog( await model.getProductReviewsData(widget.product.id);
context); GifLoaderDialogUtils.hideDialog(context);
await model.getProductReviewsData(
widget.product.id);
GifLoaderDialogUtils.hideDialog(
context);
} else { } else {
model.clearReview(); model.clearReview();
} }
@ -244,16 +226,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
child: Text( child: Text(
TranslationBase.of(context).reviews, TranslationBase.of(context).reviews,
style: TextStyle( style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
fontSize: 16,
fontWeight: FontWeight.bold),
), ),
color: Colors.white, color: Colors.white,
), ),
CustomDivider( CustomDivider(
color: isReviews color: isReviews ? Colors.green : Colors.transparent,
? Colors.green
: Colors.transparent,
), ),
], ],
), ),
@ -264,8 +242,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
children: [ children: [
FlatButton( FlatButton(
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context);
await model.getProductLocationData(); await model.getProductLocationData();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -277,16 +254,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
child: Text( child: Text(
TranslationBase.of(context).availability, TranslationBase.of(context).availability,
style: TextStyle( style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
fontSize: 16,
fontWeight: FontWeight.bold),
), ),
color: Colors.white, color: Colors.white,
), ),
CustomDivider( CustomDivider(
color: isAvailability color: isAvailability ? Colors.green : Colors.transparent,
? Colors.green
: Colors.transparent,
), ),
], ],
), ),
@ -315,12 +288,16 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
RecommendedProducts(product: widget.product,productDetailViewModel: model, RecommendedProducts(
product: widget.product,
productDetailViewModel: model,
addToWishlistFunction: (itemID) async { addToWishlistFunction: (itemID) async {
await addToWishlistFunction(itemID: itemID, model: model); await addToWishlistFunction(itemID: itemID, model: model);
}, deleteFromWishlistFunction: (itemID) async { },
deleteFromWishlistFunction: (itemID) async {
await deleteFromWishlistFunction(itemID: itemID, model: model); await deleteFromWishlistFunction(itemID: itemID, model: model);
},) },
)
], ],
), ),
), ),
@ -339,6 +316,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
)); ));
} }
addToShoppingCartFunction({quantity, itemID, ProductDetailViewModel model}) async {
await model.addToCartData(quantity, itemID);
}
addToWishlistFunction({itemID, ProductDetailViewModel model}) async { addToWishlistFunction({itemID, ProductDetailViewModel model}) async {
isInWishList = true; isInWishList = true;
await model.addToWishlistData(itemID); await model.addToWishlistData(itemID);
@ -350,31 +331,18 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
await model.deleteWishlistData(itemID); await model.deleteWishlistData(itemID);
setState(() {}); setState(() {});
} }
addToCartFunction(
{quantity,
itemID,
ProductDetailViewModel model}) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.addToCartData(quantity, itemID);
GifLoaderDialogUtils.hideDialog(context);
}
addToShoppingCartFunction( addToCartFunction({
{quantity, quantity,
itemID, itemID,
ProductDetailViewModel model}) async { ProductDetailViewModel model,
}) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.addToCartData(quantity, itemID); await model.addToCartData(quantity, itemID);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push(
context,
FadePage(page: CartOrderPage()));
} }
} }
notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model}) async {
notifyMeWhenAvailable(
{itemId, customerId, ProductDetailViewModel model}) async {
await model.notifyMe(customerId, itemId); await model.notifyMe(customerId, itemId);
} }

@ -25,9 +25,19 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
final bool isInWishList; final bool isInWishList;
final Function addToCartFunction; final Function addToCartFunction;
ProductAppBar({Key key, this.product, this.model, this.addToWishlistFunction, this.quantity, this.deleteFromWishlistFunction, this.isInWishList, this.addToCartFunction}) : super(key: key); ProductAppBar(
{Key key,
this.product,
this.model,
this.addToWishlistFunction,
this.quantity,
this.deleteFromWishlistFunction,
this.isInWishList,
this.addToCartFunction})
: super(key: key);
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -69,7 +79,11 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
MaterialPageRoute(builder: (context) => CartOrderPage()), MaterialPageRoute(builder: (context) => CartOrderPage()),
); );
}), }),
if (Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount != 0) if (Provider.of<OrderPreviewViewModel>(context,
listen: false)
.cartResponse
.quantityCount !=
0)
Positioned( Positioned(
top: 0, top: 0,
right: -1.0, right: -1.0,
@ -79,10 +93,14 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
padding: EdgeInsets.only(left: 5, right: 4.5), padding: EdgeInsets.only(left: 5, right: 4.5),
height: 19, height: 18,
child: Center( child: Center(
child: Texts( child: Texts(
orderPreviewViewModel.cartResponse.quantityCount.toString(), Provider.of<OrderPreviewViewModel>(context,
listen: false)
.cartResponse
.quantityCount
.toString(),
style: "caption", style: "caption",
medium: true, medium: true,
color: Colors.white, color: Colors.white,
@ -130,7 +148,11 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
onTap: () async { onTap: () async {
if (quantity > 0) { if (quantity > 0) {
{ {
await addToCartFunction(quantity: quantity, itemID: itemID, model: model); await addToCartFunction(
quantity: quantity,
itemID: itemID,
model: model,
context: context);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
@ -144,7 +166,9 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
color: !isInWishList ? Colors.white : Colors.red[800], color: !isInWishList ? Colors.white : Colors.red[800],
), ),
title: Text( title: Text(
isInWishList ? TranslationBase.of(context).removeFromWishlist : TranslationBase.of(context).addToWishlist, isInWishList
? TranslationBase.of(context).removeFromWishlist
: TranslationBase.of(context).addToWishlist,
), ),
onTap: () async { onTap: () async {
if (isInWishList) if (isInWishList)
@ -159,7 +183,8 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
TranslationBase.of(context).compare, TranslationBase.of(context).compare,
), ),
onTap: () { onTap: () {
Provider.of<CompareList>(context, listen: false).addItem(specificationData); Provider.of<CompareList>(context, listen: false)
.addItem(specificationData);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
), ),

@ -120,22 +120,23 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
itemCount: model.searchList.length, itemCount: model.searchList.length,
itemBuilder: (BuildContext ctx, index) { itemBuilder: (BuildContext ctx, index) {
return Padding( return Padding(
padding:EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Text( child: Text(
model.searchList[index].name, model.searchList[index].name,
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
),
), ),
), ),
), Divider(height: 1, color: Colors.grey)
Divider(height: 1, color: Colors.grey) ],
],), ),
); );
}, },
), ),

@ -36,7 +36,7 @@ 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.28, height: MediaQuery.of(context).size.height * 0.18,
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/login/welcome.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/compare.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/compare.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/my_reviews.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/my_reviews.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-terms-conditions-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-terms-conditions-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart';
@ -93,12 +94,15 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
}, },
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount, appBarTitle: TranslationBase.of(context).myAccount,
isShowAppBar: false, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: true,
isPharmacy: true, isPharmacy: true,
//isBottomBar: true,
isMainPharmacyPages: true,
body: user != null body: user != null
? Container( ? Container(
color: Colors.white, color: Colors.white,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -123,12 +127,8 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Column(children: <Widget>[ Column(children: <Widget>[
Row(children: <Widget>[ Row(children: <Widget>[
Text( Text(
TranslationBase.of(context) TranslationBase.of(context).welcome,
.welcome, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, color: Colors.grey),
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold,
color: Colors.grey),
), ),
]), ]),
SizedBox( SizedBox(
@ -136,16 +136,8 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
), ),
Row(children: <Widget>[ Row(children: <Widget>[
Text( Text(
languageID == "ar" languageID == "ar" ? user.firstNameN.toString() + " " + user.lastNameN.toString() : user.firstName.toString() + " " + user.lastName.toString(),
? user.firstNameN.toString() + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
" " +
user.lastNameN.toString()
: user.firstName.toString() +
" " +
user.lastName.toString(),
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold),
), ),
]), ]),
]), ]),
@ -172,15 +164,10 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (customerId == null) { if (customerId == null) {
AppToast.showErrorToast( AppToast.showErrorToast(message: "Customer not found");
message: "Customer not found");
return; return;
} }
Navigator.push( Navigator.push(context, FadePage(page: OrderPage(customerID: customerId)));
context,
FadePage(
page: OrderPage(
customerID: customerId)));
}, },
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -207,8 +194,10 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, if (customerId == null || customerId == '')
FadePage(page: LakumMainPage())); Navigator.push(context, FadePage(page: LakumActivationVidaPage()));
else
Navigator.push(context, FadePage(page: LakumMainPage()));
}, },
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -233,8 +222,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(context,
context,
FadePage(page: WishlistPage())); FadePage(page: WishlistPage()));
}, },
child: Column( child: Column(

@ -35,6 +35,10 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
Widget child) => Widget child) =>
AppScaffold( AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: false,
isMainPharmacyPages: true,
isPharmacy: true,
isShowPharmacyAppbar: true,
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
children: [ children: [

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_xlider/flutter_xlider.dart'; // import 'package:flutter_xlider/flutter_xlider.dart';
class SelectGender extends StatefulWidget { class SelectGender extends StatefulWidget {
@override @override
@ -82,18 +82,18 @@ class _SelectGender extends State<SelectGender> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
FlutterSlider( // FlutterSlider(
values: [slider], // values: [slider],
max: 90, // max: 90,
min: 14, // min: 14,
onDragCompleted: (handlerIndex, lowerValue, upperValue) { // onDragCompleted: (handlerIndex, lowerValue, upperValue) {
print(lowerValue); // print(lowerValue);
print(upperValue); // print(upperValue);
setState(() { // setState(() {
slider = upperValue; // slider = upperValue;
}); // });
}, // },
), // ),
], ],
), ),
Expanded( Expanded(

@ -2,10 +2,14 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
import 'package:diplomaticquarterapp/models/pharmacy/addToCartModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/models/pharmacy/specification.dart'; import 'package:diplomaticquarterapp/models/pharmacy/specification.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class ProductDetailService extends BaseService { class ProductDetailService extends BaseService {
@ -73,7 +77,7 @@ class ProductDetailService extends BaseService {
}, body: request); }, body: request);
} }
Future addToCart(quantity, itemID) async { Future<Map> addToCart(quantity, itemID) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false; hasError = false;
Map<String, dynamic> request; Map<String, dynamic> request;
@ -88,8 +92,7 @@ class ProductDetailService extends BaseService {
"language_id": 1 "language_id": 1
} }
}; };
dynamic localRes;
await baseAppClient.pharmacyPost(GET_SHOPPING_CART, isExternal: false, await baseAppClient.pharmacyPost(GET_SHOPPING_CART, isExternal: false,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -98,11 +101,14 @@ class ProductDetailService extends BaseService {
_addToCartModel.add(Wishlist.fromJson(item)); _addToCartModel.add(Wishlist.fromJson(item));
}); });
AppToast.showSuccessToast(message: 'You have added a product to the cart'); AppToast.showSuccessToast(message: 'You have added a product to the cart');
localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
AppToast.showErrorToast(message: error??Utils.generateContactAdminMessage()); AppToast.showErrorToast(message: error??Utils.generateContactAdminMessage());
}, body: request); }, body: request);
return Future.value(localRes);
} }
Future notifyMe(customerId, itemID) async { Future notifyMe(customerId, itemID) async {
@ -142,7 +148,7 @@ class ProductDetailService extends BaseService {
Future getWishlistItems() async { Future getWishlistItems() async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_WISHLIST.toString()+customerId.toString()+"?shopping_cart_type=2", await baseAppClient.getPharmacy(GET_WISHLIST+customerId+"?shopping_cart_type=2",
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_wishListProducts.clear(); _wishListProducts.clear();
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -18,8 +19,7 @@ class SmartWatchIntegrationService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -42,13 +42,29 @@ class SmartWatchIntegrationService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_PATIENT_LAST_RECORD, await baseAppClient.post(GET_PATIENT_LAST_RECORD, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
}
Future<Map> insertPatientHealthData(List<healthData> healthData, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
request = {
"Med_InsertTransactionsInputsList": healthData,
};
dynamic localRes;
await baseAppClient.post(INSERT_PATIENT_HEALTH_DATA, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
} }
} }

@ -2,7 +2,6 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/Constants.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
/// ---- Default Theme ---- /// ---- Default Theme ----
/// ///
@ -40,7 +39,7 @@ defaultTheme({fontName}) {
buttonColor: Colors.black, buttonColor: Colors.black,
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor, indicatorColor: secondaryColor,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')), bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xFFE0E0E0)),
cursorColor: Colors.grey, cursorColor: Colors.grey,
primaryTextTheme: TextTheme(bodyText2: TextStyle(color: Colors.white)), primaryTextTheme: TextTheme(bodyText2: TextStyle(color: Colors.white)),
iconTheme: IconThemeData(), iconTheme: IconThemeData(),
@ -92,7 +91,7 @@ invertThemes({fontName}) {
buttonColor: Colors.black, buttonColor: Colors.black,
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor, indicatorColor: secondaryColor,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')), bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xFFE0E0E0)),
cursorColor: Colors.black, cursorColor: Colors.black,
iconTheme: IconThemeData(), iconTheme: IconThemeData(),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
@ -147,7 +146,7 @@ bwThemes({fontName}) {
primaryColor: Color(0xfffffff4), primaryColor: Color(0xfffffff4),
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor, indicatorColor: secondaryColor,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')), bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xFFE0E0E0)),
cursorColor: Colors.black, cursorColor: Colors.black,
iconTheme: IconThemeData(), iconTheme: IconThemeData(),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(

@ -29,6 +29,10 @@ class SignalRUtil {
}); });
} }
void closeSignalRConnection() {
connectionBuilder.stop();
}
void handleIncomingMessage(List<dynamic> message) { void handleIncomingMessage(List<dynamic> message) {
print(message.toString()); print(message.toString());
} }
@ -38,7 +42,7 @@ class SignalRUtil {
} }
bool getConnectionState() { bool getConnectionState() {
if (connectionBuilder.state == HubConnectionState.connected) return true; if (connectionBuilder.state == HubConnectionState.connected || connectionBuilder.state == HubConnectionState.connecting) return true;
if (connectionBuilder.state == HubConnectionState.connected) return true; if (connectionBuilder.state == HubConnectionState.disconnected || connectionBuilder.state == HubConnectionState.disconnecting) return false;
} }
} }

@ -2594,6 +2594,8 @@ class TranslationBase {
String get androidInstructions4 => localizedValues["android-instructions-4"][locale.languageCode]; String get androidInstructions4 => localizedValues["android-instructions-4"][locale.languageCode];
String get tamaraInstPlan => localizedValues["tamaraInstPlan"][locale.languageCode];
String get onlineTag => localizedValues["onlineTag"][locale.languageCode]; String get onlineTag => localizedValues["onlineTag"][locale.languageCode];
String get offlineTag => localizedValues["offlineTag"][locale.languageCode]; String get offlineTag => localizedValues["offlineTag"][locale.languageCode];
@ -2604,6 +2606,8 @@ class TranslationBase {
String get cholesTitle => localizedValues["cholesTitle"][locale.languageCode]; String get cholesTitle => localizedValues["cholesTitle"][locale.languageCode];
String get laserClinic => localizedValues["laserClinic"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -570,10 +570,6 @@ bool timeCalculator(int startHour, int startMint, int endHour, int endMint) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
DateTime startDate = DateTime(now.year, now.month, now.day, startHour, startHour); DateTime startDate = DateTime(now.year, now.month, now.day, startHour, startHour);
DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint); DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint);
print(startDate.toString());
print(endDate.toString());
print(now);
print("------------");
if (startDate.isBefore(now) && endDate.isAfter(now)) if (startDate.isBefore(now) && endDate.isAfter(now))
return true; return true;
else else

@ -14,11 +14,12 @@ import '../show_zoom_image_dialog.dart';
/// [height] the avatar height /// [height] the avatar height
/// [onTap] on tap function /// [onTap] on tap function
class LargeAvatar extends StatelessWidget { class LargeAvatar extends StatelessWidget {
LargeAvatar({Key key, @required this.name, this.url, this.disableProfileView: false, this.radius = 70.0, this.width = 70, this.height = 60, this.onTap}) : super(key: key); LargeAvatar({Key key, @required this.name, this.url, this.disableProfileView: false, this.radius = 70.0, this.width = 70, this.height = 60, this.onTap, this.isAppointmentAvatar: false}) : super(key: key);
final String name; final String name;
final String url; final String url;
final bool disableProfileView; final bool disableProfileView;
final bool isAppointmentAvatar;
final double radius; final double radius;
final double width; final double width;
final double height; final double height;
@ -38,7 +39,7 @@ class LargeAvatar extends StatelessWidget {
width: width, width: width,
height: height, height: height,
), ),
if (!disableProfileView) if (!disableProfileView && !isAppointmentAvatar)
Container( Container(
child: Icon(Icons.search,size: 18,color: Colors.white,), child: Icon(Icons.search,size: 18,color: Colors.white,),
padding: EdgeInsets.all(6), padding: EdgeInsets.all(6),
@ -62,7 +63,7 @@ class LargeAvatar extends StatelessWidget {
return InkWell( return InkWell(
onTap: disableProfileView onTap: disableProfileView
? null ? null
: () { : isAppointmentAvatar ? onTap : () {
print("ssssss " + url.trim()); print("ssssss " + url.trim());
showZoomImageDialog(context, url.trim() ?? ""); showZoomImageDialog(context, url.trim() ?? "");
}, },

@ -5,7 +5,6 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -97,8 +96,8 @@ class _BottomNavBarState extends State<BottomNavBar> {
// ), // ),
if (/*widget.index == 0 && */ projectViewModel.havePrivilege(34)) if (/*widget.index == 0 && */ projectViewModel.havePrivilege(34))
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: Icons.calendar_today_sharp,
activeIcon: EvaIcons.calendar, activeIcon: Icons.calendar_today_sharp,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 4, currentIndex: 4,

@ -3,7 +3,7 @@ import 'dart:io';
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:feather_icons_flutter/feather_icons_flutter.dart'; // import 'package:feather_icons_flutter/feather_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
@ -20,10 +20,10 @@ class ImageOptions {
), ),
_BottomSheetItem( _BottomSheetItem(
title: TranslationBase.of(context).gallery, title: TranslationBase.of(context).gallery,
icon: FeatherIcons.image, icon: Icons.image,
onTap: () async { onTap: () async {
File _image = File _image =
await ImagePicker.pickImage(source: ImageSource.gallery, imageQuality: 50); await ImagePicker.pickImage(source: ImageSource.gallery, imageQuality: 20);
String fileName = _image.path; String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync(); final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes); String base64Encode = base64.encode(bytes);
@ -34,10 +34,10 @@ class ImageOptions {
), ),
_BottomSheetItem( _BottomSheetItem(
title: TranslationBase.of(context).camera, title: TranslationBase.of(context).camera,
icon: FeatherIcons.camera, icon: Icons.camera_alt,
onTap: () async { onTap: () async {
File _image = File _image =
await ImagePicker.pickImage(source: ImageSource.camera, imageQuality: 50); await ImagePicker.pickImage(source: ImageSource.camera, imageQuality: 20);
String fileName = _image.path; String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync(); final bytes = File(fileName).readAsBytesSync();
String base64Encode = base64.encode(bytes); String base64Encode = base64.encode(bytes);

@ -1,53 +0,0 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class AppBarChart extends StatelessWidget {
const AppBarChart({
Key key,
@required this.isArabic,
@required this.seriesList,
}) : super(key: key);
final List<charts.Series> seriesList;
final bool isArabic;
@override
Widget build(BuildContext context) {
return Container(
height: 400,
//margin: EdgeInsets.only(top: 60),
child: charts.BarChart(
seriesList,
// animate: animate,
domainAxis: charts.OrdinalAxisSpec(
renderSpec: charts.GridlineRendererSpec(
labelAnchor: isArabic ? charts.TickLabelAnchor.before : charts.TickLabelAnchor.after,
labelRotation: -30,
labelOffsetFromAxisPx: 30,
labelOffsetFromTickPx: 15,
labelJustification: charts.TickLabelJustification.inside,
),
),
/// Customize the primary measure axis using a small tick renderer.
/// Use String instead of num for ordinal domain axis
/// (typically bar charts).
primaryMeasureAxis: new charts.NumericAxisSpec(
renderSpec: new charts.GridlineRendererSpec(
// Display the measure axis labels below the gridline.
//
// 'Before' & 'after' follow the axis value direction.
// Vertical axes draw 'before' below & 'after' above the tick.
// Horizontal axes draw 'before' left & 'after' right the tick.
labelAnchor: charts.TickLabelAnchor.before,
// Left justify the text in the axis.
//
// Note: outside means that the secondary measure axis would right
// justify.
labelJustification: charts.TickLabelJustification.outside,
)),
),
);
}
}

@ -1,44 +0,0 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
/// chart line
/// [seriesList] charts series
/// [chartTitle] the charts title
/// [animate] enable and disable animate on create chart
/// [includeArea] chart include Area
/// [stacked] stacked chart over the design
class AppLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final String chartTitle;
final bool animate;
final bool includeArea;
final bool stacked;
AppLineChart(
{Key key,
@required this.seriesList,
this.chartTitle,
this.animate = true,
this.includeArea = false,
this.stacked = true});
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Text(
chartTitle,
style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
),
Expanded(
child: charts.LineChart(seriesList,
defaultRenderer: charts.LineRendererConfig(
includeArea: false, stacked: true),
animate: animate),
),
],
),
);
}
}

@ -1,4 +1,3 @@
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Custom Item widget /// Custom Item widget
@ -32,7 +31,7 @@ class CustomItem extends StatelessWidget {
this.disabled: false, this.disabled: false,
this.onTap, this.onTap,
this.startIconColor, this.startIconColor,
this.endIcon = EvaIcons.chevronRight, this.endIcon = Icons.chevron_right_sharp,
this.padding, this.padding,
this.child, this.child,
this.endIconColor, this.endIconColor,

@ -35,6 +35,7 @@ class _TimeLineViewState extends State<TimeLineView> {
List<DateObj> dateObjs = []; List<DateObj> dateObjs = [];
DateObj selectedDateObj = null; DateObj selectedDateObj = null;
final authService = new auth.AuthProvider(); final authService = new auth.AuthProvider();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -347,14 +348,15 @@ class TimelineNewWidget extends StatelessWidget {
FadePage( FadePage(
page: AppointmentDetails( page: AppointmentDetails(
appo: appoitmentAllHistoryResul, appo: appoitmentAllHistoryResul,
parentIndex: 2, parentIndex: 2,
))); )));
}, },
name: appoitmentAllHistoryResul.doctorNameObj, name: appoitmentAllHistoryResul.doctorNameObj,
disableProfileView: true, disableProfileView: false,
url: appoitmentAllHistoryResul.doctorImageURL, url: appoitmentAllHistoryResul.doctorImageURL,
width: 30, width: 30,
height: 30, height: 30,
isAppointmentAvatar: true,
), ),
mHeight(6), mHeight(6),
Text( Text(

@ -110,7 +110,7 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).save, TranslationBase.of(context).save,
() { (){
Navigator.pop(context); Navigator.pop(context);
widget.onValueSelected(selectedIndex); widget.onValueSelected(selectedIndex);
}, },

@ -1,7 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'dart:math' as math; import 'dart:math' as math;
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
@ -862,7 +861,7 @@ class _MonthPickerState extends State<MonthPicker>
disabledColor: disabledColor:
Theme.of(context).disabledColor.withOpacity(0.2), Theme.of(context).disabledColor.withOpacity(0.2),
color: Theme.of(context).disabledColor, color: Theme.of(context).disabledColor,
icon: const Icon(EvaIcons.chevronLeft), icon: const Icon(Icons.chevron_left_sharp),
tooltip: _isDisplayingFirstMonth tooltip: _isDisplayingFirstMonth
? null ? null
: '${localizations.previousMonthTooltip} ${localizations.formatMonthYear(_previousMonthDate)}', : '${localizations.previousMonthTooltip} ${localizations.formatMonthYear(_previousMonthDate)}',
@ -886,7 +885,7 @@ class _MonthPickerState extends State<MonthPicker>
disabledColor: disabledColor:
Theme.of(context).disabledColor.withOpacity(0.2), Theme.of(context).disabledColor.withOpacity(0.2),
color: Theme.of(context).disabledColor, color: Theme.of(context).disabledColor,
icon: const Icon(EvaIcons.chevronRight), icon: const Icon(Icons.chevron_right_sharp),
tooltip: _isDisplayingLastMonth tooltip: _isDisplayingLastMonth
? null ? null
: '${localizations.nextMonthTooltip} ${localizations.formatMonthYear(_nextMonthDate)}', : '${localizations.nextMonthTooltip} ${localizations.formatMonthYear(_nextMonthDate)}',

@ -1,4 +1,3 @@
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -156,7 +155,7 @@ class _TextFieldsState extends State<TextFields> {
); );
}, },
child: Icon( child: Icon(
EvaIcons.eye, Icons.remove_red_eye_sharp,
size: 24.0, size: 24.0,
color: Color.fromRGBO(78, 62, 253, 1.0), color: Color.fromRGBO(78, 62, 253, 1.0),
), ),
@ -167,7 +166,7 @@ class _TextFieldsState extends State<TextFields> {
view = true; view = true;
}); });
}, },
child: Icon(EvaIcons.eyeOff, child: Icon(Icons.remove_red_eye_sharp,
size: 24.0, color: Colors.grey[500]), size: 24.0, color: Colors.grey[500]),
), ),
); );

@ -11,11 +11,8 @@ import '../../Constants.dart';
class PhoneNumberSelectorWidget extends StatefulWidget { class PhoneNumberSelectorWidget extends StatefulWidget {
final Function onNumberChange; final Function onNumberChange;
final Function onCountryChange; final Function onCountryChange;
PhoneNumberSelectorWidget({ final String mobileNo;
Key key, PhoneNumberSelectorWidget({Key key, this.onNumberChange, this.onCountryChange, this.mobileNo}) : super(key: key);
this.onNumberChange,
this.onCountryChange,
}) : super(key: key);
@override @override
_PhoneNumberSelectorWidgetState createState() { _PhoneNumberSelectorWidgetState createState() {
@ -31,6 +28,7 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
@override @override
void initState() { void initState() {
for (var element in countriesData) counties.add(Countries.fromJson(element)); for (var element in countriesData) counties.add(Countries.fromJson(element));
super.initState(); super.initState();
} }
@ -53,7 +51,7 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
children: [ children: [
inputWidget(TranslationBase.of(context).country, countryName, isEnable: false, hasSelection: true), inputWidget(TranslationBase.of(context).country, countryName, isEnable: false, hasSelection: true),
SizedBox(height: 12), SizedBox(height: 12),
Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).phoneNumber, "5xxxxxxxx", prefix: countryCode)), Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).phoneNumber, widget.mobileNo ?? "5xxxxxxxx", prefix: countryCode)),
], ],
); );
} }
@ -252,7 +250,8 @@ class _MobileNo extends State<MobileNo> {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), margin:
widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft),
child: TextField( child: TextField(
controller: widget.controller, controller: widget.controller,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,

@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/loadings/ShimmerLoading.dart'; import 'package:diplomaticquarterapp/widgets/loadings/ShimmerLoading.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class OffersAndPackagesWidget extends StatefulWidget { class OffersAndPackagesWidget extends StatefulWidget {
final List<OfferPackagesItemModel> models; final List<OfferPackagesItemModel> models;
@ -168,7 +167,7 @@ class _OfferPackagesItemWidgetState extends State<OfferPackagesItemWidget> {
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: MaterialButton( child: MaterialButton(
height: 30, height: 30,
color: HexColor('#D81A2E'), color: Color(0xFFD81A2E),
onPressed: () => widget.model.action.onClick(model.item), onPressed: () => widget.model.action.onClick(model.item),
child: Texts( child: Texts(
TranslationBase.of(context).view, TranslationBase.of(context).view,

@ -1,5 +1,4 @@
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class StarRating extends StatelessWidget { class StarRating extends StatelessWidget {
@ -23,7 +22,7 @@ class StarRating extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(right: 1.0), padding: EdgeInsets.only(right: 1.0),
child: Icon( child: Icon(
(index+1) <= (totalAverage ?? 0) ? EvaIcons.star : EvaIcons.starOutline, (index+1) <= (totalAverage ?? 0) ? Icons.star : Icons.star_border_outlined,
size: size, size: size,
color: (index+1) <= (totalAverage ?? 0) ? Color.fromRGBO(255, 186, 0, 1.0) : Theme.of(context).hintColor color: (index+1) <= (totalAverage ?? 0) ? Color.fromRGBO(255, 186, 0, 1.0) : Theme.of(context).hintColor
), ),

@ -1,17 +1,30 @@
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:badges/badges.dart'; import 'package:badges/badges.dart';
import 'package:barcode_scan_fix/barcode_scan.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/PharmacyPagesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.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/search_products_page.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -25,7 +38,7 @@ import 'not_auh_page.dart';
VoidCallback _onCartClick; VoidCallback _onCartClick;
class AppScaffold extends StatelessWidget { class AppScaffold extends StatefulWidget {
final String appBarTitle; final String appBarTitle;
final Widget body; final Widget body;
final Widget bottomSheet; final Widget bottomSheet;
@ -60,12 +73,18 @@ class AppScaffold extends StatelessWidget {
List<String> dropDownList; List<String> dropDownList;
final Function(int) dropDownIndexChange; final Function(int) dropDownIndexChange;
Function onTap; Function onTap;
final bool isMainPharmacyPages;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); final bool extendBody;
final ValueChanged<int> changeCurrentTab;
AppBarWidget appBar; final int currentTab;
final bool isShowPharmacyAppbar;
final Widget customAppBar; final Widget customAppBar;
AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
_onCartClick = onClick;
return this;
}
AppScaffold( AppScaffold(
{@required this.body, {@required this.body,
this.appBarTitle = '', this.appBarTitle = '',
@ -73,6 +92,8 @@ class AppScaffold extends StatelessWidget {
this.isShowAppBar = false, this.isShowAppBar = false,
this.showNewAppBar = false, this.showNewAppBar = false,
this.showNewAppBarTitle = false, this.showNewAppBarTitle = false,
this.isMainPharmacyPages = false,
this.extendBody = false,
this.hasAppBarParam, this.hasAppBarParam,
this.bottomSheet, this.bottomSheet,
this.bottomNavigationBar, this.bottomNavigationBar,
@ -85,7 +106,7 @@ class AppScaffold extends StatelessWidget {
this.title, this.title,
this.description, this.description,
this.isShowDecPage = true, this.isShowDecPage = true,
this.isBottomBar, this.isBottomBar = false,
this.backgroundColor, this.backgroundColor,
this.preferredSize = 0.0, this.preferredSize = 0.0,
this.appBarIcons, this.appBarIcons,
@ -102,78 +123,200 @@ class AppScaffold extends StatelessWidget {
appBar, appBar,
this.customAppBar, this.customAppBar,
this.isLocalLoader = false, this.isLocalLoader = false,
this.backButtonTab}); this.backButtonTab,
this.changeCurrentTab,
this.currentTab,
this.isShowPharmacyAppbar = false});
AppScaffold setOnAppBarCartClick(VoidCallback onClick) { @override
_onCartClick = onClick; _AppScaffoldState createState() => _AppScaffoldState();
return this; }
class _AppScaffoldState extends State<AppScaffold> {
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppBarWidget appBar;
@override
void initState() {
// TODO: implement initState
super.initState();
}
AppBar pharmacyAppbar() {
return AppBar(
backgroundColor: Color(0xff5AB145),
elevation: 0,
title: Container(
height: MediaQuery.of(context).size.height * 0.056,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
),
child: InkWell(
child: Padding(
padding: EdgeInsets.all(5.0),
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
),
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
),
onTap: () {
Navigator.push(
context,
FadePage(page: SearchProductsPage()),
);
},
),
),
leading: Builder(
builder: (BuildContext context) {
return InkWell(
onTap: () {
Provider.of<PharmacyPagesViewModel>(context, listen: false).changeCurrentTab(0);
},
child: Container(
height: 2.0,
width: 10.0,
child: Image.asset(
'assets/images/pharmacy_logo.png',
),
),
);
},
),
actions: [
IconButton(
// iconSize: 70,
icon: Image.asset(
'assets/images/new-design/qr-code.png',
),
onPressed: _scanQrAndGetProduct //do something,
)
],
centerTitle: true,
);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
PharmacyPagesViewModel pagesViewModel = Provider.of(context);
bool isUserNotLogin = (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && isShowDecPage); bool isUserNotLogin = (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && widget.isShowDecPage);
return Scaffold( return Scaffold(
backgroundColor: backgroundColor ?? CustomColors.appBackgroudGrey2Color, backgroundColor: widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color,
// appBar: widget.isShowPharmacyAppbar
// ? pharmacyAppbar()
// : widget.isShowAppBar
// ? widget.customAppBar != null
// ? widget.customAppBar
appBar: isUserNotLogin appBar: isUserNotLogin
? null ? null
: (showNewAppBar : widget.isShowPharmacyAppbar
? NewAppBarWidget( ? pharmacyAppbar()
title: appBarTitle, : (widget.showNewAppBar
showTitle: showNewAppBarTitle, ? NewAppBarWidget(
showDropDown: showDropDown, title: widget.appBarTitle,
dropdownIndexValue: dropdownIndexValue, showTitle: widget.showNewAppBarTitle,
dropDownList: dropDownList ?? [], showDropDown: widget.showDropDown,
dropDownIndexChange: dropDownIndexChange, dropdownIndexValue: widget.dropdownIndexValue,
appBarIcons: appBarIcons, dropDownList: widget.dropDownList ?? [],
onTap: onTap, dropDownIndexChange: widget.dropDownIndexChange,
) appBarIcons: widget.appBarIcons,
: (isShowAppBar onTap: widget.onTap,
? customAppBar != null )
? customAppBar : (widget.isShowAppBar
: appBar = AppBarWidget( ? widget.customAppBar != null
appBarTitle: appBarTitle, ? widget.customAppBar
appBarIcons: appBarIcons, : appBar = AppBarWidget(
showHomeAppBarIcon: showHomeAppBarIcon, appBarTitle: widget.appBarTitle,
isPharmacy: isPharmacy, appBarIcons: widget.appBarIcons,
showPharmacyCart: showPharmacyCart, showHomeAppBarIcon: widget.showHomeAppBarIcon,
isOfferPackages: isOfferPackages, isPharmacy: widget.isPharmacy,
showOfferPackagesCart: showOfferPackagesCart, showPharmacyCart: widget.showPharmacyCart,
isShowDecPage: isShowDecPage, isOfferPackages: widget.isOfferPackages,
backButtonTab: backButtonTab, showOfferPackagesCart: widget.showOfferPackagesCart,
) isShowDecPage: widget.isShowDecPage,
: null)), backButtonTab: widget.backButtonTab,
bottomSheet: bottomSheet, )
: null)),
bottomSheet: widget.bottomSheet,
body: SafeArea( body: SafeArea(
top: true, top: true,
bottom: true, bottom: true,
child: isUserNotLogin child: isUserNotLogin
? NotAutPage( ? NotAutPage(
title: title ?? appBarTitle, title: widget.title ?? widget.appBarTitle,
description: description, description: widget.description,
infoList: infoList, infoList: widget.infoList,
imagesInfo: imagesInfo, imagesInfo: widget.imagesInfo,
icon: icon, icon: widget.icon,
) )
: baseViewModel != null : widget.baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
child: buildBodyWidget(context), child: buildBodyWidget(context),
baseViewModel: baseViewModel, baseViewModel: widget.baseViewModel,
) )
: buildBodyWidget(context), : buildBodyWidget(context),
), ),
bottomNavigationBar: bottomNavigationBar, bottomNavigationBar: widget.isBottomBar
floatingActionButton: floatingActionButton, ? BottomNavPharmacyBar(
changeIndex: changeCurrentTab,
index: widget.currentTab,
)
: null,
floatingActionButton: widget.floatingActionButton,
); );
} }
void changeCurrentTab(int value) {
if (widget.isMainPharmacyPages) {
widget.changeCurrentTab(value);
} else {
Navigator.pushAndRemoveUntil(
locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: value)), (Route<dynamic> r) => false);
}
}
void _scanQrAndGetProduct() async {
try {
String result = await BarcodeScanner.scan();
try {
String barcode = result;
GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) {
print(response);
var product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: ProductDetailPage(product)));
}, onFailure: (String error, int statusCode) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "Product not found");
});
} catch (apiEx) {
AppToast.showErrorToast(message: "Something went wrong, please try again");
}
} catch (barcodeEx) {}
}
buildAppLoaderWidget(bool isLoading) { buildAppLoaderWidget(bool isLoading) {
return isLoading ? AppLoaderWidget() : Container(); return isLoading ? AppLoaderWidget() : Container();
} }
buildBodyWidget(context) { buildBodyWidget(context) {
return Stack(children: <Widget>[body, isHelp == true ? RobotIcon() : Container()]); return Stack(children: <Widget>[widget.body, widget.isHelp == true ? RobotIcon() : Container()]);
} }
} }
@ -206,7 +349,6 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
// centerTitle: false, // centerTitle: false,
title: Row( title: Row(
children: [ children: [
if (showTitle) if (showTitle)
Expanded( Expanded(
child: Text( child: Text(
@ -256,17 +398,19 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
], ],
), ),
actions: <Widget>[ actions: <Widget>[
if (appBarIcons != null) ...appBarIcons else if (appBarIcons != null)
IconButton( ...appBarIcons
onPressed: () { else
Navigator.pushAndRemoveUntil( IconButton(
context, onPressed: () {
MaterialPageRoute(builder: (context) => LandingPage()), Navigator.pushAndRemoveUntil(
(Route<dynamic> route) => false, context,
); MaterialPageRoute(builder: (context) => LandingPage()),
}, (Route<dynamic> route) => false,
icon: Icon(Icons.home), );
), },
icon: Icon(Icons.home),
),
], ],
); );
} }

@ -1,4 +1,3 @@
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CloseBack extends StatelessWidget{ class CloseBack extends StatelessWidget{
@ -16,7 +15,7 @@ class CloseBack extends StatelessWidget{
onTap: Feedback.wrapForTap(() { onTap: Feedback.wrapForTap(() {
onTap!=null ? onTap() : Navigator.pop(context); onTap!=null ? onTap() : Navigator.pop(context);
}, context), }, context),
child: Icon(EvaIcons.close, color: Colors.white), child: Icon(Icons.close, color: Colors.white),
); );
} }
} }

@ -1,7 +1,5 @@
import 'package:diplomaticquarterapp/d_q_icons_icons.dart'; import 'package:diplomaticquarterapp/d_q_icons_icons.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'bottom_nav_pharmacy_home_item.dart'; import 'bottom_nav_pharmacy_home_item.dart';
@ -9,9 +7,9 @@ import 'bottom_nav_pharmacy_item.dart';
class BottomNavPharmacyBar extends StatefulWidget { class BottomNavPharmacyBar extends StatefulWidget {
final ValueChanged<int> changeIndex; final ValueChanged<int> changeIndex;
final int index;
BottomNavPharmacyBar({Key key, this.changeIndex, this.index}) BottomNavPharmacyBar({Key key, this.changeIndex, this.index}) : super(key: key);
: super(key: key); int index = 0;
@override @override
_BottomNavPharmacyBarState createState() => _BottomNavPharmacyBarState(); _BottomNavPharmacyBarState createState() => _BottomNavPharmacyBarState();
@ -35,8 +33,8 @@ class _BottomNavPharmacyBarState extends State<BottomNavPharmacyBar> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
BottomNavHomeItem( BottomNavHomeItem(
icon: EvaIcons.image, icon: Icons.image,
activeIcon: EvaIcons.image, activeIcon: Icons.image,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 0, currentIndex: 0,
@ -50,14 +48,7 @@ class _BottomNavPharmacyBarState extends State<BottomNavPharmacyBar> {
currentIndex: 1, currentIndex: 1,
title: TranslationBase.of(context).categorise, title: TranslationBase.of(context).categorise,
), ),
BottomNavPharmacyItem( BottomNavPharmacyItem(icon: Icons.home, activeIcon: Icons.home, changeIndex: _changeIndex, index: widget.index, currentIndex: 0, isHome: true, title: TranslationBase.of(context).home),
icon: EvaIcons.home,
activeIcon: EvaIcons.home,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 0,
isHome: true,
title: TranslationBase.of(context).home),
BottomNavPharmacyItem( BottomNavPharmacyItem(
icon: DQIcons.user_menu_icon, icon: DQIcons.user_menu_icon,
activeIcon: DQIcons.user_menu_icon, activeIcon: DQIcons.user_menu_icon,
@ -67,12 +58,7 @@ class _BottomNavPharmacyBarState extends State<BottomNavPharmacyBar> {
title: TranslationBase.of(context).myAccount, title: TranslationBase.of(context).myAccount,
), ),
BottomNavPharmacyItem( BottomNavPharmacyItem(
icon: DQIcons.cart_menu_icon, icon: DQIcons.cart_menu_icon, activeIcon: DQIcons.cart_menu_icon, changeIndex: _changeIndex, index: widget.index, currentIndex: 3, title: TranslationBase.of(context).cart)
activeIcon: DQIcons.cart_menu_icon,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 3,
title: TranslationBase.of(context).cart)
], ],
), ),
), ),

@ -9,7 +9,7 @@ class BottomNavHomeItem extends StatelessWidget {
final Image image; final Image image;
final String title; final String title;
final ValueChanged<int> changeIndex; final Function changeIndex;
final int index; final int index;
final int currentIndex; final int currentIndex;
final Function onTap; final Function onTap;
@ -62,7 +62,6 @@ class BottomNavHomeItem extends StatelessWidget {
'assets/images/habib-logo.png', 'assets/images/habib-logo.png',
), ),
height: 22.0, height: 22.0,
), ),
SizedBox( SizedBox(
height: 5, height: 5,

@ -163,7 +163,7 @@ class productTile extends StatelessWidget {
), ),
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, productID); await addToCartFunction(1, productID, context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Navigator.push(
context, context,
@ -292,7 +292,7 @@ class productTile extends StatelessWidget {
// await x.deletWishlistData(itemID); // await x.deletWishlistData(itemID);
// } // }
addToCartFunction(quantity, itemID) async { addToCartFunction(quantity, itemID, BuildContext context) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
await x.addToCartData(quantity, itemID); await x.addToCartData(quantity, itemID);
} }

@ -1,24 +1,24 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:progress_hud_v2/generated/i18n.dart';
showZoomImageDialog(BuildContext context, String url) { showZoomImageDialog(BuildContext context, String url, {bool isNetworkImage = true}) {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) => Dialog( builder: (BuildContext context) => Dialog(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), //this right here ), //this right here
child: ShowZoomImage(url), child: ShowZoomImage(url, isNetworkImage),
), ),
); );
} }
class ShowZoomImage extends StatelessWidget { class ShowZoomImage extends StatelessWidget {
String url; String url;
bool isNetworkImage = true;
ShowZoomImage(this.url); ShowZoomImage(this.url, this.isNetworkImage);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -35,11 +35,17 @@ class ShowZoomImage extends StatelessWidget {
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
CachedNetworkImage( isNetworkImage
imageUrl: url, ? CachedNetworkImage(
height: MediaQuery.of(context).size.width / 1.4, imageUrl: url,
width: double.infinity, height: MediaQuery.of(context).size.width / 1.4,
), width: double.infinity,
)
: Image.asset(
url,
height: MediaQuery.of(context).size.width / 1.4,
width: double.infinity,
),
mHeight(12), mHeight(12),
], ],
), ),

@ -13,8 +13,9 @@ import 'package:permission_handler/permission_handler.dart';
class SingleSelectionDialog<T> extends StatefulWidget { class SingleSelectionDialog<T> extends StatefulWidget {
final List<T> items; final List<T> items;
final String title; final String title;
final Widget icon;
SingleSelectionDialog(this.items, {Widget icon, @required this.title}); SingleSelectionDialog(this.items, {@required this.icon, @required this.title});
Future<T> show(BuildContext context) async { Future<T> show(BuildContext context) async {
return showDialog<T>( return showDialog<T>(
@ -32,6 +33,7 @@ class SingleSelectionDialog<T> extends StatefulWidget {
@override @override
_SingleSelectionDialogState createState() => _SingleSelectionDialogState(); _SingleSelectionDialogState createState() => _SingleSelectionDialogState();
} }
class _SingleSelectionDialogState extends State<SingleSelectionDialog> { class _SingleSelectionDialogState extends State<SingleSelectionDialog> {
@ -51,11 +53,12 @@ class _SingleSelectionDialogState extends State<SingleSelectionDialog> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Icon(
Icons.notifications_active, SizedBox(
color: Color(0xff2B353E), height: 40,
size: 50, child: widget.icon,
), ),
IconButton( IconButton(
icon: Icon(Icons.clear), icon: Icon(Icons.clear),
color: Color(0xff2B353E), color: Color(0xff2B353E),
@ -95,33 +98,33 @@ class _SingleSelectionDialogState extends State<SingleSelectionDialog> {
} }
Widget optionList(List<dynamic> options){ Widget optionList(List<dynamic> options){
return ListView( return ListView.builder(
shrinkWrap: true, shrinkWrap: true,
children: List.generate(options.length, (index){ itemCount: options.length,
itemBuilder: (ctx,idx){
final opt = options[index]; final opt = options[idx];
return Row( return Row(
children: [ children: [
Radio<int>( Radio<int>(
value: index, value: idx,
groupValue: i, groupValue: i,
onChanged: (int value) { onChanged: (int value) {
setState(() { setState(() {
i = value; i = value;
}); });
}, },
),
Text(
opt.toString(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
), ),
), Text(
], opt.toString(),
); style: TextStyle(
}), fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
],
);
}
); );
} }
} }

@ -1,47 +1,29 @@
import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class WeatherSlider extends StatelessWidget { class WeatherSlider extends StatelessWidget {
// final width;
// final LinearGradient color;
final GetCityInfoList data; final GetCityInfoList data;
WeatherSlider(this.data);
LinearGradient red = LinearGradient( final ProjectViewModel projectViewModel;
colors: [
Colors.redAccent[100], WeatherSlider(this.data, this.projectViewModel);
Colors.redAccent
]); LinearGradient red = LinearGradient(colors: [Colors.redAccent[100], Colors.redAccent]);
LinearGradient green = LinearGradient( LinearGradient green = LinearGradient(colors: [Colors.greenAccent[100], Colors.greenAccent]);
colors: [ LinearGradient grey = LinearGradient(colors: [Colors.grey[100], Colors.grey]);
Colors.greenAccent[100], LinearGradient orange = LinearGradient(colors: [Colors.orangeAccent[100], Colors.orange]);
Colors.greenAccent LinearGradient yellow = LinearGradient(colors: [Colors.yellow[100], Colors.yellow[600]]);
]);
LinearGradient grey = LinearGradient(
colors: [
Colors.grey[100],
Colors.grey
]);
LinearGradient orange = LinearGradient(
colors: [
Colors.orangeAccent[100],
Colors.orange
]);
LinearGradient yellow = LinearGradient(
colors: [
Colors.yellow[100],
Colors.yellow[600]
]);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// TODO: implement build // TODO: implement build
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(padding: EdgeInsets.only(top: 10), child: AppText(data.name)),
padding: EdgeInsets.only(top:10),
child: AppText(data.name)),
AppText( AppText(
data.category, data.category,
fontSize: 24, fontSize: 24,
@ -51,11 +33,8 @@ class WeatherSlider extends StatelessWidget {
child: Stack( child: Stack(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(bottom:10), margin: EdgeInsets.only(bottom: 10),
decoration: BoxDecoration( decoration: BoxDecoration(gradient: LinearGradient(colors: [Colors.grey[100], Colors.grey[400]]), borderRadius: BorderRadius.circular(10)),
gradient: LinearGradient(
colors: [Colors.grey[100], Colors.grey[400]]),
borderRadius: BorderRadius.circular(10)),
height: 15, height: 15,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
child: SizedBox(), child: SizedBox(),
@ -64,110 +43,200 @@ class WeatherSlider extends StatelessWidget {
top: 0, top: 0,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: data.colorName =='red' ? red : data.colorName =='orange' ? orange : data.colorName =='green' ? green : data.colorName == 'yellow' ? yellow : grey, gradient: data.colorName == 'red'
? red
: data.colorName == 'orange'
? orange
: data.colorName == 'green'
? green
: data.colorName == 'yellow'
? yellow
: grey,
borderRadius: BorderRadius.circular(10)), borderRadius: BorderRadius.circular(10)),
height: 15, height: 15,
width: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)), width: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)),
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: SizedBox(), child: SizedBox(),
)), )),
Positioned(child: Container( projectViewModel.isArabic
height: 0, ? Positioned(
width:0, child: Container(
decoration: ShapeDecoration( height: 0,
color:data.colorName =='red' ? Colors.redAccent : data.colorName =='orange' ? Colors.orangeAccent : data.colorName =='green' ? Colors.greenAccent : data.colorName == 'yellow' ? Colors.yellowAccent : Colors.grey, width: 0,
shape: MessageBorder(), decoration: ShapeDecoration(
color: data.colorName == 'red'
)),top:25, left: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)),) ? Colors.redAccent
: data.colorName == 'orange'
? Colors.orangeAccent
: data.colorName == 'green'
? Colors.greenAccent
: data.colorName == 'yellow'
? Colors.yellowAccent
: Colors.grey,
shape: MessageBorder(),
)),
top: 25,
right: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)),
)
: Positioned(
child: Container(
height: 0,
width: 0,
decoration: ShapeDecoration(
color: data.colorName == 'red'
? Colors.redAccent
: data.colorName == 'orange'
? Colors.orangeAccent
: data.colorName == 'green'
? Colors.greenAccent
: data.colorName == 'yellow'
? Colors.yellowAccent
: Colors.grey,
shape: MessageBorder(),
)),
top: 25,
left: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)),
)
], ],
), ),
), ),
Padding( Padding(
padding: EdgeInsets.only(top:10), padding: EdgeInsets.only(top: 10),
child: data.isValuesReversed == false ? Row( child: data.isValuesReversed == false
mainAxisAlignment: MainAxisAlignment.spaceBetween, ? Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
AppText( children: [
data.categoriesNames.category1, AppText(data.categoriesNames.category1,
fontSize: 12, fontSize: 12,
color: data.categoriesNames.category1== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category1== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category1== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category1== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black color: data.categoriesNames.category1 == data.category && data.colorName == 'red'
), ? Colors.redAccent
AppText( : data.categoriesNames.category1 == data.category && data.colorName == 'orange'
data.categoriesNames.category2, ? Colors.orangeAccent
fontSize: 12, : data.categoriesNames.category1 == data.category && data.colorName == 'green'
color: data.categoriesNames.category2== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category2== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category2== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category2== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black ? Colors.greenAccent
: data.categoriesNames.category1 == data.category && data.colorName == 'yellow'
), ? Colors.yellow[900]
AppText( : Colors.black),
data.categoriesNames.category3, AppText(data.categoriesNames.category2,
fontSize: 12, fontSize: 12,
color: data.categoriesNames.category3== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category3== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category3== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category3== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black color: data.categoriesNames.category2 == data.category && data.colorName == 'red'
? Colors.redAccent
), : data.categoriesNames.category2 == data.category && data.colorName == 'orange'
AppText( ? Colors.orangeAccent
data.categoriesNames.category4, : data.categoriesNames.category2 == data.category && data.colorName == 'green'
fontSize: 12, ? Colors.greenAccent
color: data.categoriesNames.category4== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category4== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category4== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category4== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black : data.categoriesNames.category2 == data.category && data.colorName == 'yellow'
? Colors.yellow[900]
), : Colors.black),
AppText( AppText(data.categoriesNames.category3,
data.categoriesNames.category5, fontSize: 12,
fontSize: 12, color: data.categoriesNames.category3 == data.category && data.colorName == 'red'
color: data.categoriesNames.category5== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category5== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category5== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category5== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black ? Colors.redAccent
: data.categoriesNames.category3 == data.category && data.colorName == 'orange'
), ? Colors.orangeAccent
], : data.categoriesNames.category3 == data.category && data.colorName == 'green'
) : Row( ? Colors.greenAccent
mainAxisAlignment: MainAxisAlignment.spaceBetween, : data.categoriesNames.category3 == data.category && data.colorName == 'yellow'
children: [ ? Colors.yellow[900]
AppText( : Colors.black),
data.categoriesNames.category5, AppText(data.categoriesNames.category4,
fontSize: 12, fontSize: 12,
color: data.categoriesNames.category5== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category5== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category5== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category5== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black color: data.categoriesNames.category4 == data.category && data.colorName == 'red'
), ? Colors.redAccent
AppText( : data.categoriesNames.category4 == data.category && data.colorName == 'orange'
data.categoriesNames.category4, ? Colors.orangeAccent
fontSize: 12, : data.categoriesNames.category4 == data.category && data.colorName == 'green'
color: data.categoriesNames.category4== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category4== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category4== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category4== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black ? Colors.greenAccent
: data.categoriesNames.category4 == data.category && data.colorName == 'yellow'
), ? Colors.yellow[900]
AppText( : Colors.black),
data.categoriesNames.category3, AppText(data.categoriesNames.category5,
fontSize: 12, fontSize: 12,
color: data.categoriesNames.category3== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category3== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category3== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category3== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black color: data.categoriesNames.category5 == data.category && data.colorName == 'red'
? Colors.redAccent
), : data.categoriesNames.category5 == data.category && data.colorName == 'orange'
AppText( ? Colors.orangeAccent
data.categoriesNames.category2, : data.categoriesNames.category5 == data.category && data.colorName == 'green'
fontSize: 12, ? Colors.greenAccent
color: data.categoriesNames.category2== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category2== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category2== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category2== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black : data.categoriesNames.category5 == data.category && data.colorName == 'yellow'
? Colors.yellow[900]
), : Colors.black),
AppText( ],
data.categoriesNames.category1, )
fontSize: 12, : Row(
color: data.categoriesNames.category1== data.category && data.colorName=='red' ? Colors.redAccent : data.categoriesNames.category1== data.category && data.colorName=='orange' ? Colors.orangeAccent : data.categoriesNames.category1== data.category && data.colorName=='green' ? Colors.greenAccent : data.categoriesNames.category1== data.category && data.colorName=='yellow' ? Colors.yellow[900] : Colors.black mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
), AppText(data.categoriesNames.category5,
], fontSize: 12,
)), color: data.categoriesNames.category5 == data.category && data.colorName == 'red'
Padding( ? Colors.redAccent
padding: EdgeInsets.all(15), : data.categoriesNames.category5 == data.category && data.colorName == 'orange'
child:Divider()) ? Colors.orangeAccent
: data.categoriesNames.category5 == data.category && data.colorName == 'green'
? Colors.greenAccent
: data.categoriesNames.category5 == data.category && data.colorName == 'yellow'
? Colors.yellow[900]
: Colors.black),
AppText(data.categoriesNames.category4,
fontSize: 12,
color: data.categoriesNames.category4 == data.category && data.colorName == 'red'
? Colors.redAccent
: data.categoriesNames.category4 == data.category && data.colorName == 'orange'
? Colors.orangeAccent
: data.categoriesNames.category4 == data.category && data.colorName == 'green'
? Colors.greenAccent
: data.categoriesNames.category4 == data.category && data.colorName == 'yellow'
? Colors.yellow[900]
: Colors.black),
AppText(data.categoriesNames.category3,
fontSize: 12,
color: data.categoriesNames.category3 == data.category && data.colorName == 'red'
? Colors.redAccent
: data.categoriesNames.category3 == data.category && data.colorName == 'orange'
? Colors.orangeAccent
: data.categoriesNames.category3 == data.category && data.colorName == 'green'
? Colors.greenAccent
: data.categoriesNames.category3 == data.category && data.colorName == 'yellow'
? Colors.yellow[900]
: Colors.black),
AppText(data.categoriesNames.category2,
fontSize: 12,
color: data.categoriesNames.category2 == data.category && data.colorName == 'red'
? Colors.redAccent
: data.categoriesNames.category2 == data.category && data.colorName == 'orange'
? Colors.orangeAccent
: data.categoriesNames.category2 == data.category && data.colorName == 'green'
? Colors.greenAccent
: data.categoriesNames.category2 == data.category && data.colorName == 'yellow'
? Colors.yellow[900]
: Colors.black),
AppText(data.categoriesNames.category1,
fontSize: 12,
color: data.categoriesNames.category1 == data.category && data.colorName == 'red'
? Colors.redAccent
: data.categoriesNames.category1 == data.category && data.colorName == 'orange'
? Colors.orangeAccent
: data.categoriesNames.category1 == data.category && data.colorName == 'green'
? Colors.greenAccent
: data.categoriesNames.category1 == data.category && data.colorName == 'yellow'
? Colors.yellow[900]
: Colors.black),
],
)),
Padding(padding: EdgeInsets.all(15), child: Divider())
], ],
); );
} }
} }
class MessageBorder extends ShapeBorder { class MessageBorder extends ShapeBorder {
final bool usePadding; final bool usePadding;
final bool reverse; final bool reverse;
MessageBorder({this.usePadding = true, this.reverse =false});
MessageBorder({this.usePadding = true, this.reverse = false});
@override @override
EdgeInsetsGeometry get dimensions => EdgeInsets.only(bottom: usePadding? 0 : 0); EdgeInsetsGeometry get dimensions => EdgeInsets.only(bottom: usePadding ? 0 : 0);
@override @override
Path getInnerPath(Rect rect, {TextDirection textDirection}) => null; Path getInnerPath(Rect rect, {TextDirection textDirection}) => null;
@ -175,17 +244,16 @@ class MessageBorder extends ShapeBorder {
@override @override
Path getOuterPath(Rect rect, {TextDirection textDirection}) { Path getOuterPath(Rect rect, {TextDirection textDirection}) {
rect = Rect.fromPoints(rect.bottomRight, rect.bottomLeft - Offset(0, 0)); rect = Rect.fromPoints(rect.bottomRight, rect.bottomLeft - Offset(0, 0));
if(!reverse) { if (!reverse) {
return Path() return Path()
..addRRect( ..addRRect(RRect.fromRectAndRadius(rect, Radius.circular(rect.height / 2)))
RRect.fromRectAndRadius(rect, Radius.circular(rect.height / 2)))
..moveTo(rect.topCenter.dx - 10, rect.topCenter.dy) ..moveTo(rect.topCenter.dx - 10, rect.topCenter.dy)
..relativeLineTo(10, -10)..relativeLineTo(10, 10) ..relativeLineTo(10, -10)
..relativeLineTo(10, 10)
..close(); ..close();
}else{ } else {
return Path() return Path()
..addRRect( ..addRRect(RRect.fromRectAndRadius(rect, Radius.circular(rect.height / 2)))
RRect.fromRectAndRadius(rect, Radius.circular(rect.height / 2)))
..moveTo(rect.topCenter.dx, rect.topCenter.dy) ..moveTo(rect.topCenter.dx, rect.topCenter.dy)
..relativeLineTo(10, 20) ..relativeLineTo(10, 20)
..relativeLineTo(20, -20) ..relativeLineTo(20, -20)

@ -11,13 +11,12 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
# Localizations # Localizations
flutter_localizations: flutter_localizations:
sdk: flutter sdk: flutter
intl: ^0.16.0 intl: ^0.16.0
# web view # web view
webview_flutter: ^0.3.24 webview_flutter: ^1.0.7
# http client # http client
http: ^0.12.1 http: ^0.12.1
connectivity: ^0.4.9+3 connectivity: ^0.4.9+3
@ -30,6 +29,8 @@ dependencies:
#Dependency Injection #Dependency Injection
get_it: ^4.0.2 get_it: ^4.0.2
#Google Fit & Apple HealthKit
fit_kit: ^1.1.2
#chart #chart
fl_chart: ^0.12.3 fl_chart: ^0.12.3
@ -37,11 +38,9 @@ dependencies:
# Permissions # Permissions
permission_handler: ^5.0.0+hotfix.3 permission_handler: ^5.0.0+hotfix.3
device_info: ^0.4.2+4 device_info: ^0.4.2+4
#popub
giffy_dialog: ^1.8.0
# Flutter Html View # Flutter Html View
flutter_html: 1.0.2 flutter_html: ^1.2.0
# Native # Native
flutter_device_type: ^0.2.0 flutter_device_type: ^0.2.0
@ -54,45 +53,38 @@ dependencies:
firebase_messaging: ^7.0.3 firebase_messaging: ^7.0.3
firebase_analytics: ^6.3.0 firebase_analytics: ^6.3.0
cloud_firestore: ^0.14.3 cloud_firestore: ^0.14.3
android_intent: ^0.3.7+7
# Progress bar # Progress bar
progress_hud_v2: ^2.0.0 progress_hud_v2: ^2.0.0
percent_indicator: ^2.1.5 percent_indicator: ^2.1.5
# Icons # Icons
feather_icons_flutter: any
eva_icons_flutter: any
font_awesome_flutter: any font_awesome_flutter: any
cupertino_icons: ^0.1.3 cupertino_icons: ^1.0.0
# Image Attachments # Image Attachments
image_picker: ^0.6.7+1 image_picker: ^0.6.7+1
image_cropper: ^1.2.1
#GIF image #GIF image
flutter_gifimage: ^1.0.1 flutter_gifimage: ^1.0.1
photo_view: any photo_view: any
# flutter_webrtc: any # flutter_webrtc: any
# UI Reqs # UI Reqs
dotted_border: 1.0.5
expandable: ^4.1.4 expandable: ^4.1.4
hexcolor: ^1.0.1
# Notification Banner # Notification Banner
dropdown_banner: ^1.4.0 # dropdown_banner: ^1.4.0
flutter_xlider: ^3.4.0 # flutter_xlider: ^3.4.0
# flutter_local_notifications: # flutter_local_notifications:
# charts # charts
charts_flutter: ^0.9.0 charts_flutter: ^0.9.0
google_maps_flutter: ^1.0.3 google_maps_flutter: ^1.0.3
huawei_map: ^5.0.3+303 huawei_map: ^5.0.3+303
# Qr code Scanner TODO fix it # Qr code Scanner TODO fix it
# barcode_scanner: ^1.0.1 # barcode_scanner: ^1.0.1
flutter_polyline_points: ^0.1.0 flutter_polyline_points: ^0.1.0
location: ^2.3.5 location: ^2.3.5
# Qr code Scanner # Qr code Scanner
@ -102,15 +94,10 @@ dependencies:
rating_bar: ^0.2.0 rating_bar: ^0.2.0
# Calendar # Calendar
# table_calendar: ^2.3.0
syncfusion_flutter_calendar: ^18.4.49 syncfusion_flutter_calendar: ^18.4.49
# syncfusion_flutter_charts: any
# SVG Images # SVG Images
flutter_svg: ^0.18.0 flutter_svg: ^0.19.0
# Location Helper
map_launcher: ^0.8.1
#Calendar Events #Calendar Events
manage_calendar_events: ^1.0.2 manage_calendar_events: ^1.0.2
@ -127,15 +114,6 @@ dependencies:
#hijri #hijri
hijri: ^2.0.3 hijri: ^2.0.3
#Email Sender
flutter_email_sender: ^3.0.1
#Popup_window
popup_box: ^0.1.0
#Numbers
number_inc_dec: ^0.6.6
#datetime_picker #datetime_picker
flutter_datetime_picker: ^1.4.0 flutter_datetime_picker: ^1.4.0
# Carousel # Carousel
@ -159,19 +137,17 @@ dependencies:
flutter_webrtc: ^0.5.9 flutter_webrtc: ^0.5.9
screen: ^0.0.5 screen: ^0.0.5
#google maps places #google maps places
google_maps_place_picker: ^1.0.0 google_maps_place_picker: ^1.0.0
typewriter: ^0.0.3
#countdown timer for Upcoming List
# flutter_countdown_timer: ^1.4.0
#countdown timer for Upcoming List #countdown timer for Upcoming List
flutter_countdown_timer: ^1.6.0 flutter_countdown_timer: ^1.6.0
#Dependencies for video call implementation #Dependencies for video call implementation
native_device_orientation: ^0.3.0 native_device_orientation: ^0.3.0
enum_to_string: ^1.0.9 enum_to_string: ^1.0.9
# recase: ^3.0.0 wakelock: ^0.2.1+1
wakelock: ^0.1.4
after_layout: ^1.0.7 after_layout: ^1.0.7
twilio_programmable_video: ^0.6.2 twilio_programmable_video: ^0.6.2
cached_network_image: ^2.4.1 cached_network_image: ^2.4.1
@ -192,7 +168,7 @@ dependencies:
in_app_review: ^1.0.4 in_app_review: ^1.0.4
badges: ^1.1.4 badges: ^1.1.4
# open_settings: ^2.0.1
# Dep by Zohaib # Dep by Zohaib
shimmer: ^1.1.2 shimmer: ^1.1.2
carousel_slider: ^2.3.1 carousel_slider: ^2.3.1

Loading…
Cancel
Save