Pharmacy & smart watch data fixes

merge-update-with-lab-changes
haroon amjad 4 years ago
parent 7c6fa89d63
commit a646677fae

@ -1,128 +1,128 @@
{
"images":[
{
"idiom":"iphone",
"size":"20x20",
"scale":"2x",
"filename":"Icon-App-20x20@2x.png"
},
{
"idiom":"iphone",
"size":"20x20",
"scale":"3x",
"filename":"Icon-App-20x20@3x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"1x",
"filename":"Icon-App-29x29@1x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"2x",
"filename":"Icon-App-29x29@2x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"3x",
"filename":"Icon-App-29x29@3x.png"
},
{
"idiom":"iphone",
"size":"40x40",
"scale":"2x",
"filename":"Icon-App-40x40@2x.png"
},
{
"idiom":"iphone",
"size":"40x40",
"scale":"3x",
"filename":"Icon-App-40x40@3x.png"
},
{
"idiom":"iphone",
"size":"60x60",
"scale":"2x",
"filename":"Icon-App-60x60@2x.png"
},
{
"idiom":"iphone",
"size":"60x60",
"scale":"3x",
"filename":"Icon-App-60x60@3x.png"
},
{
"idiom":"iphone",
"size":"76x76",
"scale":"2x",
"filename":"Icon-App-76x76@2x.png"
},
{
"idiom":"ipad",
"size":"20x20",
"scale":"1x",
"filename":"Icon-App-20x20@1x.png"
},
{
"idiom":"ipad",
"size":"20x20",
"scale":"2x",
"filename":"Icon-App-20x20@2x.png"
},
{
"idiom":"ipad",
"size":"29x29",
"scale":"1x",
"filename":"Icon-App-29x29@1x.png"
},
{
"idiom":"ipad",
"size":"29x29",
"scale":"2x",
"filename":"Icon-App-29x29@2x.png"
},
{
"idiom":"ipad",
"size":"40x40",
"scale":"1x",
"filename":"Icon-App-40x40@1x.png"
},
{
"idiom":"ipad",
"size":"40x40",
"scale":"2x",
"filename":"Icon-App-40x40@2x.png"
},
{
"idiom":"ipad",
"size":"76x76",
"scale":"1x",
"filename":"Icon-App-76x76@1x.png"
},
{
"idiom":"ipad",
"size":"76x76",
"scale":"2x",
"filename":"Icon-App-76x76@2x.png"
},
{
"idiom":"ipad",
"size":"83.5x83.5",
"scale":"2x",
"filename":"Icon-App-83.5x83.5@2x.png"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"scale" : "1x",
"filename" : "ItunesArtwork@2x.png"
}
],
"info":{
"version":1,
"author":"easyappicon"
"images" : [
{
"filename" : "Icon-App-20x20@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "Icon-App-20x20@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "Icon-App-29x29@1x.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "Icon-App-29x29@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "Icon-App-29x29@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "Icon-App-40x40@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "Icon-App-40x40@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "Icon-App-60x60@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "Icon-App-60x60@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "Icon-App-20x20@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "Icon-App-20x20@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "Icon-App-29x29@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "Icon-App-29x29@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "Icon-App-40x40@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "Icon-App-40x40@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "Icon-App-76x76@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "Icon-App-76x76@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "Icon-App-83.5x83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "icon.jpg",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
},
{
"filename" : "Icon-App-76x76@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "76x76"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

@ -1729,4 +1729,5 @@ const Map localizedValues = {
"gramsPerDay": {"en": "Grams Per Day", "ar": "غرام في اليوم"},
"gr": {"en": "gr", "ar": "غرام"},
"gramsPerMeal": {"en": "Grams Per Meal", "ar": "عدد الجرامات لكل وجبة"},
"syncSuccess": {"en": "Data Synced Successfully", "ar": "تمت مزامنة البيانات بنجاح"},
};

@ -467,7 +467,9 @@ class BaseAppClient {
onFailure(TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode);
Navigator.of(AppGlobal.context).pushNamed(HOME);
} else {
onFailure('Error While Fetching data', statusCode);
var bodyUtf = json.decode(utf8.decode(response.bodyBytes));
print(bodyUtf);
onFailure(bodyUtf['error']['ErrorEndUserMsg'], statusCode);
}
} else {
// var parsed = json.decode(response.body.toString());

@ -166,8 +166,7 @@ class OrderPreviewViewModel extends BaseViewModel {
}
getInformationsByAddress(String identificationNo) async {
await getShippingOption();
await getLacumAccountInformation(identificationNo);
await getShippingOption(identificationNo);
}
getLacumAccountInformation(String identificationNo) async {
@ -194,18 +193,18 @@ class OrderPreviewViewModel extends BaseViewModel {
}
}
getShippingOption() async {
Future getShippingOption(String identificationNo) async {
setState(ViewState.Busy);
await _orderService.getShippingOption(paymentCheckoutData.address).then((res) {
paymentCheckoutData.shippingOption = ShippingOption.fromJson(res);
setState(ViewState.Idle);
await _orderService.getShippingOption(paymentCheckoutData.address).then((res) async {
if (_orderService.hasError) {
error = _orderService.error;
setState(ViewState.Error);
} else {
paymentCheckoutData.shippingOption = ShippingOption.fromJson(res);
setState(ViewState.Idle);
await getLacumAccountInformation(identificationNo);
}
});
if (_orderService.hasError) {
error = _orderService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future makeOrder() async {

@ -4,15 +4,13 @@ class healthData {
String MachineDate;
double Value;
int TransactionsListID;
String Notes;
healthData({
this.MedCategoryID,
this.MedSubCategoryID,
this.MachineDate,
this.Value,
this.TransactionsListID,
this.Notes,
this.TransactionsListID
});
healthData.fromJson(Map<String, dynamic> json) {
@ -21,7 +19,6 @@ class healthData {
MachineDate = json['MachineDate'];
Value = json['Value'];
TransactionsListID = json['TransactionsListID'];
Notes = json['Notes'];
}
Map<String, dynamic> toJson() {
@ -31,7 +28,6 @@ class healthData {
data['MachineDate'] = this.MachineDate;
data['Value'] = this.Value;
data['TransactionsListID'] = this.TransactionsListID;
data['Notes'] = this.Notes;
return data;
}
}

@ -1,6 +1,7 @@
import 'package:collection/collection.dart';
import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart';
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -149,8 +150,7 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
}
}
date = DateUtil.convertDateToString(date);
Med_InsertTransactionsInputsList.add(
healthData(MedCategoryID: MedCategoryID, MedSubCategoryID: MedSubCategoryID, MachineDate: date, Value: value, TransactionsListID: TransactionsListID++, Notes: ""));
Med_InsertTransactionsInputsList.add(healthData(MedCategoryID: MedCategoryID, MedSubCategoryID: MedSubCategoryID, MachineDate: date, Value: value, TransactionsListID: TransactionsListID++));
});
}
}
@ -197,27 +197,17 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
// to convert from meter to km
totalDistance += (element['Value'] * 0.001);
} else if (element['MedCategoryID'] == 3) {
print("HeartRate");
// 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: ""));
MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++));
Med_InsertTransactionsInputsList2.add(new healthData(
MedCategoryID: 4,
MedSubCategoryID: element['MedSubCategoryID'],
MachineDate: DateUtil.convertDateToString(date),
Value: element['Value'],
TransactionsListID: TransactionsListID++,
Notes: ""));
MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++));
}
// else if(element['MedCategoryID'] == 8){
//
@ -235,27 +225,16 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
}
Med_InsertTransactionsInputsList2.add(
new healthData(MedCategoryID: 6, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: totalSteps, TransactionsListID: TransactionsListID++, Notes: ""));
new healthData(MedCategoryID: 6, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToStringLocation(date), Value: totalSteps, TransactionsListID: TransactionsListID++));
Med_InsertTransactionsInputsList2.add(
new healthData(MedCategoryID: 7, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: totalDistance, TransactionsListID: TransactionsListID++, Notes: ""));
new healthData(MedCategoryID: 7, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToStringLocation(date), Value: totalDistance, TransactionsListID: TransactionsListID++));
Med_InsertTransactionsInputsList2.add(
new healthData(MedCategoryID: 3, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: avgTotalHeartRate, TransactionsListID: TransactionsListID++, Notes: ""));
new healthData(MedCategoryID: 3, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToStringLocation(date), Value: avgTotalHeartRate, TransactionsListID: TransactionsListID++));
});
addInsertTransactionsInputsList();
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() {
@ -264,7 +243,7 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
SmartWatchIntegrationService service = new SmartWatchIntegrationService();
service.insertPatientHealthData(Med_InsertTransactionsInputsList2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
AppToast.showSuccessToast(message: TranslationBase.of(context).syncSuccess);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);

@ -1,11 +1,15 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/footor/quantity_box.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import '../../../../../locator.dart';
@ -35,6 +39,7 @@ class _FooterWidgetState extends State<FooterWidget> {
double quantityUI = 80;
bool showUI = false;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppSharedPreferences sharedPref = new AppSharedPreferences();
@override
Widget build(BuildContext context) {
@ -182,9 +187,7 @@ class _FooterWidgetState extends State<FooterWidget> {
disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
login();
} else
await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
},
@ -204,12 +207,9 @@ class _FooterWidgetState extends State<FooterWidget> {
disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
login();
} else {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
}
},
fontWeight: FontWeight.w600,
@ -227,6 +227,37 @@ class _FooterWidgetState extends State<FooterWidget> {
);
}
void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
}
login() async {
final authService = new AuthProvider();
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context);
if (value != null) {
setUserValues(value);
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
});
}
}
onChangeValue(int i) {
setState(() {
widget.quantity = i;

@ -126,11 +126,16 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
GifLoaderDialogUtils.showMyDialog(context);
await widget.orderPreviewViewModel.getInformationsByAddress(widget.orderPreviewViewModel.user.patientIdentificationNo);
await widget.orderPreviewViewModel.getShoppingCart();
// widget.changeMainState();
GifLoaderDialogUtils.hideDialog(context);
model.saveSelectedAddressLocally(model.addresses[model.selectedAddressIndex]);
_navigateToPaymentOption(model);
if (widget.orderPreviewViewModel.error == "") {
await widget.orderPreviewViewModel.getShoppingCart();
GifLoaderDialogUtils.hideDialog(context);
model.saveSelectedAddressLocally(model.addresses[model.selectedAddressIndex]);
_navigateToPaymentOption(model);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.orderPreviewViewModel.error);
return;
}
},
),
),

@ -18,7 +18,6 @@ import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -84,8 +83,6 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
);
}
}
// this.isLogin = user != null;
}
void initState() {
@ -101,511 +98,512 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
@override
Widget build(BuildContext context) {
return BaseView<OrderModelViewModel>(
onModelReady: (model) async {
// var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
// var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
// GifLoaderDialogUtils.showMyDialog(context);
// model.getOrder(customerId, customerGUID, page_id);
// GifLoaderDialogUtils.hideDialog(context);
},
builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount,
isShowAppBar: true,
isShowDecPage: true,
isPharmacy: true,
onModelReady: (model) async {
// var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
// var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
// GifLoaderDialogUtils.showMyDialog(context);
// model.getOrder(customerId, customerGUID, page_id);
// GifLoaderDialogUtils.hideDialog(context);
},
builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount,
isShowAppBar: true,
isShowDecPage: true,
isPharmacy: true,
//isBottomBar: true,
isMainPharmacyPages: true,
body: user != null
? Container(
color: Colors.white,
child: SingleChildScrollView(
child: Column(
//isBottomBar: true,
isMainPharmacyPages: true,
body: user != null
? Container(
color: Colors.white,
child: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
child: Row(
children: <Widget>[
Container(
child: Row(
children: <Widget>[
Container(
child: Row(
children: <Widget>[
Container(
padding: EdgeInsets.only(
top: 20.0,
left: 10.0,
right: 10.0,
bottom: 10.0,
),
child: LargeAvatar(
name: user.firstName.toString(),
url: '',
),
),
Column(children: <Widget>[
Row(children: <Widget>[
Text(
TranslationBase.of(context).welcome,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, color: Colors.grey),
),
]),
SizedBox(
height: 10,
),
Row(children: <Widget>[
Text(
languageID == "ar" ? user.firstNameN.toString() + " " + user.lastNameN.toString() : user.firstName.toString() + " " + user.lastName.toString(),
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
),
]),
]),
],
padding: EdgeInsets.only(
top: 20.0,
left: 10.0,
right: 10.0,
bottom: 10.0,
),
)
],
),
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 15,
),
Container(
child: Row(
children: <Widget>[
Expanded(
child: InkWell(
onTap: () {
if (customerId == null) {
AppToast.showErrorToast(message: "Customer not found");
return;
}
Navigator.push(context, FadePage(page: OrderPage(customerID: customerId, customerGUID: customerGUID)));
},
child: Column(
children: <Widget>[
// Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')),
SvgPicture.asset(
'assets/images/pharmacy/orders_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).orders,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
child: LargeAvatar(
name: user.firstName.toString(),
url: '',
),
),
),
Expanded(
child: InkWell(
onTap: () {
if (customerId == null || customerId == '')
Navigator.push(context, FadePage(page: LakumActivationVidaPage()));
else
Navigator.push(context, FadePage(page: LakumMainPage()));
},
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/lakum_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).lakum,
style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold),
),
],
Column(children: <Widget>[
Row(children: <Widget>[
Text(
TranslationBase.of(context).welcome,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, color: Colors.grey),
),
]),
SizedBox(
height: 10,
),
Row(children: <Widget>[
Text(
languageID == "ar" ? user.firstNameN.toString() + " " + user.lastNameN.toString() : user.firstName.toString() + " " + user.lastName.toString(),
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
),
]),
]),
],
),
)
],
),
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 15,
),
Container(
child: Row(
children: <Widget>[
Expanded(
child: InkWell(
onTap: () {
if (customerId == null) {
AppToast.showErrorToast(message: "Customer not found");
return;
}
Navigator.push(context, FadePage(page: OrderPage(customerID: customerId, customerGUID: customerGUID)));
},
child: Column(
children: <Widget>[
// Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')),
SvgPicture.asset(
'assets/images/pharmacy/orders_icon.svg',
width: 50,
height: 50,
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: WishlistPage()));
},
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/wishlist_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).wishlist,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
SizedBox(
height: 5,
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyReviewsPage()));
},
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/review_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).reviews,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
Text(
TranslationBase.of(context).orders,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
),
],
)),
SizedBox(
height: 15,
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
],
),
),
Container(
padding: EdgeInsets.only(left: 10.0),
),
Expanded(
child: InkWell(
onTap: () {
if (customerId == null || customerId == '')
Navigator.push(context, FadePage(page: LakumActivationVidaPage()));
else
Navigator.push(context, FadePage(page: LakumMainPage()));
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
TranslationBase.of(context).myAccount,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),
SvgPicture.asset(
'assets/images/pharmacy/lakum_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 10,
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
Text(
TranslationBase.of(context).lakum,
style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold),
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: HomePrescriptionsPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/my_prescription_icon.svg',
width: 28,
height: 28,
),
SizedBox(
width: 15,
),
Text(
TranslationBase.of(context).myPrescription,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
],
),
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: WishlistPage()));
},
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/wishlist_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: ComparePage()));
},
child: Row(
children: <Widget>[
Image.asset('assets/images/pharmacy/compare.png', width: 35, height: 35),
SizedBox(
width: 15,
),
Text(
TranslationBase.of(context).compare,
style: TextStyle(
fontSize: 13.0,
),
),
],
Text(
TranslationBase.of(context).wishlist,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
Expanded(
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyReviewsPage()));
},
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/review_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: HomePrescriptionsPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/medication_refill_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).medicationsRefill,
style: TextStyle(
fontSize: 13.0,
),
),
],
Text(
TranslationBase.of(context).reviews,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
],
)),
SizedBox(
height: 15,
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
padding: EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
TranslationBase.of(context).myAccount,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),
),
SizedBox(
height: 10,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: HomePrescriptionsPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/my_prescription_icon.svg',
width: 28,
height: 28,
),
SizedBox(
height: 5,
width: 15,
),
Divider(
color: Colors.grey,
height: 20,
Text(
TranslationBase.of(context).myPrescription,
style: TextStyle(
fontSize: 13.0,
),
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyFamily()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/my_family_icon.svg',
width: 20,
height: 20,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).family,
style: TextStyle(
fontSize: 13.0,
),
),
],
],
),
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: ComparePage()));
},
child: Row(
children: <Widget>[
Image.asset('assets/images/pharmacy/compare.png', width: 35, height: 35),
SizedBox(
width: 15,
),
Text(
TranslationBase.of(context).compare,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: HomePrescriptionsPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/medication_refill_icon.svg',
width: 30,
height: 30,
),
SizedBox(
height: 5,
width: 20,
),
Text(
TranslationBase.of(context).medicationsRefill,
style: TextStyle(
fontSize: 13.0,
),
),
Divider(
color: Colors.grey,
],
),
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyFamily()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/my_family_icon.svg',
width: 20,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: PharmacyAddressesPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/shipping_addresses_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).shippingAddresses,
style: TextStyle(
fontSize: 13.0,
),
),
],
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).family,
style: TextStyle(
fontSize: 13.0,
),
),
SizedBox(
height: 5,
],
),
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: PharmacyAddressesPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/shipping_addresses_icon.svg',
width: 30,
height: 30,
),
Divider(
color: Colors.grey,
height: 20,
SizedBox(
width: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: PharmacyTermsConditions()));
},
child: Row(
children: <Widget>[
Image.asset(
'assets/images/pharmacy/terms.png',
width: 25,
height: 25,
),
SizedBox(
width: 10,
),
Text(
TranslationBase.of(context).conditionsHMG,
style: TextStyle(
fontSize: 13.0,
),
),
],
Text(
TranslationBase.of(context).shippingAddresses,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: PharmacyTermsConditions()));
},
child: Row(
children: <Widget>[
Image.asset(
'assets/images/pharmacy/terms.png',
width: 25,
height: 25,
),
SizedBox(
height: 5,
width: 10,
),
Divider(
color: Colors.grey,
height: 20,
Text(
TranslationBase.of(context).conditionsHMG,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: LakumTermsConditions(this.identificationNo, this.firstName, this.lastName, this.mobileNo, this.languageId)));
},
child: Row(
children: <Widget>[
Image.asset(
'assets/images/pharmacy/terms.png',
width: 25,
height: 25,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: LakumTermsConditions(this.identificationNo, this.firstName, this.lastName, this.mobileNo, this.languageId)));
},
child: Row(
children: <Widget>[
Image.asset(
'assets/images/pharmacy/terms.png',
width: 25,
height: 25,
),
// IconButton(icon: Icon(Icons.error_outline), iconSize: 30,
// color: Colors.black,),
SizedBox(
width: 10,
),
Text(
TranslationBase.of(context).conditions,
style: TextStyle(
fontSize: 13.0,
),
),
],
SizedBox(
width: 10,
),
Text(
TranslationBase.of(context).conditions,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
],
),
),
SizedBox(
height: 10,
),
Divider(
color: Colors.grey[350],
height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
padding: EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
TranslationBase.of(context).reachUs,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),
),
SizedBox(
height: 10,
height: 5,
),
Divider(
color: Colors.grey[350],
color: Colors.grey,
height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
padding: EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: LiveChatPage()));
},
child: Row(
children: <Widget>[
Text(
TranslationBase.of(context).reachUs,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),
SvgPicture.asset(
'assets/images/pharmacy/contact_us_icon.svg',
width: 20,
height: 20,
),
SizedBox(
height: 5,
width: 20,
),
Divider(
color: Colors.grey,
height: 20,
Text(
TranslationBase.of(context).contactUs,
style: TextStyle(fontSize: 13.0),
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: LiveChatPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/contact_us_icon.svg',
width: 20,
height: 20,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).contactUs,
style: TextStyle(fontSize: 13.0),
),
],
),
],
),
),
SizedBox(
height: 5,
),
Divider(
color: Colors.grey,
height: 20,
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: FindUsPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/our_locations_icon.svg',
width: 30,
height: 30,
),
SizedBox(
height: 5,
width: 20,
),
Divider(
color: Colors.grey,
height: 20,
Text(
TranslationBase.of(context).ourLocations,
style: TextStyle(fontSize: 13.0),
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: FindUsPage()));
},
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/our_locations_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).ourLocations,
style: TextStyle(fontSize: 13.0),
),
],
),
)
],
),
)
],
),
),
)
: Container(),
));
)
],
),
),
)
: Container(),
),
);
}
}

@ -2792,6 +2792,7 @@ class TranslationBase {
String get cancelReminder => localizedValues["CancelReminder"][locale.languageCode];
String get reminderCancelSuccess => localizedValues["reminderCancelSuccess"][locale.languageCode];
String get syncSuccess => localizedValues["syncSuccess"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -48,9 +48,9 @@ class MyInAppBrowser extends InAppBrowser {
static String PACKAGES_PAYMENT_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess';
static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed';
static List<String> successURLS = ['success', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete'];
static List<String> successURLS = ['success', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete', 'orderdetails'];
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed'];
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails'];
final Function onExitCallback;
final Function onLoadStartCallback;

@ -1,16 +1,16 @@
import 'package:diplomaticquarterapp/Constants.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/login/welcome.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../locator.dart';
class BottomNavPharmacyItem extends StatelessWidget {
final String title;
final IconData icon;
@ -22,15 +22,10 @@ class BottomNavPharmacyItem extends StatelessWidget {
final bool isHome;
final IconData activeIcon;
BottomNavPharmacyItem(
{this.icon,
this.changeIndex,
this.index,
this.currentIndex,
this.activeIcon,
this.title,
this.onTap,
this.isHome = false});
BottomNavPharmacyItem({this.icon, this.changeIndex, this.index, this.currentIndex, this.activeIcon, this.title, this.onTap, this.isHome = false});
AppSharedPreferences sharedPref = AppSharedPreferences();
@override
Widget build(BuildContext context) {
@ -39,7 +34,7 @@ class BottomNavPharmacyItem extends StatelessWidget {
return Expanded(
child: SizedBox(
height: 66.0,
height: 66.0,
child: Stack(
clipBehavior: Clip.none,
children: [
@ -49,13 +44,8 @@ class BottomNavPharmacyItem extends StatelessWidget {
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
onTap: () {
if (!Provider.of<ProjectViewModel>(context, listen: false)
.isLogin &&
(currentIndex == 2 || currentIndex == 3))
Navigator.push(
context,
FadePage(page: WelcomeLogin()),
);
if (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && (currentIndex == 2 || currentIndex == 3))
login(context);
else
changeIndex(currentIndex);
},
@ -63,9 +53,6 @@ class BottomNavPharmacyItem extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
// SizedBox(
// height: 15,
// ),
currentIndex == index
? Divider(
color: Color(0xff5AB133),
@ -93,20 +80,14 @@ class BottomNavPharmacyItem extends StatelessWidget {
title,
textAlign: TextAlign.center,
color: currentIndex == index ? Colors.grey : Colors.grey,
fontWeight: currentIndex == index
? FontWeight.normal
: FontWeight.w400,
fontWeight: currentIndex == index ? FontWeight.normal : FontWeight.w400,
fontSize: currentIndex == index ? 11 : 9,
),
],
),
),
),
if (currentIndex == 3 &&
Provider.of<OrderPreviewViewModel>(context, listen: false)
.cartResponse
.quantityCount !=
0)
if (currentIndex == 3 && Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount != 0)
Positioned(
top: 11.5,
right: -3.5,
@ -131,4 +112,35 @@ class BottomNavPharmacyItem extends StatelessWidget {
),
);
}
void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
}
login(BuildContext context) async {
final authService = new AuthProvider();
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context);
if (value != null) {
setUserValues(value);
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
});
}
}
}

Loading…
Cancel
Save