Updates & fixes

merge-update-with-lab-changes
haroon amjad 5 years ago
parent 5474ecf2cc
commit b08dfb117c

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

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

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

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

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

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

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

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

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

@ -9,7 +9,6 @@ import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchI
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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';
@ -52,7 +51,19 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
],
body: Container(
child: Platform.isIOS ? _getAppleWatchInstructions() : _getGoogleWatchInstructions(),
));
),
bottomSheet: Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 30.0),
child: DefaultButton(
TranslationBase.of(context).continues,
() {
_openHealthDataList();
},
color: Color(0xff359846),
),
),
);
}
_getAppleWatchInstructions() {
@ -61,29 +72,15 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(enableInfiniteScroll: false, viewportFraction: 0.95, height: MediaQuery.of(context).size.height * 0.9),
items: [1, 2].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: i == 1
? Column(
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)),
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600)),
),
Container(
child: Row(
@ -94,9 +91,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row(
children: [
Image.asset("assets/images/SmartWatches/apple-watch-1.jpeg", width: 70.0, height: 70.0),
Container(
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 1", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
@ -108,9 +108,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row(
children: [
Image.asset("assets/images/SmartWatches/apple-watch-2.jpg", width: 70.0, height: 70.0),
Container(
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 2", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
@ -129,9 +132,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row(
children: [
Image.asset("assets/images/SmartWatches/apple-watch-3.jpg", width: 70.0, height: 70.0),
Container(
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
@ -143,9 +149,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row(
children: [
Image.asset("assets/images/SmartWatches/apple-watch-4.jpg", width: 70.0, height: 70.0),
Container(
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
@ -164,9 +173,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row(
children: [
Image.asset("assets/images/SmartWatches/apple-watch-5.jpg", width: 70.0, height: 70.0),
Container(
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 5", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
@ -178,9 +190,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row(
children: [
Image.asset("assets/images/SmartWatches/Apple-Watch-6.png", width: 70.0, height: 70.0),
Container(
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Text("Apple Watch Series 6", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
@ -199,9 +214,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row(
children: [
Image.asset("assets/images/SmartWatches/miBand3.jpg", width: 70.0, height: 70.0),
Container(
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Text("Mi Band 3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
@ -213,9 +231,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
child: Row(
children: [
Image.asset("assets/images/SmartWatches/miBand4.jpg", width: 70.0, height: 70.0),
Container(
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.22,
child: Text("Mi Band 4", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
@ -232,66 +253,14 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
margin: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(15.0, 40.0, 15.0, 0.0),
child: DefaultButton(
TranslationBase.of(context).continues,
() {
buttonCarouselController.nextPage();
},
color: Color(0xff359846),
),
),
],
)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).watchInstructions, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).iosInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).iosInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Text(TranslationBase.of(context).iosInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Padding(
padding: const EdgeInsets.fromLTRB(12.0, 50.0, 12.0, 20.0),
child: Row(
children: [
Expanded(
child: DefaultButton(
TranslationBase.of(context).syncHealthData,
() {},
color: Color(0xFFD02127),
disabledColor: Color(0xff28323A).withOpacity(0.3),
),
),
mWidth(12),
if (hasAlreadySynced)
Expanded(
child: DefaultButton(
TranslationBase.of(context).alreadySynced,
() {
_openHealthDataList();
InkWell(
onTap: () {
showInstructionsDialog();
},
color: Color(0xff359846),
child: Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Text(TranslationBase.of(context).watchInstructions,
style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline)),
),
),
],
@ -299,50 +268,19 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
),
],
),
));
},
);
}).toList(),
),
)
],
),
);
}
_getGoogleWatchInstructions() {
return SingleChildScrollView(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: CarouselSlider(
carouselController: buttonCarouselController,
options: CarouselOptions(
// enableInfiniteScroll: true,
viewportFraction: 0.99,
height: MediaQuery.of(context).size.height * 0.9),
items: [1, 2].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.only(top: 16.0, bottom: 8.0),
// fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: i == 1
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).supportedWatches, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600)),
),
Container(
child: Row(
@ -488,143 +426,130 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
launch("https://wearos.google.com/#find-your-watch");
},
child: Container(
margin: EdgeInsets.only(top: 20.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).moreSupportedWatches,
textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.blue, decoration: TextDecoration.underline, letterSpacing: -0.36)),
margin: EdgeInsets.only(top: 20.0),
child: Text(TranslationBase.of(context).moreSupportedWatches, style: TextStyle(fontSize: 14.0, color: Colors.blue, decoration: TextDecoration.underline, letterSpacing: -0.36)),
),
),
Container(
margin: EdgeInsets.all(10.0),
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.all(10.0),
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.all(15.0),
child: DefaultButton(
TranslationBase.of(context).continues,
() {
buttonCarouselController.nextPage();
InkWell(
onTap: () {
showInstructionsDialog();
},
color: CustomColors.green,
child: Padding(
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
child: Text(TranslationBase.of(context).watchInstructions,
style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline)),
),
),
],
)
: Column(
),
),
);
}
showInstructionsDialog() {
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: Dialog(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).watchInstructions, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)),
),
width: 350.0,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)),
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(TranslationBase.of(context).smartWatches, style: TextStyle(fontSize: 22.0, color: Colors.black, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
IconButton(
icon: Icon(
Icons.close,
color: Colors.black,
),
onPressed: () {
Navigator.pop(context);
},
),
],
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).androidInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)),
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).syncInstructionsIntro3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Platform.isIOS
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).androidInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)),
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).iosInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).androidInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)),
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).iosInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).androidInstructions4, style: TextStyle(fontSize: 14.0, letterSpacing: -0.34)),
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 21.0),
child: Text(TranslationBase.of(context).iosInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Padding(
padding: const EdgeInsets.fromLTRB(12.0, 50.0, 12.0, 20.0),
child: Row(
],
)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: DefaultButton(
TranslationBase.of(context).syncHealthData,
() {},
color: Color(0xFFD02127),
disabledColor: Color(0xff28323A).withOpacity(0.3),
Container(
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).androidInstructions1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).androidInstructions2, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
mWidth(12),
if (hasAlreadySynced)
Expanded(
child: DefaultButton(
TranslationBase.of(context).alreadySynced,
() {
_openHealthDataList();
},
color: Color(0xff359846),
Container(
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).androidInstructions3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 10.0),
child: Text(TranslationBase.of(context).androidInstructions4, style: TextStyle(fontSize: 14.0, letterSpacing: -0.36)),
),
],
),
],
),
// Container(
// margin: EdgeInsets.fromLTRB(15.0, 75.0, 15.0, 15.0),
// child: ButtonTheme(
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// minWidth: MediaQuery.of(context).size.width,
// height: 45.0,
// child: RaisedButton(
// color: new Color(0xFF60686b),
// textColor: Colors.white,
// elevation: 0,
// disabledTextColor: Colors.white,
// disabledColor: new Color(0xFFbcc2c4),
// onPressed: () {
// buttonCarouselController.nextPage();
// },
// child: Text("SYNC HEALTH DATA", style: TextStyle(fontSize: 18.0)),
// ),
// ),
// ),
// hasAlreadySynced
// ? Container(
// margin: EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 15.0),
// child: ButtonTheme(
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// minWidth: MediaQuery.of(context).size.width,
// height: 45.0,
// child: RaisedButton(
// color: new Color(0xFF60686b),
// textColor: Colors.white,
// elevation: 0,
// disabledTextColor: Colors.white,
// disabledColor: new Color(0xFFbcc2c4),
// onPressed: () {
// _openHealthDataList();
// },
// child: Text("ALREADY SYNCED", style: TextStyle(fontSize: 18.0)),
// ),
// ),
// )
// : Container(),
],
),
));
},
);
}).toList(),
),
)
],
),
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
}
getLastPatientRecord(BuildContext context) {

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

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

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

Loading…
Cancel
Save