Merge branch 'development_new_design_2.0' into zik_new_design_2.0

* development_new_design_2.0:
  fix issues
  Base app client updates
  prescription reminders added
  Medical Reminder 1.0
  lakum fixes
  Medical Reminder
merge-update-with-lab-changes
Zohaib Iqbal Kambrani 4 years ago
commit 3bd94ee05e

@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -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": "يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء"

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

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

@ -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,100 @@ 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;
});
});
});
print("Has Reminder: " + hasReminder.toString());
}
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;
});
}
}

@ -96,7 +96,8 @@ class _CartOrderPageState extends State<CartOrderPage> {
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],

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

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

@ -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;
@ -289,7 +290,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
)
: isAvailability
? AvailabilityInfo(
previousModel: model,
previousModel: model
)
: Container(),
],
@ -298,17 +299,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);
// },
// )
],
),
),

@ -30,15 +30,19 @@ 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.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(

@ -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(),
),
),
],
),

@ -217,12 +217,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
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],
),
),
],
@ -246,11 +244,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
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[
@ -503,12 +501,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
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],
),
),
],
@ -532,11 +528,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
left: 13.0, right: 13.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
color: Colors.grey[700],
style: BorderStyle.solid,
width: 5.0,
),
color: Colors.green,
color: Colors.grey[700],
borderRadius: BorderRadius.circular(
30.0)),
child: processingOrderList[
@ -969,12 +965,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
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],
),
),
],
@ -1139,7 +1133,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
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]);
}
@ -1243,12 +1237,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
),
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[700];
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(

@ -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,9 @@ 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];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save