Updates & fixes

merge-requests/462/head
haroon amjad 4 years ago
parent 5474ecf2cc
commit b08dfb117c

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

@ -14,8 +14,8 @@ const PACKAGES_PRODUCTS = '/api/products';
const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -457,6 +457,11 @@ const ADD_RRT_ORDER_RC = "rc/api/rrt/add";
const GET_ALL_RRT_ORDERS_RC = "rc/api/rrt/list";
const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update';
// PRESCRIPTION RC SERVICES
const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list";
const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update';
//Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/";

@ -1596,7 +1596,7 @@ const Map localizedValues = {
"ios-instructions-2": { "en": "Make sure that your Apple Watch is connected with the Watch & Health Apps.", "ar": "تأكد من اتصال Apple Watch بتطبيقات Watch & Health." },
"ios-instructions-3": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق صحتك." },
"supportedWatches": { "en": "Supported SmartWatches", "ar": "الساعات الذكية المدعومة" },
"watchInstructions": { "en": "Watch Instructions:", "ar": "تعليمات الساعة:" },
"watchInstructions": { "en": "View watch instructions", "ar": "عرض تعليمات الساعة" },
"monthlyTab": {"en": "Monthly", "ar": "شهري"},
"moreSupportedWatches": {"en": "More Supported Smartwatches...", "ar": "المزيد من الساعات الذكية المدعومة..."},
"android-instructions-1": { "en": "Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", "ar": "تأكد من تثبيت تطبيقات 'WearOS' و 'Google Fit' من متجر Google PlayStore." },

@ -2,13 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PrescriptionDeliveryService extends BaseService {
Future insertDeliveryOrder(
{int lineItemNo,
double latitude,
double longitude,
int appointmentNo,
int createdBy,
int dischargeID}) async {
Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['LineItemNo'] = lineItemNo;
@ -17,11 +11,26 @@ class PrescriptionDeliveryService extends BaseService {
body['AppointmentNo'] = appointmentNo;
body['CreatedBy'] = createdBy;
body['DischargeID'] = dischargeID;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
var asd="";
},
onFailure: (String error, int statusCode) {
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) {
var asd = "";
}, onFailure: (String error, int statusCode) {
hasError = true;
print(error);
super.error = error;
}, body: body);
}
Future insertDeliveryOrderRC({double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['latitude'] = latitude;
body['longitude'] = longitude;
body['AppointmentNo'] = appointmentNo;
body['CreatedBy'] = createdBy;
body['DischargeID'] = dischargeID;
await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {
var asd = "";
}, onFailure: (String error, int statusCode) {
hasError = true;
print(error);
super.error = error;

@ -7,15 +7,11 @@ import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
class PrescriptionDeliveryViewModel extends BaseViewModel {
CustomerAddressesService _customerAddressesService =
locator<CustomerAddressesService>();
PharmacyModuleService _pharmacyModuleService =
locator<PharmacyModuleService>();
PrescriptionDeliveryService _prescriptionDeliveryService =
locator<PrescriptionDeliveryService>();
CustomerAddressesService _customerAddressesService = locator<CustomerAddressesService>();
PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>();
PrescriptionDeliveryService _prescriptionDeliveryService = locator<PrescriptionDeliveryService>();
List<AddressInfo> get addressesList =>
_customerAddressesService.addressesList;
List<AddressInfo> get addressesList => _customerAddressesService.addressesList;
Future getCustomerInfo() async {
setState(ViewState.Busy);
@ -27,28 +23,16 @@ class PrescriptionDeliveryViewModel extends BaseViewModel {
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
} else {
}
} else {}
await getCustomerAddresses();
}
Future insertDeliveryOrder(
{int lineItemNo,
double latitude,
double longitude,
int appointmentNo,
int createdBy,
int dischargeID}) async {
Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async {
setState(ViewState.BusyLocal);
await _prescriptionDeliveryService.insertDeliveryOrder(
lineItemNo: lineItemNo,
latitude: latitude,
longitude: longitude,
appointmentNo: appointmentNo,
createdBy: createdBy,
dischargeID: dischargeID
);
// await _prescriptionDeliveryService.insertDeliveryOrder(
// lineItemNo: lineItemNo, latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID);
await _prescriptionDeliveryService.insertDeliveryOrderRC(
latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID);
if (_prescriptionDeliveryService.hasError) {
error = _prescriptionDeliveryService.error;
setState(ViewState.ErrorLocal);

@ -77,7 +77,6 @@ class PrescriptionsViewModel extends BaseViewModel {
}
getPrescriptionsOrders({bool showLoading = false}) async {
// print(showLoading);
setState(ViewState.Busy);
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
await _prescriptionsService.getPrescriptionsOrders();

@ -1,16 +1,12 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'package:diplomaticquarterapp/core/service/medical/prescriptions_service.dart';
//import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProduct_service.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
@ -20,13 +16,11 @@ import '../../../locator.dart';
class PharmacyModuleViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
RecommendedProductService _recommendedProductService =
locator<RecommendedProductService>();
RecommendedProductService _recommendedProductService = locator<RecommendedProductService>();
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
List<RecommendedProductModel> get recommendedProductList =>
_recommendedProductService.recommendedList;
List<RecommendedProductModel> get recommendedProductList => _recommendedProductService.recommendedList;
Future generatePharmacyToken() async {
setState(ViewState.Busy);
@ -40,8 +34,6 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
Future verifyCustomer() async {
// if (authenticatedUserObject.isLogin) await generatePharmacyToken();
var data = await sharedPref.getObject(USER_PROFILE);
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
@ -70,11 +62,9 @@ class PharmacyModuleViewModel extends BaseViewModel {
Future getBannerList() async {
if (bannerList.isEmpty) {
GifLoaderDialogUtils.showMyDialog(
locator<NavigationService>().navigatorKey.currentContext);
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
await _pharmacyService.getBannerListList();
GifLoaderDialogUtils.hideDialog(
locator<NavigationService>().navigatorKey.currentContext);
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
@ -83,9 +73,15 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
}
List<String> getBannerImagesUrl() {
List<String> getBannerImagesUrl(ProjectViewModel projectViewModel) {
List<String> images = List();
images.add('assets/images/pharmacy_module/pharmacy_logo_green.png');
if (projectViewModel.isArabic)
images.add('assets/images/pharmacy_module/offers_banner_ar.png');
else
images.add('assets/images/pharmacy_module/offers_banner.png');
_pharmacyService.bannerItems.forEach((element) {
images.add(element.src);
});

@ -171,7 +171,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(context);
await model
.insertDeliveryOrder(
lineItemNo: 0,
lineItemNo: 1,
longitude: longitude,
latitude: latitude,
appointmentNo: prescriptions.appointmentNo,

@ -107,7 +107,11 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
child: new TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
isWeeklyDataLoaded ? getWeeklyHeartRateDetails() : Container(),
isWeeklyDataLoaded
? avgWeeklyHearRateValue != 0
? getWeeklyHeartRateDetails()
: getNoDataWidget(context)
: Container(),
isMonthlyDataLoaded ? getMonthlyHeartRateDetails() : Container(),
isYearlyDataLoaded ? getYearlyHeartRateDetails() : Container()
],
@ -135,9 +139,11 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
weeklyDataLength++;
}
});
generateWeekData();
if (weekyHearRateList.isNotEmpty) generateWeekData();
setState(() {
weeklyStatsAvgValue = avgWeeklyHearRateValue ~/ weeklyDataLength;
if (avgWeeklyHearRateValue != 0) {
weeklyStatsAvgValue = avgWeeklyHearRateValue ~/ weeklyDataLength;
}
isWeeklyDataLoaded = true;
});
}).catchError((err) {

@ -50,10 +50,8 @@ class _PharmacyPageState extends State<PharmacyPage> {
width: double.infinity,
child: SingleChildScrollView(
child: Column(
//crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BannerPager(model),
GridViewButtons(model),
PrescriptionsWidget(),
ShopByBrandWidget(),
RecentlyViewedWidget(),

@ -1,10 +1,15 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/GridViewCard.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class BannerPager extends StatefulWidget {
final PharmacyModuleViewModel _model;
@ -20,14 +25,16 @@ class _BannerPagerState extends State<BannerPager> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
child: Column(
children: [
CarouselSlider(
options: CarouselOptions(
aspectRatio: 7 / 2,
aspectRatio: 5 / 2,
enlargeCenterPage: true,
enableInfiniteScroll: false,
viewportFraction: 1.0,
initialPage: 0,
autoPlay: true,
autoPlayInterval: Duration(seconds: 3),
@ -39,53 +46,44 @@ class _BannerPagerState extends State<BannerPager> {
});
},
),
items: widget._model
.getBannerImagesUrl()
.mapIndexed(
(item, index) => InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: OffersCategorisePage()));
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 1.0),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5.0)),
child: Center(
child: index == 0
? Image.asset(
item,
fit: BoxFit.cover,
)
: CachedNetworkImage(
imageUrl: item,
fit: BoxFit.fitWidth,
errorWidget: (context, url, error) =>
SizedBox()),
),
items: widget._model.getBannerImagesUrl(projectViewModel).mapIndexed(
(item, index) {
return InkWell(
onTap: () {
Navigator.push(context, FadePage(page: OffersCategorisePage()));
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 1.0),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5.0)),
child: Center(
child: index == 0 || index == 1
? Image.asset(
item,
fit: BoxFit.cover,
)
: CachedNetworkImage(imageUrl: item, fit: BoxFit.fitWidth, errorWidget: (context, url, error) => SizedBox()),
),
),
),
)
.toList(),
);
},
).toList(),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: widget._model
.getBannerImagesUrl()
.getBannerImagesUrl(projectViewModel)
.mapIndexed(
(item, index) => Container(
width: 12.0,
height: 4.0,
margin:
EdgeInsets.symmetric(vertical: 0.0, horizontal: 2.0),
margin: EdgeInsets.symmetric(vertical: 0.0, horizontal: 2.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: _current == index
? Color.fromRGBO(0, 250, 0, 0.9)
: Color.fromRGBO(0, 0, 0, 0.4),
color: _current == index ? Color.fromRGBO(0, 250, 0, 0.9) : Color.fromRGBO(0, 0, 0, 0.4),
),
),
)

@ -39,44 +39,44 @@ class GridViewButtons extends StatelessWidget {
Navigator.push(context, FadePage(page: OffersCategorisePage()));
}),
),
DashboardItem(
imageName: 'pharmacy_module/bg_2.png',
opacity: 0,
hasColorFilter: false,
child: GridViewCard(TranslationBase.of(context).medicationRefill,
'assets/images/pharmacy_module/medication_icon.png', () {
Navigator.push(
context, FadePage(page: HomePrescriptionsPage()));
// model.checkUserIsActivated().then((isActivated) {
// if (isActivated) {
// Navigator.push(context, FadePage(page: LakumMainPage()));
// } else {
// Navigator.push(
// context, FadePage(page: LakumActivationVidaPage()));
// }
// });
}),
),
DashboardItem(
imageName: 'pharmacy_module/bg_3.png',
opacity: 0,
hasColorFilter: false,
child: GridViewCard(TranslationBase.of(context).myPrescriptions,
'assets/images/pharmacy_module/prescription_icon.png', () {
Navigator.push(
context, FadePage(page: HomePrescriptionsPage()));
}),
),
DashboardItem(
imageName: 'pharmacy_module/bg_4.png',
opacity: 0,
hasColorFilter: false,
child: GridViewCard(
TranslationBase.of(context).searchAndScanMedication,
'assets/images/pharmacy_module/search_scan_icon.png',
() {Navigator.push(context, FadePage(page: SearchProductsPage()));}),
),
// DashboardItem(
// imageName: 'pharmacy_module/bg_2.png',
// opacity: 0,
// hasColorFilter: false,
// child: GridViewCard(TranslationBase.of(context).medicationRefill,
// 'assets/images/pharmacy_module/medication_icon.png', () {
// Navigator.push(
// context, FadePage(page: HomePrescriptionsPage()));
//
// // model.checkUserIsActivated().then((isActivated) {
// // if (isActivated) {
// // Navigator.push(context, FadePage(page: LakumMainPage()));
// // } else {
// // Navigator.push(
// // context, FadePage(page: LakumActivationVidaPage()));
// // }
// // });
// }),
// ),
// DashboardItem(
// imageName: 'pharmacy_module/bg_3.png',
// opacity: 0,
// hasColorFilter: false,
// child: GridViewCard(TranslationBase.of(context).myPrescriptions,
// 'assets/images/pharmacy_module/prescription_icon.png', () {
// Navigator.push(
// context, FadePage(page: HomePrescriptionsPage()));
// }),
// ),
// DashboardItem(
// imageName: 'pharmacy_module/bg_4.png',
// opacity: 0,
// hasColorFilter: false,
// child: GridViewCard(
// TranslationBase.of(context).searchAndScanMedication,
// 'assets/images/pharmacy_module/search_scan_icon.png',
// () {Navigator.push(context, FadePage(page: SearchProductsPage()));}),
// ),
],
),
),

Loading…
Cancel
Save