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

merge-requests/533/head
Fatimah Alshammari 4 years ago
commit a2a6da1527

@ -1,128 +1,128 @@
{ {
"images":[ "images" : [
{ {
"idiom":"iphone", "filename" : "Icon-App-20x20@2x.png",
"size":"20x20", "idiom" : "iphone",
"scale":"2x", "scale" : "2x",
"filename":"Icon-App-20x20@2x.png" "size" : "20x20"
}, },
{ {
"idiom":"iphone", "filename" : "Icon-App-20x20@3x.png",
"size":"20x20", "idiom" : "iphone",
"scale":"3x", "scale" : "3x",
"filename":"Icon-App-20x20@3x.png" "size" : "20x20"
}, },
{ {
"idiom":"iphone", "filename" : "Icon-App-29x29@1x.png",
"size":"29x29", "idiom" : "iphone",
"scale":"1x", "scale" : "1x",
"filename":"Icon-App-29x29@1x.png" "size" : "29x29"
}, },
{ {
"idiom":"iphone", "filename" : "Icon-App-29x29@2x.png",
"size":"29x29", "idiom" : "iphone",
"scale":"2x", "scale" : "2x",
"filename":"Icon-App-29x29@2x.png" "size" : "29x29"
}, },
{ {
"idiom":"iphone", "filename" : "Icon-App-29x29@3x.png",
"size":"29x29", "idiom" : "iphone",
"scale":"3x", "scale" : "3x",
"filename":"Icon-App-29x29@3x.png" "size" : "29x29"
}, },
{ {
"idiom":"iphone", "filename" : "Icon-App-40x40@2x.png",
"size":"40x40", "idiom" : "iphone",
"scale":"2x", "scale" : "2x",
"filename":"Icon-App-40x40@2x.png" "size" : "40x40"
}, },
{ {
"idiom":"iphone", "filename" : "Icon-App-40x40@3x.png",
"size":"40x40", "idiom" : "iphone",
"scale":"3x", "scale" : "3x",
"filename":"Icon-App-40x40@3x.png" "size" : "40x40"
}, },
{ {
"idiom":"iphone", "filename" : "Icon-App-60x60@2x.png",
"size":"60x60", "idiom" : "iphone",
"scale":"2x", "scale" : "2x",
"filename":"Icon-App-60x60@2x.png" "size" : "60x60"
}, },
{ {
"idiom":"iphone", "filename" : "Icon-App-60x60@3x.png",
"size":"60x60", "idiom" : "iphone",
"scale":"3x", "scale" : "3x",
"filename":"Icon-App-60x60@3x.png" "size" : "60x60"
}, },
{ {
"idiom":"iphone", "filename" : "Icon-App-20x20@1x.png",
"size":"76x76", "idiom" : "ipad",
"scale":"2x", "scale" : "1x",
"filename":"Icon-App-76x76@2x.png" "size" : "20x20"
}, },
{ {
"idiom":"ipad", "filename" : "Icon-App-20x20@2x.png",
"size":"20x20", "idiom" : "ipad",
"scale":"1x", "scale" : "2x",
"filename":"Icon-App-20x20@1x.png" "size" : "20x20"
}, },
{ {
"idiom":"ipad", "filename" : "Icon-App-29x29@1x.png",
"size":"20x20", "idiom" : "ipad",
"scale":"2x", "scale" : "1x",
"filename":"Icon-App-20x20@2x.png" "size" : "29x29"
}, },
{ {
"idiom":"ipad", "filename" : "Icon-App-29x29@2x.png",
"size":"29x29", "idiom" : "ipad",
"scale":"1x", "scale" : "2x",
"filename":"Icon-App-29x29@1x.png" "size" : "29x29"
}, },
{ {
"idiom":"ipad", "filename" : "Icon-App-40x40@1x.png",
"size":"29x29", "idiom" : "ipad",
"scale":"2x", "scale" : "1x",
"filename":"Icon-App-29x29@2x.png" "size" : "40x40"
}, },
{ {
"idiom":"ipad", "filename" : "Icon-App-40x40@2x.png",
"size":"40x40", "idiom" : "ipad",
"scale":"1x", "scale" : "2x",
"filename":"Icon-App-40x40@1x.png" "size" : "40x40"
}, },
{ {
"idiom":"ipad", "filename" : "Icon-App-76x76@1x.png",
"size":"40x40", "idiom" : "ipad",
"scale":"2x", "scale" : "1x",
"filename":"Icon-App-40x40@2x.png" "size" : "76x76"
}, },
{ {
"idiom":"ipad", "filename" : "Icon-App-76x76@2x.png",
"size":"76x76", "idiom" : "ipad",
"scale":"1x", "scale" : "2x",
"filename":"Icon-App-76x76@1x.png" "size" : "76x76"
}, },
{ {
"idiom":"ipad", "filename" : "Icon-App-83.5x83.5@2x.png",
"size":"76x76", "idiom" : "ipad",
"scale":"2x", "scale" : "2x",
"filename":"Icon-App-76x76@2x.png" "size" : "83.5x83.5"
}, },
{ {
"idiom":"ipad", "filename" : "icon.jpg",
"size":"83.5x83.5", "idiom" : "ios-marketing",
"scale":"2x", "scale" : "1x",
"filename":"Icon-App-83.5x83.5@2x.png" "size" : "1024x1024"
}, },
{ {
"size" : "1024x1024", "filename" : "Icon-App-76x76@2x.png",
"idiom" : "ios-marketing", "idiom" : "iphone",
"scale" : "1x", "scale" : "2x",
"filename" : "ItunesArtwork@2x.png" "size" : "76x76"
}
],
"info":{
"version":1,
"author":"easyappicon"
} }
],
"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": "غرام في اليوم"}, "gramsPerDay": {"en": "Grams Per Day", "ar": "غرام في اليوم"},
"gr": {"en": "gr", "ar": "غرام"}, "gr": {"en": "gr", "ar": "غرام"},
"gramsPerMeal": {"en": "Grams Per Meal", "ar": "عدد الجرامات لكل وجبة"}, "gramsPerMeal": {"en": "Grams Per Meal", "ar": "عدد الجرامات لكل وجبة"},
"syncSuccess": {"en": "Data Synced Successfully", "ar": "تمت مزامنة البيانات بنجاح"},
}; };

@ -2,35 +2,35 @@ import 'PointsAmountPerYear.dart';
import 'PointsDetails.dart'; import 'PointsDetails.dart';
class LakumInquiryInformationObjVersion { class LakumInquiryInformationObjVersion {
int accountNumber; num accountNumber;
String accountStatus; String accountStatus;
String barCode; String barCode;
int consumedPoints; num consumedPoints;
String consumedPointsAmount; String consumedPointsAmount;
List<PointsAmountPerYear> consumedPointsAmountPerYear; List<PointsAmountPerYear> consumedPointsAmountPerYear;
List<PointsDetails> consumedPointsDetails; List<PointsDetails> consumedPointsDetails;
String createdDate; String createdDate;
int expiredPoints; num expiredPoints;
String expiryDate; String expiryDate;
int gainedPoints; num gainedPoints;
List<PointsAmountPerYear> gainedPointsAmountPerYear; List<PointsAmountPerYear> gainedPointsAmountPerYear;
List<PointsDetails> gainedPointsDetails; List<PointsDetails> gainedPointsDetails;
String lakumMessageStatus; String lakumMessageStatus;
String memberName; String memberName;
String memberUniversalId; String memberUniversalId;
String mobileNumber; String mobileNumber;
int pointsBalance; num pointsBalance;
int pointsBalanceAmount; num pointsBalanceAmount;
int pointsWillBeExpired; num pointsWillBeExpired;
String prefLang; String prefLang;
int statusCode; num statusCode;
int transferPoints; num transferPoints;
List<PointsAmountPerYear> transferPointsAmountPerYear; List<PointsAmountPerYear> transferPointsAmountPerYear;
List<PointsDetails> transferPointsDetails; List<PointsDetails> transferPointsDetails;
dynamic waitingPoints; dynamic waitingPoints;
dynamic loyalityAmount; dynamic loyalityAmount;
dynamic loyalityPoints; dynamic loyalityPoints;
int purchaseRate; num purchaseRate;
LakumInquiryInformationObjVersion( LakumInquiryInformationObjVersion(
{this.accountNumber, {this.accountNumber,

@ -1,10 +1,10 @@
import 'PointsAmountPerMonth.dart'; import 'PointsAmountPerMonth.dart';
class PointsAmountPerYear { class PointsAmountPerYear {
int amountPerYear; num amountPerYear;
List<PointsAmountPerMonth> pointsAmountPerMonth; List<PointsAmountPerMonth> pointsAmountPerMonth;
int pointsPerYear; num pointsPerYear;
int year; num year;
PointsAmountPerYear( PointsAmountPerYear(
{this.amountPerYear, {this.amountPerYear,

@ -11,7 +11,7 @@ class PaymentCheckoutData {
LacumAccountInformation lacumInformation; LacumAccountInformation lacumInformation;
bool cartDataVisible; bool cartDataVisible;
ShippingOption shippingOption; ShippingOption shippingOption;
int usedLakumPoints; num usedLakumPoints;
PaymentCheckoutData({this.address, this.paymentOption, this.lacumInformation, this.cartDataVisible = false, this.shippingOption, this.usedLakumPoints = 0}); PaymentCheckoutData({this.address, this.paymentOption, this.lacumInformation, this.cartDataVisible = false, this.shippingOption, this.usedLakumPoints = 0});

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

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

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

@ -271,7 +271,6 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
}); });
}); });
}); });
print("Has Reminder: " + hasReminder.toString());
} }
cancelReminders() async { cancelReminders() async {

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

@ -1,24 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -37,6 +20,7 @@ class _LakumWidgetState extends State<LakumWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
_pointsController.text = widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString();
return Container( return Container(
color: Colors.white, color: Colors.white,
@ -80,74 +64,39 @@ class _LakumWidgetState extends State<LakumWidget> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Container( Container(
margin: projectProvider.isArabic margin: projectProvider.isArabic ? EdgeInsets.only(right: 4) : EdgeInsets.only(left: 4),
? EdgeInsets.only(right: 4)
: EdgeInsets.only(left: 4),
width: 60, width: 60,
height: 50, height: 50,
child: TextField( child: TextField(
decoration: InputDecoration( decoration: InputDecoration(
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: borderSide: BorderSide(color: Colors.black, width: 0.2),
BorderSide(color: Colors.black, width: 0.2),
gapPadding: 0, gapPadding: 0,
borderRadius: projectProvider.isArabic borderRadius: projectProvider.isArabic
? BorderRadius.only( ? BorderRadius.only(topRight: Radius.circular(8), bottomRight: Radius.circular(8))
topRight: Radius.circular(8), : BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
bottomRight: Radius.circular(8))
: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8)),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: borderSide: BorderSide(color: Colors.black, width: 0.4),
BorderSide(color: Colors.black, width: 0.4),
gapPadding: 0, gapPadding: 0,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8)),
), ),
), ),
controller: _pointsController, controller: _pointsController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: widget color: widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount > 0 ? Colors.black : Colors.grey,
.model
.paymentCheckoutData
.lacumInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount >
0
? Colors.black
: Colors.grey,
), ),
enabled: widget enabled: widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount == 0 ? false : true,
.model
.paymentCheckoutData
.lacumInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount ==
0
? false
: true,
onChanged: (val) { onChanged: (val) {
var value = int.tryParse(val); var value = int.tryParse(val);
if (value != null && if (value != null && value <= widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount) {
value <= widget.model.paymentCheckoutData.usedLakumPoints = value;
widget
.model
.paymentCheckoutData
.lacumInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount) {
widget.model.paymentCheckoutData.usedLakumPoints =
value;
} else { } else {
widget.model.paymentCheckoutData.usedLakumPoints = 0; widget.model.paymentCheckoutData.usedLakumPoints = 0;
} }
_pointsController.text = _pointsController.text = "${widget.model.paymentCheckoutData.usedLakumPoints}";
"${widget.model.paymentCheckoutData.usedLakumPoints}";
}, },
), ),
), ),
@ -158,12 +107,8 @@ class _LakumWidgetState extends State<LakumWidget> {
color: Color(0xff3666E0), color: Color(0xff3666E0),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: projectProvider.isArabic borderRadius: projectProvider.isArabic
? BorderRadius.only( ? BorderRadius.only(topLeft: Radius.circular(6), bottomLeft: Radius.circular(6))
topLeft: Radius.circular(6), : BorderRadius.only(topRight: Radius.circular(6), bottomRight: Radius.circular(6)),
bottomLeft: Radius.circular(6))
: BorderRadius.only(
topRight: Radius.circular(6),
bottomRight: Radius.circular(6)),
border: Border.fromBorderSide(BorderSide( border: Border.fromBorderSide(BorderSide(
color: Color(0xff3666E0), color: Color(0xff3666E0),
width: 0.8, width: 0.8,

@ -370,8 +370,8 @@ class LacumPointsWidget extends StatelessWidget {
final MediaQueryData mediaQuery; final MediaQueryData mediaQuery;
final int pointType; // 1. balance, 2. gained, 3. consume, 4. transfer final int pointType; // 1. balance, 2. gained, 3. consume, 4. transfer
final String title; final String title;
final int riyal; final num riyal;
final int point; final num point;
Color titleColor; Color titleColor;
final List<PointsAmountPerYear> pointsAmountPerYear; final List<PointsAmountPerYear> pointsAmountPerYear;

@ -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/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.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/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/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/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:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../../locator.dart'; import '../../../../../locator.dart';
@ -35,6 +39,7 @@ class _FooterWidgetState extends State<FooterWidget> {
double quantityUI = 80; double quantityUI = 80;
bool showUI = false; bool showUI = false;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppSharedPreferences sharedPref = new AppSharedPreferences();
@override @override
Widget build(BuildContext context) { 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, disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx,
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed( login();
WELCOME_LOGIN,
);
} else } else
await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); 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, disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx,
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed( login();
WELCOME_LOGIN,
);
} else { } else {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
} }
}, },
fontWeight: FontWeight.w600, 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) { onChangeValue(int i) {
setState(() { setState(() {
widget.quantity = i; widget.quantity = i;

@ -126,11 +126,16 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.orderPreviewViewModel.getInformationsByAddress(widget.orderPreviewViewModel.user.patientIdentificationNo); await widget.orderPreviewViewModel.getInformationsByAddress(widget.orderPreviewViewModel.user.patientIdentificationNo);
await widget.orderPreviewViewModel.getShoppingCart(); if (widget.orderPreviewViewModel.error == "") {
// widget.changeMainState(); await widget.orderPreviewViewModel.getShoppingCart();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
model.saveSelectedAddressLocally(model.addresses[model.selectedAddressIndex]); model.saveSelectedAddressLocally(model.addresses[model.selectedAddressIndex]);
_navigateToPaymentOption(model); _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/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.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';
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/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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() { void initState() {
@ -101,511 +98,512 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
// var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); // var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
// var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID); // var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
// GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
// model.getOrder(customerId, customerGUID, page_id); // model.getOrder(customerId, customerGUID, page_id);
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
}, },
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount, appBarTitle: TranslationBase.of(context).myAccount,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: true, isShowDecPage: true,
isPharmacy: true, isPharmacy: true,
//isBottomBar: true, //isBottomBar: true,
isMainPharmacyPages: 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>[
Container(
child: Row(
children: <Widget>[ children: <Widget>[
Container( Container(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container( Container(
child: Row( padding: EdgeInsets.only(
children: <Widget>[ top: 20.0,
Container( left: 10.0,
padding: EdgeInsets.only( right: 10.0,
top: 20.0, bottom: 10.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),
),
]),
]),
],
), ),
) child: LargeAvatar(
], name: user.firstName.toString(),
), url: '',
),
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,
),
),
],
), ),
), ),
), Column(children: <Widget>[
Expanded( Row(children: <Widget>[
child: InkWell( Text(
onTap: () { TranslationBase.of(context).welcome,
if (customerId == null || customerId == '') style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, color: Colors.grey),
Navigator.push(context, FadePage(page: LakumActivationVidaPage())); ),
else ]),
Navigator.push(context, FadePage(page: LakumMainPage())); SizedBox(
}, height: 10,
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),
),
],
), ),
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,
), ),
), SizedBox(
Expanded( height: 5,
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,
),
),
],
),
), ),
), Text(
Expanded( TranslationBase.of(context).orders,
child: InkWell( style: TextStyle(
onTap: () { fontSize: 13.0,
Navigator.push(context, FadePage(page: MyReviewsPage())); fontWeight: FontWeight.bold,
},
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,
),
),
],
), ),
), ),
), ],
], ),
)),
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( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( SvgPicture.asset(
TranslationBase.of(context).myAccount, 'assets/images/pharmacy/lakum_icon.svg',
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold), width: 50,
height: 50,
), ),
SizedBox( SizedBox(
height: 10, height: 5,
), ),
Divider( Text(
color: Colors.grey, TranslationBase.of(context).lakum,
height: 20, style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold),
), ),
InkWell( ],
onTap: () { ),
Navigator.push(context, FadePage(page: HomePrescriptionsPage())); ),
}, ),
child: Row( Expanded(
children: <Widget>[ child: InkWell(
SvgPicture.asset( onTap: () {
'assets/images/pharmacy/my_prescription_icon.svg', Navigator.push(context, FadePage(page: WishlistPage()));
width: 28, },
height: 28, child: Column(
), children: <Widget>[
SizedBox( SvgPicture.asset(
width: 15, 'assets/images/pharmacy/wishlist_icon.svg',
), width: 50,
Text( height: 50,
TranslationBase.of(context).myPrescription,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Divider( Text(
color: Colors.grey, TranslationBase.of(context).wishlist,
height: 20, style: TextStyle(
), fontSize: 13.0,
InkWell( fontWeight: FontWeight.bold,
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,
),
),
],
), ),
), ),
],
),
),
),
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( SizedBox(
height: 5, height: 5,
), ),
Divider( Text(
color: Colors.grey, TranslationBase.of(context).reviews,
height: 20, style: TextStyle(
), fontSize: 13.0,
InkWell( fontWeight: FontWeight.bold,
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,
),
),
],
), ),
), ),
],
),
),
),
],
)),
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( SizedBox(
height: 5, width: 15,
), ),
Divider( Text(
color: Colors.grey, TranslationBase.of(context).myPrescription,
height: 20, style: TextStyle(
fontSize: 13.0,
),
), ),
InkWell( ],
onTap: () { ),
Navigator.push(context, FadePage(page: MyFamily())); ),
}, SizedBox(
child: Row( height: 5,
children: <Widget>[ ),
SvgPicture.asset( Divider(
'assets/images/pharmacy/my_family_icon.svg', color: Colors.grey,
width: 20, height: 20,
height: 20, ),
), InkWell(
SizedBox( onTap: () {
width: 20, Navigator.push(context, FadePage(page: ComparePage()));
), },
Text( child: Row(
TranslationBase.of(context).family, children: <Widget>[
style: TextStyle( Image.asset('assets/images/pharmacy/compare.png', width: 35, height: 35),
fontSize: 13.0, 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( 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, height: 20,
), ),
InkWell( SizedBox(
onTap: () { width: 20,
Navigator.push(context, FadePage(page: PharmacyAddressesPage())); ),
}, Text(
child: Row( TranslationBase.of(context).family,
children: <Widget>[ style: TextStyle(
SvgPicture.asset( fontSize: 13.0,
'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( ],
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( SizedBox(
color: Colors.grey, width: 20,
height: 20,
), ),
InkWell( Text(
onTap: () { TranslationBase.of(context).shippingAddresses,
Navigator.push(context, FadePage(page: PharmacyTermsConditions())); style: TextStyle(
}, fontSize: 13.0,
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,
),
),
],
), ),
), ),
],
),
),
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( SizedBox(
height: 5, width: 10,
), ),
Divider( Text(
color: Colors.grey, TranslationBase.of(context).conditionsHMG,
height: 20, 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, // IconButton(icon: Icon(Icons.error_outline), iconSize: 30,
// color: Colors.black,), // color: Colors.black,),
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Text( Text(
TranslationBase.of(context).conditions, TranslationBase.of(context).conditions,
style: TextStyle( style: TextStyle(
fontSize: 13.0, 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( SizedBox(
height: 10, height: 5,
), ),
Divider( Divider(
color: Colors.grey[350], color: Colors.grey,
height: 20, height: 20,
thickness: 5,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
), ),
Container( InkWell(
padding: EdgeInsets.only(left: 10.0), onTap: () {
child: Column( Navigator.push(context, FadePage(page: LiveChatPage()));
crossAxisAlignment: CrossAxisAlignment.start, },
child: Row(
children: <Widget>[ children: <Widget>[
Text( SvgPicture.asset(
TranslationBase.of(context).reachUs, 'assets/images/pharmacy/contact_us_icon.svg',
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold), width: 20,
height: 20,
), ),
SizedBox( SizedBox(
height: 5, width: 20,
), ),
Divider( Text(
color: Colors.grey, TranslationBase.of(context).contactUs,
height: 20, style: TextStyle(fontSize: 13.0),
), ),
InkWell( ],
onTap: () { ),
Navigator.push(context, FadePage(page: LiveChatPage())); ),
}, SizedBox(
child: Row( height: 5,
children: <Widget>[ ),
SvgPicture.asset( Divider(
'assets/images/pharmacy/contact_us_icon.svg', color: Colors.grey,
width: 20, height: 20,
height: 20, ),
), InkWell(
SizedBox( onTap: () {
width: 20, Navigator.push(context, FadePage(page: FindUsPage()));
), },
Text( child: Row(
TranslationBase.of(context).contactUs, children: <Widget>[
style: TextStyle(fontSize: 13.0), SvgPicture.asset(
), 'assets/images/pharmacy/our_locations_icon.svg',
], width: 30,
), height: 30,
), ),
SizedBox( SizedBox(
height: 5, width: 20,
), ),
Divider( Text(
color: Colors.grey, TranslationBase.of(context).ourLocations,
height: 20, 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 cancelReminder => localizedValues["CancelReminder"][locale.languageCode];
String get reminderCancelSuccess => localizedValues["reminderCancelSuccess"][locale.languageCode]; String get reminderCancelSuccess => localizedValues["reminderCancelSuccess"][locale.languageCode];
String get syncSuccess => localizedValues["syncSuccess"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { 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_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess';
static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed'; 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 onExitCallback;
final Function onLoadStartCallback; final Function onLoadStartCallback;

@ -1,16 +1,16 @@
import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.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/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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../locator.dart';
class BottomNavPharmacyItem extends StatelessWidget { class BottomNavPharmacyItem extends StatelessWidget {
final String title; final String title;
final IconData icon; final IconData icon;
@ -22,15 +22,10 @@ class BottomNavPharmacyItem extends StatelessWidget {
final bool isHome; final bool isHome;
final IconData activeIcon; final IconData activeIcon;
BottomNavPharmacyItem(
{this.icon, BottomNavPharmacyItem({this.icon, this.changeIndex, this.index, this.currentIndex, this.activeIcon, this.title, this.onTap, this.isHome = false});
this.changeIndex,
this.index, AppSharedPreferences sharedPref = AppSharedPreferences();
this.currentIndex,
this.activeIcon,
this.title,
this.onTap,
this.isHome = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -39,7 +34,7 @@ class BottomNavPharmacyItem extends StatelessWidget {
return Expanded( return Expanded(
child: SizedBox( child: SizedBox(
height: 66.0, height: 66.0,
child: Stack( child: Stack(
clipBehavior: Clip.none, clipBehavior: Clip.none,
children: [ children: [
@ -49,13 +44,8 @@ class BottomNavPharmacyItem extends StatelessWidget {
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
splashColor: Colors.transparent, splashColor: Colors.transparent,
onTap: () { onTap: () {
if (!Provider.of<ProjectViewModel>(context, listen: false) if (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && (currentIndex == 2 || currentIndex == 3))
.isLogin && login(context);
(currentIndex == 2 || currentIndex == 3))
Navigator.push(
context,
FadePage(page: WelcomeLogin()),
);
else else
changeIndex(currentIndex); changeIndex(currentIndex);
}, },
@ -63,9 +53,6 @@ class BottomNavPharmacyItem extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
// SizedBox(
// height: 15,
// ),
currentIndex == index currentIndex == index
? Divider( ? Divider(
color: Color(0xff5AB133), color: Color(0xff5AB133),
@ -93,20 +80,14 @@ class BottomNavPharmacyItem extends StatelessWidget {
title, title,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: currentIndex == index ? Colors.grey : Colors.grey, color: currentIndex == index ? Colors.grey : Colors.grey,
fontWeight: currentIndex == index fontWeight: currentIndex == index ? FontWeight.normal : FontWeight.w400,
? FontWeight.normal
: FontWeight.w400,
fontSize: currentIndex == index ? 11 : 9, fontSize: currentIndex == index ? 11 : 9,
), ),
], ],
), ),
), ),
), ),
if (currentIndex == 3 && if (currentIndex == 3 && Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount != 0)
Provider.of<OrderPreviewViewModel>(context, listen: false)
.cartResponse
.quantityCount !=
0)
Positioned( Positioned(
top: 11.5, top: 11.5,
right: -3.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