Merge branch 'development_new_design_2.0' into new_design_sikander

merge-requests/536/head
Sikander Saleem 4 years ago
commit 407fb81038

@ -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

@ -171,6 +171,7 @@ const Map localizedValues = {
"minute": {"en": "Minutes", "ar": "دقيقة"},
"hour": {"en": "Hour", "ar": "ساعة"},
"reminderSuccess": {"en": "The reminder has been added successfully", "ar": "تمت إضافة التذكير بنجاح"},
"reminderCancelSuccess": {"en": "The reminder has been cancelled successfully", "ar": "تم إلغاء التذكير بنجاح"},
"patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"},
"patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"},
"patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"},
@ -449,6 +450,7 @@ const Map localizedValues = {
"Frequency": {"en": "Frequency", "ar": "المعدل"},
"DailyQuantity": {"en": "Daily Quantity :", "ar": "جرعات يومية"},
"AddReminder": {"en": "Add Reminder", "ar": "إضافة تذكير"},
"CancelReminder": {"en": "Cancel Reminder", "ar": "إلغاء تذكير"},
"reminderDes": {
"en": "Please select treatment start day and time to be notified when it\'s time to take the medicine",
"ar": "يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء"
@ -1726,4 +1728,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": "تمت مزامنة البيانات بنجاح"},
};

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

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

@ -11,7 +11,7 @@ class PaymentCheckoutData {
LacumAccountInformation lacumInformation;
bool cartDataVisible;
ShippingOption shippingOption;
int usedLakumPoints;
num usedLakumPoints;
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);
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 {

@ -1,5 +1,5 @@
import 'dart:async';
import 'dart:convert' as convert;
import 'dart:convert';
import 'dart:typed_data';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
@ -92,8 +92,8 @@ class LacumViewModel extends BaseViewModel {
Uint8List convertBase64ToBarCodeImage() {
try {
final _byteImage = convert.base64Decode(
lacumGroupInformation.lakumInquiryInformationObjVersion.barCode);
final _byteImage = base64Decode(
lacumGroupInformation.lakumInquiryInformationObjVersion.barCode.split(',').last);
return _byteImage;
} catch (e) {
print(e);

@ -57,10 +57,10 @@ class ProductDetailViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future notifyMe(customerId, itemID, context) async {
Future notifyMe(customerId, itemID, ) async {
hasError = false;
setState(ViewState.BusyLocal);
await _productDetailService.notifyMe(customerId, itemID, context);
await _productDetailService.notifyMe(customerId, itemID, );
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);

@ -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;
}
}

@ -78,7 +78,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
WidgetsBinding.instance.addPostFrameCallback((_) async {
getCurrentLanguage();
if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT))
if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT))
getDoctorScheduledFreeSlots(context, widget.doctor);
else {
getDoctorFreeSlots(context, widget.doctor);

@ -1,12 +1,18 @@
import 'dart:collection';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/laser_body_parts_data.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -129,11 +135,13 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
labelStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).male), Text(TranslationBase.of(context).female)],
@ -176,8 +184,11 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
Expanded(
child: DefaultButton(
TranslationBase.of(context).continues,
() {},
color: Color(0xff359846),
getDuration() != 0 ? () {
callDoctorsSearchAPI();
} : null,
color: CustomColors.green,
disabledColor: CustomColors.grey2,
),
),
],
@ -187,6 +198,65 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
);
}
callDoctorsSearchAPI() {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
List<String> result;
int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(253, 0, false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {}
});
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
}
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))
.then((value) {
setState(() {
// dropdownValue = null;
});
// getProjectsList();
});
}
int getDuration() {
int duration = 0;
if (_isFullBody) {
@ -255,7 +325,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
color: _selectedCategoryIndex == index ? Colors.transparent : Color(0xffEAEAEA),
),
),
padding: EdgeInsets.symmetric(vertical: 11, horizontal: 26),
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 26),
child: Text(
list[index].title,
style: TextStyle(
@ -404,6 +474,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
color: Color(0xff2B353E),
letterSpacing: -0.48,
),
maxLines: 1,
),
),
],

@ -14,13 +14,15 @@ Future<Map<Permission, PermissionStatus>> requestPermissions() async {
}
showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted,
{Function onSuccess, String title, String description}) async {
{Function onSuccess, String title, String description, Function(int) onMultiDateSuccess}) async {
if (await Permission.calendar.request().isGranted) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, onSuccess: onSuccess, title: title, description: description);
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess);
} else {
requestPermissions().then((results) {
if (results[Permission.calendar].isGranted) {
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, onSuccess: onSuccess, title: title, description: description);
_showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted,
onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess);
}
});
}
@ -29,7 +31,7 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S
final CalendarPlugin _myPlugin = CalendarPlugin();
Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted,
{Function onSuccess, String title, String description}) async {
{Function onSuccess, String title, String description, Function(int) onMultiDateSuccess}) async {
return showDialog<void>(
context: context,
barrierDismissible: true, // user must tap button!
@ -56,16 +58,20 @@ Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String
// dateTime.add(new Duration(minutes: -120));
dateTime = Jiffy(dateTime).subtract(hours: 2);
}
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils
.createOrUpdateEvent(
title: title ?? TranslationBase.of(context).reminderTitle + " " + doctorName,
description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted,
scheduleDateTime: dateTime,
eventId: eventId)
.then((value) {});
if (onMultiDateSuccess == null) {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils
.createOrUpdateEvent(
title: title ?? TranslationBase.of(context).reminderTitle + " " + doctorName,
description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted,
scheduleDateTime: dateTime,
eventId: eventId)
.then((value) {});
onSuccess();
onSuccess();
} else {
onMultiDateSuccess(i);
}
},
),
);
@ -144,12 +150,14 @@ class _ReminderDialogState extends State<ReminderDialog> {
});
},
),
Text(TranslationBase.of(context).appoReminder30,
Text(
TranslationBase.of(context).appoReminder30,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),),
),
),
],
),
Row(
@ -163,12 +171,14 @@ class _ReminderDialogState extends State<ReminderDialog> {
});
},
),
Text(TranslationBase.of(context).appoReminder60,
Text(
TranslationBase.of(context).appoReminder60,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),),
),
),
],
),
Row(
@ -182,12 +192,14 @@ class _ReminderDialogState extends State<ReminderDialog> {
});
},
),
Text(TranslationBase.of(context).appoReminder90,
Text(
TranslationBase.of(context).appoReminder90,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),),
),
),
],
),
Row(

@ -76,7 +76,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
children: [
PharmacyPage(),
PharmacyCategorisePage(),
PharmacyProfilePage(),
PharmacyProfilePage(moveToOrder: false),
CartOrderPage(changeTab: changeCurrentTab),
],
),

@ -1,13 +1,17 @@
import 'dart:collection';
import 'package:device_calendar/device_calendar.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog_prescription.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.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';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
@ -18,21 +22,34 @@ import 'package:diplomaticquarterapp/widgets/show_zoom_image_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:jiffy/jiffy.dart';
import 'package:provider/provider.dart';
class PrescriptionDetailsPage extends StatelessWidget {
class PrescriptionDetailsPage extends StatefulWidget {
final PrescriptionReport prescriptionReport;
final Prescriptions prescriptions;
PrescriptionDetailsPage({Key key, this.prescriptionReport, this.prescriptions});
@override
_PrescriptionDetailsPageState createState() => _PrescriptionDetailsPageState();
}
class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
bool hasReminder = false;
@override
void initState() {
checkIfHasReminder();
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).prescriptions,
body: Column(
@ -40,18 +57,18 @@ class PrescriptionDetailsPage extends StatelessWidget {
children: <Widget>[
DoctorHeader(
headerModel: HeaderModel(
prescriptions.doctorName,
prescriptions.doctorID,
prescriptions.doctorImageURL,
prescriptions.speciality,
widget.prescriptions.doctorName,
widget.prescriptions.doctorID,
widget.prescriptions.doctorImageURL,
widget.prescriptions.speciality,
"",
prescriptions.name,
DateUtil.convertStringToDate(prescriptions.appointmentDate),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
prescriptions.nationalityFlagURL,
prescriptions.doctorRate,
prescriptions.actualDoctorRate,
prescriptions.noOfPatientsRate,
widget.prescriptions.name,
DateUtil.convertStringToDate(widget.prescriptions.appointmentDate),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.prescriptions.appointmentDate)),
widget.prescriptions.nationalityFlagURL,
widget.prescriptions.doctorRate,
widget.prescriptions.actualDoctorRate,
widget.prescriptions.noOfPatientsRate,
"",
),
isNeedToShowButton: false,
@ -102,7 +119,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
children: [
Container(
child: Image.network(
prescriptionReport.imageSRCUrl,
widget.prescriptionReport.imageSRCUrl,
fit: BoxFit.cover,
width: 48,
height: 49,
@ -123,13 +140,15 @@ class PrescriptionDetailsPage extends StatelessWidget {
],
),
onTap: () {
showZoomImageDialog(context, prescriptionReport.imageSRCUrl);
showZoomImageDialog(context, widget.prescriptionReport.imageSRCUrl);
},
),
SizedBox(width: 12),
Expanded(
child: Text(
(prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? '').toLowerCase().capitalizeFirstofEach,
(widget.prescriptionReport.itemDescription.isNotEmpty ? widget.prescriptionReport.itemDescription : widget.prescriptionReport.itemDescriptionN ?? '')
.toLowerCase()
.capitalizeFirstofEach,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
),
)
@ -147,10 +166,10 @@ class PrescriptionDetailsPage extends StatelessWidget {
),
TableRow(
children: [
Utils.tableColumnValue(prescriptionReport?.routeN ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(prescriptionReport?.frequencyN ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(prescriptionReport?.doseDailyQuantity.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(prescriptionReport?.days.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(widget.prescriptionReport?.routeN ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(widget.prescriptionReport?.frequencyN ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(widget.prescriptionReport?.doseDailyQuantity.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(widget.prescriptionReport?.days.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel),
],
),
]),
@ -159,7 +178,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48),
),
Text(
prescriptionReport.remarks,
widget.prescriptionReport.remarks,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
],
@ -182,8 +201,8 @@ class PrescriptionDetailsPage extends StatelessWidget {
context,
FadePage(
page: PharmacyForPrescriptionsPage(
itemID: prescriptionReport.itemID,
prescriptionReport: prescriptionReport,
itemID: widget.prescriptionReport.itemID,
prescriptionReport: widget.prescriptionReport,
),
),
);
@ -195,54 +214,35 @@ class PrescriptionDetailsPage extends StatelessWidget {
SizedBox(width: 10),
Expanded(
child: DefaultButton(
TranslationBase.of(context).addReminder,
hasReminder ? TranslationBase.of(context).cancelReminder : TranslationBase.of(context).addReminder,
() {
DateTime startDate = DateTime.now();
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionReport.days);
showReminderDialog(
context,
endDate,
"",
prescriptionReport.itemID.toString(),
"",
"",
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
},
);
return;
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: PrescriptionReminderDialog(
eventId: prescriptionReport.itemID.toString(),
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate: startDate,
endDate: endDate,
location: prescriptionReport.remarks,
days: 1,
),
),
);
if (hasReminder) {
cancelReminders();
} else {
DateTime startDate = DateTime.now();
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + widget.prescriptionReport.days);
showReminderDialog(
context,
endDate,
"",
widget.prescriptionReport.itemID.toString(),
"",
"",
title: "${widget.prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${widget.prescriptionReport.itemDescriptionN} ${widget.prescriptionReport.frequencyN} ${widget.prescriptionReport.routeN} ",
onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
},
onMultiDateSuccess: (int selectedIndex) {
setCalender(context, widget.prescriptionReport.itemID.toString(), selectedIndex);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
);
return;
}
},
iconData: Icons.notifications_active,
color: Color(0xffD02127),
fontSize: 13.0,
//textColor: Color(0xff2B353E),
),
),
@ -253,4 +253,99 @@ class PrescriptionDetailsPage extends StatelessWidget {
),
);
}
checkIfHasReminder() async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30);
DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120);
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate);
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) {
Result<UnmodifiableListView<Event>> events = value;
events.data.forEach((element) {
if (element.title.contains(widget.prescriptionReport.itemDescriptionN))
setState(() {
hasReminder = true;
});
});
});
}
cancelReminders() async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30);
DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120);
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate);
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) {
Result<UnmodifiableListView<Event>> events = value;
events.data.forEach((element) {
if (element.title.contains(widget.prescriptionReport.itemDescriptionN)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element);
});
});
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderCancelSuccess);
setState(() {
hasReminder = false;
});
}
setCalender(BuildContext context, String eventId, int reminderIndex) async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
DateTime startDate = DateUtil.convertStringToDate(widget.prescriptionReport.startDate);
DateTime actualDate = DateTime(startDate.year, startDate.month, startDate.day, 8, 0); //Time will start at 8:00 AM from starting date
if (widget.prescriptionReport?.frequencyNumber == null) widget.prescriptionReport.frequencyNumber = 1; //Some time frequency number is null so by default will be 2
GifLoaderDialogUtils.showMyDialog(context);
for (int i = 0; i < widget.prescriptionReport.days; i++) {
//event for number of days.
for (int j = 0; j < widget.prescriptionReport.frequencyNumber ?? 1; j++) {
// event for number of times per day.
if (j != 0) {
actualDate.add(new Duration(hours: 8)); // 8 hours addition for daily dose.
}
//Time subtraction from actual reminder time. like before 30, or 1 hour.
if (reminderIndex == 0) {
// Before 30 mints
actualDate = Jiffy(actualDate).subtract(minutes: 30);
// dateTime.add(new Duration(minutes: -30));
} else if (reminderIndex == 1) {
// Before 1 hour
// dateTime.add(new Duration(minutes: -60));
actualDate = Jiffy(actualDate).subtract(hours: 1);
} else if (reminderIndex == 2) {
// Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90));
actualDate = Jiffy(actualDate).subtract(hours: 1, minutes: 30);
} else if (reminderIndex == 3) {
// Before 2 hours
// dateTime.add(new Duration(minutes: -120));
actualDate = Jiffy(actualDate).subtract(hours: 2);
}
calendarUtils
.createOrUpdateEvent(
title: "${widget.prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${widget.prescriptionReport.itemDescriptionN} ${widget.prescriptionReport.frequencyN} ${widget.prescriptionReport.routeN} ",
scheduleDateTime: actualDate,
eventId: eventId + (i.toString() + j.toString()), //event id with varitions
)
.then((value) {});
actualDate = DateTime(actualDate.year, actualDate.month, actualDate.day, 8, 0);
}
actualDate = Jiffy(actualDate).add(days: 1);
print(actualDate);
}
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
GifLoaderDialogUtils.hideDialog(context);
setState(() {
hasReminder = true;
});
}
}

@ -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);

@ -31,7 +31,8 @@ class _ProductCheckTypeWidgetState extends State<ProductCheckTypeWidget> {
? widget.model.wishListList[index].product.namen
: widget.model.wishListList[index].product.name,
productPrice: widget.model.wishListList[index].subtotal,
productRate: double.parse(widget.model.wishListList[index].subtotalVatRate),
// productRate: double.parse(widget.model.wishListList[index].subtotalVatRate),
productRate: widget.model.wishListList[index].product.approvedRatingSum.toDouble(),
approvedTotalReviews:widget.model.wishListList[index].product.approvedTotalReviews,
productImage: widget.model.wishListList[index].product.images[0].src,
productID: widget.model.wishListList[index].product.id,

@ -1,15 +1,12 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
@ -18,12 +15,8 @@ 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:http/http.dart';
import 'package:provider/provider.dart';
import '../../../../locator.dart';
import 'cart-order-preview.dart';
class CartOrderPage extends StatefulWidget {
final Function(int) changeTab;
@ -64,8 +57,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
body: NetworkBaseView(
isLoading: isLoading,
isLocalLoader: true,
child: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0)
child: !(model.cartResponse.shoppingCarts == null || model.cartResponse.shoppingCarts.length == 0)
? Container(
height: height * 0.85,
width: double.infinity,
@ -92,18 +84,17 @@ class _CartOrderPageState extends State<CartOrderPage> {
),
Container(
child: ListView.builder(
itemCount:
model.cartResponse.shoppingCarts.length,
itemCount: model.cartResponse.shoppingCarts.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: const AlwaysScrollableScrollPhysics(),
physics: ScrollPhysics(),
// physics: const AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return ProductOrderItem(
item: model.cartResponse.shoppingCarts[index],
changeCartItems: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.changeProductQuantity(model
.cartResponse.shoppingCarts[index]);
await model.changeProductQuantity(model.cartResponse.shoppingCarts[index]);
if (model.state != ViewState.Error) {}
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
@ -112,10 +103,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
},
deleteCartItems: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model
.deleteProduct(model
.cartResponse.shoppingCarts[index])
.then((value) {
await model.deleteProduct(model.cartResponse.shoppingCarts[index]).then((value) {
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
}
@ -245,10 +233,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
),
),
bottomSheet: Container(
height: !(model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0)
? height * 0.15
: 0,
height: !(model.cartResponse.shoppingCarts == null || model.cartResponse.shoppingCarts.length == 0) ? height * 0.15 : 0,
color: Colors.white,
child: OrderBottomWidget(model.addresses, height, model, isLoading),
),
@ -256,8 +241,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
}
void getData() async {
await Provider.of<OrderPreviewViewModel>(context, listen: false)
.getShoppingCart();
await Provider.of<OrderPreviewViewModel>(context, listen: false).getShoppingCart();
setState(() {
isLoading = false;
});
@ -283,9 +267,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return !widget.isLoading &&
!(widget.model.cartResponse.shoppingCarts == null ||
widget.model.cartResponse.shoppingCarts.length == 0)
return !widget.isLoading && !(widget.model.cartResponse.shoppingCarts == null || widget.model.cartResponse.shoppingCarts.length == 0)
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -332,8 +314,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
padding: EdgeInsets.symmetric(horizontal: 4),
margin: const EdgeInsets.symmetric(vertical: 4),
child: Texts(
TranslationBase.of(context)
.pharmacyServiceTermsCondition,
TranslationBase.of(context).pharmacyServiceTermsCondition,
fontSize: 13,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
@ -341,10 +322,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
),
),
InkWell(
onTap: () => {
Navigator.push(
context, FadePage(page: PharmacyTermsConditions()))
},
onTap: () => {Navigator.push(context, FadePage(page: PharmacyTermsConditions()))},
child: Container(
child: Icon(
Icons.info,
@ -370,8 +348,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: 0, vertical: 0),
margin: EdgeInsets.symmetric(horizontal: 0, vertical: 0),
child: Row(
children: [
Texts(
@ -380,8 +357,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
fontWeight: FontWeight.bold,
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 4),
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Texts(
"${TranslationBase.of(context).inclusiveVat}",
fontSize: 8,
@ -403,33 +379,16 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
),
RaisedButton(
onPressed: isAgree
// && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0
? () => {
if (widget.model.isCartItemsOutOfStock())
{
// Toast msg
AppToast.showErrorToast(
message: TranslationBase.of(context)
.outOfStockMsg)
}
{AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)}
else
{
_navigateToAddressPage(widget
.model.user.patientIdentificationNo)
// Navigator.push(
// context,
// FadePage(
// page:
// OrderPreviewPage(widget.addresses)))
}
{_navigateToAddressPage(widget.model.user.patientIdentificationNo)}
}
: null,
child: new Text(
"${TranslationBase.of(context).checkOut}",
style: new TextStyle(
color:
isAgree ? Colors.white : Colors.grey.shade300,
fontSize: 14),
style: new TextStyle(color: isAgree ? Colors.white : Colors.grey.shade300, fontSize: 14),
),
color: Color(0xFF4CAF50),
disabledColor: Color(0xFF848484),
@ -453,8 +412,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
if (result != null) {
GifLoaderDialogUtils.showMyDialog(context);
var address = result;
widget.model.paymentCheckoutData.address =
Addresses.fromJson(address.toJson());
widget.model.paymentCheckoutData.address = Addresses.fromJson(address.toJson());
await widget.model.getInformationsByAddress(identificationNo);
await widget.model.getShoppingCart();
// widget.changeMainState();

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

@ -69,16 +69,15 @@ class LakumMainPage extends StatelessWidget {
],
),
SizedBox(
width: 8,
height: 12,
),
LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear),
LakumHomeButtons(mediaQuery, model),
SizedBox(
height: 20,
height: 12,
),
Container(
height: 125,
margin: EdgeInsets.symmetric(horizontal: 16),
height: 100,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 12.0),
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
@ -109,15 +108,15 @@ class LakumMainPage extends StatelessWidget {
],
),
),
LacumPointsWidget(
mediaQuery,
3,
TranslationBase.of(context).consumed,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null
? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount)
: 0,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear),
// LacumPointsWidget(
// mediaQuery,
// 3,
// TranslationBase.of(context).consumed,
// model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null
// ? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount)
// : 0,
// model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints,
// model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear),
SizedBox(
width: 8,
),
@ -371,8 +370,8 @@ class LacumPointsWidget extends StatelessWidget {
final MediaQueryData mediaQuery;
final int pointType; // 1. balance, 2. gained, 3. consume, 4. transfer
final String title;
final int riyal;
final int point;
final num riyal;
final num point;
Color titleColor;
final List<PointsAmountPerYear> pointsAmountPerYear;

@ -16,13 +16,10 @@ class PaymentMethodSelectPage extends StatefulWidget {
final bool isUpdating;
final Function changeMainState;
const PaymentMethodSelectPage(
{Key key, this.model, this.isUpdating = false, this.changeMainState})
: super(key: key);
const PaymentMethodSelectPage({Key key, this.model, this.isUpdating = false, this.changeMainState}) : super(key: key);
@override
_PaymentMethodSelectPageState createState() =>
_PaymentMethodSelectPageState();
_PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState();
}
class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
@ -85,16 +82,17 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
selectedPaymentOption = PaymentOption.mastercard;
})
}),
PaymentMethodCard(
cardWidth,
selectedPaymentOption,
PaymentOption.installments,
() => {
setState(() {
selectedPaymentOption =
PaymentOption.installments;
})
}),
widget.model.cartResponse.totalAmount > 1000
? PaymentMethodCard(
cardWidth,
selectedPaymentOption,
PaymentOption.installments,
() => {
setState(() {
selectedPaymentOption = PaymentOption.installments;
})
})
: Container(),
if (Platform.isIOS)
PaymentMethodCard(
cardWidth,
@ -118,8 +116,7 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
TranslationBase.of(context).next,
selectedPaymentOption != null
? () {
widget.model.paymentCheckoutData.paymentOption =
selectedPaymentOption;
widget.model.paymentCheckoutData.paymentOption = selectedPaymentOption;
if (widget.isUpdating) {
widget.changeMainState();
Navigator.pop(context);
@ -150,14 +147,12 @@ class PaymentMethodCard extends StatelessWidget {
final PaymentOption paymentOption;
final Function selectMethod;
PaymentMethodCard(this.cardWidth, this.selectedPaymentOption,
this.paymentOption, this.selectMethod);
PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, this.paymentOption, this.selectMethod);
@override
Widget build(BuildContext context) {
bool isSelected = false;
if (selectedPaymentOption != null &&
selectedPaymentOption == paymentOption) {
if (selectedPaymentOption != null && selectedPaymentOption == paymentOption) {
isSelected = true;
}
@ -171,9 +166,7 @@ class PaymentMethodCard extends StatelessWidget {
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: isSelected
? BorderSide(color: Colors.green, width: 2.0)
: BorderSide(color: Colors.transparent, width: 0.0),
side: isSelected ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
@ -182,13 +175,7 @@ class PaymentMethodCard extends StatelessWidget {
Container(
width: 24,
height: 24,
decoration: containerColorRadiusBorderWidth(
isSelected
? CustomColors.accentColor
: Colors.transparent,
100,
Colors.grey,
0.5),
decoration: containerColorRadiusBorderWidth(isSelected ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
),
mWidth(12),
Container(
@ -200,8 +187,7 @@ class PaymentMethodCard extends StatelessWidget {
if (isSelected)
Container(
decoration: containerRadius(CustomColors.green, 200),
padding:
EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
child: Text(
TranslationBase.of(context).paymentSelected,
style: TextStyle(

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:url_launcher/url_launcher.dart';
class AvailabilityInfo extends StatelessWidget {
final ProductDetailViewModel previousModel;
@ -49,7 +51,9 @@ class AvailabilityInfo extends StatelessWidget {
child: IconButton(
icon: Icon(Icons.location_on),
color: Colors.red,
onPressed: () {},
onPressed: () {
MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].latitude), previousModel.productLocationService[index].locationDescription);
},
),
),
Expanded(
@ -57,7 +61,9 @@ class AvailabilityInfo extends StatelessWidget {
child: IconButton(
icon: Icon(Icons.phone),
color: Colors.red,
onPressed: () {},
onPressed: () {
launch("tel://" + previousModel.productLocationService[index].phoneNumber);
},
),
),
],

@ -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;

@ -185,7 +185,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
),
Container(
// width: 500,
margin: EdgeInsets.only(bottom: 6),
margin: EdgeInsets.only(bottom: 10),
padding: EdgeInsets.only(bottom: 10),
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -255,7 +256,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
GifLoaderDialogUtils.showMyDialog(context);
await model.getProductLocationData(widget.product.sku);
GifLoaderDialogUtils.hideDialog(context);
//
setState(() {
isDetails = false;
isReviews = false;
@ -287,10 +288,20 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
product: widget.product,
previousModel: model,
)
: isAvailability
: isAvailability && widget.product.stockAvailability != "Out of stock"
? AvailabilityInfo(
previousModel: model,
previousModel: model
)
: isAvailability && widget.product.stockAvailability == "Out of stock"
? Container(
// padding: EdgeInsets.all(15),
padding: EdgeInsets.fromLTRB(15,15,15,20),
margin: EdgeInsets.only(bottom: 20),
alignment: Alignment.center,
child: Text(
TranslationBase.of(context).noLocationAvailable,
),
)
: Container(),
],
),
@ -298,17 +309,17 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
SizedBox(
height: 10,
),
if (projectViewModel.isLogin)
RecommendedProducts(
product: widget.product,
productDetailViewModel: model,
addToWishlistFunction: (itemID) async {
await addToWishlistFunction(itemID: itemID, model: model);
},
deleteFromWishlistFunction: (itemID) async {
await deleteFromWishlistFunction(itemID: itemID, model: model);
},
)
// if (projectViewModel.isLogin)
// RecommendedProducts(
// product: widget.product,
// productDetailViewModel: model,
// addToWishlistFunction: (itemID) async {
// await addToWishlistFunction(itemID: itemID, model: model);
// },
// deleteFromWishlistFunction: (itemID) async {
// await deleteFromWishlistFunction(itemID: itemID, model: model);
// },
// )
],
),
),
@ -360,6 +371,6 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}
}
notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model, context}) async {
await model.notifyMe(customerId, itemId, context);
notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model, }) async {
await model.notifyMe(customerId, itemId, );
}

@ -30,15 +30,21 @@ class ReviewsInfo extends StatelessWidget {
Container(
child: Row(
children: [
Container(
child: Text(
previousModel.productDetailService[0]
.reviews[index].customerId
.toString(),
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
Expanded(
child: Container(
child: Text(previousModel.productDetailService[0].reviews[index].customer.firstName != null
&& previousModel.productDetailService[0].reviews[index].customer.firstName != null
? previousModel.productDetailService[0].reviews[index].customer.firstName.toString() + " "
+ previousModel.productDetailService[0].reviews[index].customer.lastName.toString()
:"",
// previousModel.productDetailService[0]
// .reviews[index].customerId
// .toString(),
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
),
),
),
Container(
@ -79,7 +85,8 @@ class ReviewsInfo extends StatelessWidget {
},
)
: Container(
padding: EdgeInsets.all(15),
padding: EdgeInsets.fromLTRB(15,15,15,20),
margin: EdgeInsets.only(bottom: 20),
alignment: Alignment.center,
child: Text(
TranslationBase.of(context).noReviewsAvailable,

@ -229,13 +229,15 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
width: widget.mediaQuery.size.width * 1.0,
height: widget.mediaQuery.size.width * 1.0,
),
Container(
margin: EdgeInsets.fromLTRB(12, 70, 12, 4),
child: widget.model.convertBase64ToBarCodeImage() !=
null
? Image.memory(
widget.model.convertBase64ToBarCodeImage())
: Container(),
Center(
child: Container(
margin: EdgeInsets.fromLTRB(12, 70, 12, 4),
child: widget.model.convertBase64ToBarCodeImage() !=
null
? Image.memory(
widget.model.convertBase64ToBarCodeImage())
: Container(),
),
),
],
),

@ -25,8 +25,7 @@ class OrderPage extends StatefulWidget {
_OrderPageState createState() => _OrderPageState();
}
class _OrderPageState extends State<OrderPage>
with SingleTickerProviderStateMixin {
class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMixin {
String pageID = "1";
String customerId = "";
String order = "";
@ -54,8 +53,6 @@ class _OrderPageState extends State<OrderPage>
_tabController = new TabController(
length: 4,
vsync: this,
// initialIndex: 1
);
}
@ -220,12 +217,10 @@ class _OrderPageState extends State<OrderPage>
),
Container(
margin: EdgeInsets.all(8.0),
child: SvgPicture.asset(
projectViewModel.isArabic
? 'assets/images/pharmacy/arrow_left.svg'
: 'assets/images/pharmacy/arrow_right.svg',
height: 20,
width: 20,
child: Icon(
Icons.arrow_forward,
size: 18,
color: Colors.grey[500],
),
),
],
@ -249,11 +244,11 @@ class _OrderPageState extends State<OrderPage>
left: 13.0, right: 13.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.blue[700],
color: Color(0xFF4CAF50),
style: BorderStyle.solid,
width: 5.0,
),
color: Colors.blue[700],
color: Color(0xFF4CAF50),
borderRadius: BorderRadius.circular(
30.0)),
child: deliveredOrderList[
@ -506,12 +501,10 @@ class _OrderPageState extends State<OrderPage>
),
Container(
margin: EdgeInsets.all(8.0),
child: SvgPicture.asset(
projectViewModel.isArabic
? 'assets/images/pharmacy/arrow_left.svg'
: 'assets/images/pharmacy/arrow_right.svg',
height: 20,
width: 20,
child: Icon(
Icons.arrow_forward,
size: 18,
color: Colors.grey[500],
),
),
],
@ -535,11 +528,11 @@ class _OrderPageState extends State<OrderPage>
left: 13.0, right: 13.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
color: Colors.grey[500],
style: BorderStyle.solid,
width: 5.0,
),
color: Colors.green,
color: Colors.grey[500],
borderRadius: BorderRadius.circular(
30.0)),
child: processingOrderList[
@ -972,12 +965,10 @@ class _OrderPageState extends State<OrderPage>
),
Container(
margin: EdgeInsets.all(8.0),
child: SvgPicture.asset(
projectViewModel.isArabic
? 'assets/images/pharmacy/arrow_left.svg'
: 'assets/images/pharmacy/arrow_right.svg',
height: 20,
width: 20,
child: Icon(
Icons.arrow_forward,
size: 18,
color: Colors.grey[500],
),
),
],
@ -1142,7 +1133,7 @@ class _OrderPageState extends State<OrderPage>
cancelledOrderList.clear();
for (int i = 0; i < model.orders.length; i++) {
if (model.orders[i].orderStatusId == 40 ||
model.orders[i].orderStatus == 996 ||
model.orders[i].orderStatusId == 996 ||
model.orders[i].orderStatusId == 200) {
cancelledOrderList.add(model.orders[i]);
}
@ -1171,14 +1162,7 @@ class _OrderPageState extends State<OrderPage>
orderModel:
cancelledOrderList[
index])))
.then((value) {
model
.getOrder(widget.customerID,
widget.customerGUID, pageID)
.then((value) {
getCancelledOrder(model);
});
});
;
},
child: Row(
mainAxisAlignment:
@ -1253,12 +1237,10 @@ class _OrderPageState extends State<OrderPage>
),
Container(
margin: EdgeInsets.all(8.0),
child: SvgPicture.asset(
projectViewModel.isArabic
? 'assets/images/pharmacy/arrow_left.svg'
: 'assets/images/pharmacy/arrow_right.svg',
height: 20,
width: 20,
child: Icon(
Icons.arrow_forward,
size: 18,
color: Colors.grey[500],
),
),
],

@ -604,9 +604,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
print(widget.orderModel.orderStatusId);
// if(orderStatus == 'delivered')
if (widget.orderModel.orderStatusId == 30 || widget.orderModel.orderStatusId == 997 || widget.orderModel.orderStatusId == 994)
return Colors.blue[700];
return Color(0xFF4CAF50);
else if (widget.orderModel.orderStatusId == 20 || widget.orderModel.orderStatusId == 995 || widget.orderModel.orderStatusId == 998 || widget.orderModel.orderStatusId == 999)
return Colors.green;
return Colors.grey[500];
else if (widget.orderModel.orderStatusId == 10)
return Colors.orange[300];
else if (widget.orderModel.orderStatusId == 40 || widget.orderModel.orderStatusId == 996 || widget.orderModel.orderStatusId == 200) return Colors.red[900];

@ -62,7 +62,7 @@ class _AddAddressPageState extends State<AddAddressPage> {
return BaseView<PharmacyAddressesViewModel>(
builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).changeAddress,
isShowAppBar: true,
isShowAppBar: false,
isPharmacy: true,
backgroundColor: Colors.white,
body: Container(

@ -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;
}
},
),
),

File diff suppressed because it is too large Load Diff

@ -58,8 +58,8 @@ class ProductDetailService extends BaseService {
_stockAvailability = response['products'][0]['stock_availability'];
_stockAvailabilityn = response['products'][0]['stock_availabilityn'];
// _isStockAvailable = response['products'][0]['IsStockAvailable'];
_isStockAvailable = _stockAvailability == "In stock" ? true : false;
_isStockAvailable = response['products'][0]['IsStockAvailable'];
// _isStockAvailable = _stockAvailability == "In stock" ? true : false;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -123,10 +123,11 @@ class ProductDetailService extends BaseService {
return Future.value(localRes);
}
Future notifyMe(customerId, itemID, context) async {
Future notifyMe(customerId, itemID, ) async {
hasError = false;
await baseAppClient.getPharmacy(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) {
AppToast.showSuccessToast(message: TranslationBase.of(context).notifyMeMsg
AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).notifyMeMsg
// TranslationBase.of(context).notifyMeMsg
//'You will be notified when product available'
);
}, onFailure: (String error, int statusCode) {

@ -10,15 +10,17 @@ final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterL
class LocalNotification {
Function(String payload) _onNotificationClick;
static LocalNotification _instance;
static LocalNotification getInstance(){
static LocalNotification getInstance() {
return _instance;
}
static init({Function(String payload) onNotificationClick}){
if(_instance == null){
static init({Function(String payload) onNotificationClick}) {
if (_instance == null) {
_instance = LocalNotification();
_instance._onNotificationClick = onNotificationClick;
_instance._initialize();
}else{
} else {
// assert(false,(){
// //TODO fix it
// "LocalNotification Already Initialized";
@ -26,7 +28,7 @@ class LocalNotification {
}
}
_initialize(){
_initialize() {
var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon');
var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null);
var initializationSettings = InitializationSettings(initializationSettingsAndroid, initializationSettingsIOS);
@ -34,11 +36,12 @@ class LocalNotification {
}
var _random = new Random();
_randomNumber({int from = 100000}){
_randomNumber({int from = 100000}) {
return _random.nextInt(from);
}
_vibrationPattern(){
_vibrationPattern() {
var vibrationPattern = Int64List(4);
vibrationPattern[0] = 0;
vibrationPattern[1] = 1000;
@ -50,10 +53,11 @@ class LocalNotification {
Future showNow({@required String title, @required String subtitle, String payload}) {
Future.delayed(Duration(seconds: 1)).then((result) async {
var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', 'HMG', importance: Importance.Max, priority: Priority.High, ticker: 'ticker', vibrationPattern: _vibrationPattern());
var androidPlatformChannelSpecifics =
AndroidNotificationDetails('com.hmg.local_notification', 'HMG', 'HMG', importance: Importance.Max, priority: Priority.High, ticker: 'ticker', vibrationPattern: _vibrationPattern());
var iOSPlatformChannelSpecifics = IOSNotificationDetails();
var platformChannelSpecifics = NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err){
await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
print(err);
});
});
@ -81,11 +85,9 @@ class LocalNotification {
ledOffMs: 500);
var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff');
///change it to be as ionic
// var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.schedule(0, title, description,
// scheduledNotificationDateTime, platformChannelSpecifics);
// /change it to be as ionic
var platformChannelSpecifics = NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics);
}
///Repeat notification every day at approximately 10:00:00 am

@ -2789,8 +2789,10 @@ class TranslationBase {
String get gr => localizedValues["gr"][locale.languageCode];
String get gramsPerMeal => localizedValues["gramsPerMeal"][locale.languageCode];
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