|
|
|
|
@ -29,50 +29,23 @@ import 'package:rating_bar/rating_bar.dart';
|
|
|
|
|
import '../../final_products_page.dart';
|
|
|
|
|
import 'lacum-activitaion-vida-page.dart';
|
|
|
|
|
|
|
|
|
|
bool isInWishlist = false;
|
|
|
|
|
int price = 0;
|
|
|
|
|
var itemID;
|
|
|
|
|
var product;
|
|
|
|
|
var customerId;
|
|
|
|
|
var item;
|
|
|
|
|
dynamic languageID;
|
|
|
|
|
List wishlistData;
|
|
|
|
|
|
|
|
|
|
class PharmacyPage extends StatefulWidget {
|
|
|
|
|
// final PharmacyProduct product;
|
|
|
|
|
// PharmacyPage(this.product);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_PharmacyPageState createState() => _PharmacyPageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
|
// dynamic wishlistVar;
|
|
|
|
|
|
|
|
|
|
getLanguageID() async {
|
|
|
|
|
languageID = await sharedPref.getString(APP_LANGUAGE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// List<RecommendedProductModel> recommendedProductList = [];
|
|
|
|
|
List<ProductDetailViewModel> wishList = [];
|
|
|
|
|
|
|
|
|
|
var model;
|
|
|
|
|
// String ProductId="4561";
|
|
|
|
|
//String id ="3608";
|
|
|
|
|
String productId = "";
|
|
|
|
|
String id = "";
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
checkWishlist();
|
|
|
|
|
// userInfo(widget.product.id, widget.product);
|
|
|
|
|
userInfo(id, product);
|
|
|
|
|
getLanguageID();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BaseView<PharmacyModuleViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getPharmacyHomeData(),
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
await getLanguageID();
|
|
|
|
|
await model.getPharmacyHomeData();
|
|
|
|
|
},
|
|
|
|
|
allowAny: true,
|
|
|
|
|
builder: (_, model, wi) => AppScaffold(
|
|
|
|
|
title: "",
|
|
|
|
|
@ -87,7 +60,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
BannerPager(model),
|
|
|
|
|
// GridViewButtons(model),
|
|
|
|
|
GridViewButtons(model),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
|
|
|
|
child: Row(
|
|
|
|
|
@ -215,7 +188,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
|
BorderRadius.circular(
|
|
|
|
|
30.0)),
|
|
|
|
|
child: Text(
|
|
|
|
|
languageID == "ar"
|
|
|
|
|
model.languageID == "ar"
|
|
|
|
|
? model.prescriptionsList[index].isInOutPatientDescriptionN.toString()
|
|
|
|
|
: model.prescriptionsList[index].isInOutPatientDescription.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
@ -700,36 +673,6 @@ class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
|
await x.addToWishlistData(itemID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkWishlist() async {
|
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
|
await x.checkWishlistData();
|
|
|
|
|
for (int i = 0; i < x.wishListItems.length; i++) {
|
|
|
|
|
// itemID = x.wishListItems[i].id;
|
|
|
|
|
print("-------------wishlist---------------");
|
|
|
|
|
print(itemID);
|
|
|
|
|
// print(product.id);
|
|
|
|
|
print(x.wishListItems[i].productId);
|
|
|
|
|
if (itemID == x.wishListItems[i].productId) {
|
|
|
|
|
isInWishlist = true;
|
|
|
|
|
// print('in wishlist');
|
|
|
|
|
break;
|
|
|
|
|
} else {
|
|
|
|
|
isInWishlist = false;
|
|
|
|
|
// print('not in wishlist');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future userInfo(id, product) async {
|
|
|
|
|
customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
|
|
|
|
|
if (customerId != null) {
|
|
|
|
|
itemID = id;
|
|
|
|
|
product = product;
|
|
|
|
|
checkWishlist();
|
|
|
|
|
}
|
|
|
|
|
print("customerId:$customerId");
|
|
|
|
|
return customerId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class GridViewButtons extends StatelessWidget {
|
|
|
|
|
@ -874,30 +817,4 @@ class GridViewCard extends StatelessWidget {
|
|
|
|
|
" " +
|
|
|
|
|
dateObj.year.toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class test extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
_testState createState() => _testState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _testState extends State<test> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//addWishlistData() async {
|
|
|
|
|
// ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
|
// await wishlistData.add(x.checkWishlistData());
|
|
|
|
|
// print("-------------testWishlist---------------");
|
|
|
|
|
//
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
// checkWishlist() async {
|
|
|
|
|
// ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
|
// wishlistVar = await x.checkWishlistData();
|
|
|
|
|
// print("wishlistVar>>>>>>>>>>>>>>>");
|
|
|
|
|
// print(wishlistVar);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
}
|