fixed compare issues and arabic version

merge-requests/386/head
Fatimah Alshammari 4 years ago
parent 62167baec5
commit 8c0dca781c

@ -73,6 +73,8 @@ const Map localizedValues = {
},
'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'},
'search': {'en': 'Search', 'ar': 'بحث'},
'noResultFound': {'en': 'No Result Found', 'ar': 'المنتج غير موجود'},
'pleaseEnterProductName': {'en': 'Please Enter Product Name', 'ar': 'ادخل اسم المنتج'},
'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'},
'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'},
'appoInfo': {'en': 'Appointment Information', 'ar': 'معلومات الموعد'},
@ -712,11 +714,16 @@ const Map localizedValues = {
"ar":
"خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل."
},
"noReviewsAvailable": {"en": "No Reviews Available", "ar": "لا يوجد تقييمات"},
"noLocationAvailable": {"en": "No Location Available", "ar": "لا يوجد موقع"},
"orders": {"en": "Orders", "ar": "الطلبات"},
"lakum": {"en": "Lakum", "ar": "لكم"},
"wishlist": {"en": "Wishlist", "ar": "الرغبات"},
"wishlist": {"en": "Wishlist", "ar": "المفضلة"},
"products": {"en": "Products", "ar": "المنتجات"},
"reviews": {"en": "Reviews", "ar": "التقيمات"},
// "myPrescriptions": {"en": "My Prescriptions", "ar": "وصفاتي"},
"brands": {"en": "Brands", "ar": "العلامات التجارية"},
"productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"},
// "medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"},
"pillReminder": {"en": "Pill Reminder", "ar": "تذكير الأدويه"},
"shippingAddresses": {"en": "Shipping Addresses", "ar": "عناوين الشحن"},
@ -848,7 +855,7 @@ const Map localizedValues = {
},
"shopByBrands": {"en": "Shop By Brands", "ar": "تسوق حسب الماركات"},
"recentlyViewed": {"en": "Recently Viewed", "ar": "شوهدت مؤخرا"},
"bestSellers": {"en": "Best Sellers", "ar": "أفضل البائعين"},
"bestSellers": {"en": "Best Seller", "ar": "الأكثر مبيعأ"},
"deleteAllItems": {"en": "Delete All Items", "ar": "حذف كافة العناصر"},
"total": {"en": "Total", "ar": "المجموع"},
"totalWithColonRight": {"en": "Total:", "ar": ":المجموع"},
@ -881,15 +888,18 @@ const Map localizedValues = {
"en": "Drag point to change your age",
"ar": "اسحب لتغيير عمرك"
},
"refine": {"en": "Refine", "ar": "refine"},
"reset": {"en": "Reset", "ar": "اعادة تعيين"},
"apply": {"en": "Apply", "ar": "تطبيق"},
"viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"},
"categorise": {"en": "Categories", "ar": "التطبيقات"},
"wishList": {"en": "WishList", "ar": "الرغبات"},
"wishList": {"en": "WishList", "ar": "المفضلة"},
"myAccount": {"en": "My Account", "ar": "حسابي"},
"cart": {"en": "Cart", "ar": "التسوق"},
"Alhabibapp": {"en": "Al habib app", "ar": "تطبيق الحبيب"},
"searchProductHere": {
"en": "Search Product here",
"ar": "ابحث في الطلب الخاص بك"
"ar": "البحث عن منتج"
},
"HHCNotAuthMsg": {
"en":
@ -1539,7 +1549,10 @@ const Map localizedValues = {
"vaccination": {"en": "Vaccination", "ar": "جدول التطعيمات"},
"welcomeBack": {"en": "Welcome back", "ar": "مرحبا مرة أخرى"},
"quantitySize": {"en": "Quantity", "ar": "كميه"},
"addToCart": {"en": "add to cart", "ar": "إضفة للسلة"},
"addToCart": {"en": "Add to Cart", "ar": "إضف للسلة"},
"addToWishlist": {"en": "Add to Wishlist", "ar": "اضف للمفضلة"},
"noData": {"en": "There is no data", "ar": "لايوجد بيانات"},
"no_data": {"en": "No data", "ar": "لايوجد بيانات"},
"buyNow": {"en": "buy now", "ar": "إشتري الان"},
"quantityShortcut": {"en": "QTY", "ar": "كمية"},

@ -14,15 +14,15 @@ class RecommendedProductModel {
// dynamic metaDescription;
// dynamic metaTitle;
bool allowCustomerReviews;
int approvedRatingSum;
int notApprovedRatingSum;
int approvedTotalReviews;
int notApprovedTotalReviews;
dynamic approvedRatingSum;
dynamic notApprovedRatingSum;
dynamic approvedTotalReviews;
dynamic notApprovedTotalReviews;
dynamic sku;
bool isRx;
bool prescriptionRequired;
// dynamic rxMessage;
// dynamic rxMessagen;
dynamic rxMessage;
dynamic rxMessagen;
// dynamic manufacturerPartNumber;
// dynamic gtin;
bool isGiftCard;
@ -30,33 +30,33 @@ class RecommendedProductModel {
bool automaticallyAddRequiredProducts;
bool isDownload;
bool unlimitedDownloads;
int maxNumberOfDownloads;
dynamic maxNumberOfDownloads;
// dynamic downloadExpirationDays;
bool hasSampleDownload;
bool hasUserAgreement;
bool isRecurring;
int recurringCycleLength;
int recurringTotalCycles;
dynamic recurringCycleLength;
dynamic recurringTotalCycles;
bool isRental;
int rentalPriceLength;
dynamic rentalPriceLength;
bool isShipEnabled;
bool isFreeShipping;
bool shipSeparately;
int additionalShippingCharge;
dynamic additionalShippingCharge;
bool isTaxExempt;
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
bool useMultipleWarehouses;
int manageInventoryMethodId;
int stockQuantity;
dynamic manageInventoryMethodId;
dynamic stockQuantity;
dynamic stockAvailability;
dynamic stockAvailabilityn;
bool displayStockAvailability;
bool displayStockQuantity;
int minStockQuantity;
int notifyAdminForQuantityBelow;
dynamic minStockQuantity;
dynamic notifyAdminForQuantityBelow;
bool allowBackInStockSubscriptions;
int orderMinimumQuantity;
int orderMaximumQuantity;
dynamic orderMinimumQuantity;
dynamic orderMaximumQuantity;
// Null allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton;
@ -64,18 +64,18 @@ class RecommendedProductModel {
bool availableForPreOrder;
// dynamic preOrderAvailabilityStartDateTimeUtc;
bool callForPrice;
double price;
int oldPrice;
double productCost;
dynamic price;
dynamic oldPrice;
dynamic productCost;
// dynamic specialPrice;
// dynamic specialPriceStartDateTimeUtc;
// dynamic specialPriceEndDateTimeUtc;
bool customerEntersPrice;
int minimumCustomerEnteredPrice;
int maximumCustomerEnteredPrice;
dynamic minimumCustomerEnteredPrice;
dynamic maximumCustomerEnteredPrice;
bool basepriceEnabled;
int basepriceAmount;
int basepriceBaseAmount;
dynamic basepriceAmount;
dynamic basepriceBaseAmount;
bool hasTierPrices;
bool hasDiscountsApplied;
// dynamic discountName;
@ -85,30 +85,30 @@ class RecommendedProductModel {
// dynamic discountPercentage;
dynamic currency;
dynamic currencyn;
double weight;
int length;
int width;
int height;
dynamic weight;
dynamic length;
dynamic width;
dynamic height;
// dynamic availableStartDateTimeUtc;
// dynamic availableEndDateTimeUtc;
int displayOrder;
dynamic displayOrder;
bool published;
bool deleted;
dynamic createdOnUtc;
dynamic updatedOnUtc;
dynamic productType;
int parentGroupedProductId;
dynamic parentGroupedProductId;
// List<dynamic> roleIds;
// List<dynamic> discountIds;
// List<dynamic> storeIds;
List<int> manufacturerIds;
List<dynamic> manufacturerIds;
// List<dynamic> reviews;
List<Images> images;
// List<dynamic> attributes;
List<Specifications> specifications;
// List<dynamic> associatedProductIds;
// List<dynamic> tags;
int vendorId;
dynamic vendorId;
dynamic seName;
bool isinwishlist;
@ -135,8 +135,8 @@ class RecommendedProductModel {
this.sku,
this.isRx,
this.prescriptionRequired,
// this.rxMessage,
// this.rxMessagen,
this.rxMessage,
this.rxMessagen,
// this.manufacturerPartNumber,
// this.gtin,
this.isGiftCard,
@ -254,8 +254,8 @@ class RecommendedProductModel {
sku = json['sku'];
isRx = json['is_rx'];
prescriptionRequired = json['prescription_required'];
// rxMessage = json['rx_message'];
// rxMessagen = json['rx_messagen'];
rxMessage = json['rx_message'];
rxMessagen = json['rx_messagen'];
// manufacturerPartNumber = json['manufacturer_part_number'];
// gtin = json['gtin'];
isGiftCard = json['is_gift_card'];
@ -353,7 +353,7 @@ class RecommendedProductModel {
// storeIds.add(new Null.fromJson(v));
// });
// }
manufacturerIds = json['manufacturer_ids'].cast<int>();
manufacturerIds = json['manufacturer_ids'].cast<dynamic>();
// if (json['reviews'] != null) {
// reviews = new List<Null>();
// json['reviews'].forEach((v) {
@ -422,8 +422,8 @@ class RecommendedProductModel {
data['sku'] = this.sku;
data['is_rx'] = this.isRx;
data['prescription_required'] = this.prescriptionRequired;
// data['rx_message'] = this.rxMessage;
// data['rx_messagen'] = this.rxMessagen;
data['rx_message'] = this.rxMessage;
data['rx_messagen'] = this.rxMessagen;
// data['manufacturer_part_number'] = this.manufacturerPartNumber;
// data['gtin'] = this.gtin;
data['is_gift_card'] = this.isGiftCard;
@ -543,7 +543,7 @@ class RecommendedProductModel {
}
class LocalizedNames {
int languageId;
dynamic languageId;
String localizedName;
LocalizedNames({this.languageId, this.localizedName});
@ -562,8 +562,8 @@ class LocalizedNames {
}
class Images {
int id;
int position;
dynamic id;
dynamic position;
String src;
String thumb;
String attachment;
@ -590,8 +590,8 @@ class Images {
}
class Specifications {
int id;
int displayOrder;
dynamic id;
dynamic displayOrder;
String defaultValue;
String defaultValuen;
String name;

@ -33,10 +33,12 @@ class PharmacyModuleViewModel extends BaseViewModel {
List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts;
List<Map<String, dynamic>> get recommendedProductList =>
List <RecommendedProductModel> get recommendedProductList =>
_recommendedProductService.recommendedList;
// List<Map<String, dynamic>> get recommendedProductList =>
// _recommendedProductService.recommendedList;
List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList;

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -12,6 +13,8 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter/src/widgets/image.dart' as flutterImage;
import 'base/base_view.dart';
dynamic languageID;
class FinalProductsPage extends StatefulWidget {
final String id;
final int productType; // 1 : default, 2 : manufacturer , 3 : recently viewed
@ -33,6 +36,15 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
color: Colors.blue,
size: 29.0,
);
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
void initState() {
getLanguageID();
super.initState();
}
@override
Widget build(BuildContext context) {
return BaseView<PharmacyCategoriseViewModel>(
@ -55,7 +67,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
builder: (BuildContext context, PharmacyCategoriseViewModel model,
Widget child) =>
PharmacyAppScaffold(
appBarTitle: "Products",
appBarTitle: TranslationBase.of(context).products,
isBottomBar: false,
isShowAppBar: true,
backgroundColor: Colors.white,
@ -74,7 +86,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Padding(
padding: EdgeInsets.all(8.0),
child: Texts(
'Products',
TranslationBase.of(context).products,
fontWeight: FontWeight.w600,
),
),
@ -213,11 +225,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
),
),
Container(
width: model
.finalProducts[
index]
.rxMessage !=
null
width: model.finalProducts[index].rxMessage != null
? MediaQuery.of(
context)
.size
@ -235,23 +243,15 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
.circular(
6)),
),
child: Texts(
model
.finalProducts[
index]
.rxMessage !=
null
? model
.finalProducts[
index]
.rxMessage
: "",
child:model.finalProducts[index].rxMessage != null
? Texts( languageID == 'ar' ? model.finalProducts[index].rxMessagen
: model.finalProducts[index].rxMessage,
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w600,
),
): Texts(""),
),
],
),

@ -43,7 +43,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: currentTab != 4
appBar: currentTab != 4 && currentTab != 3
? AppBar(
backgroundColor: Color(0xff5AB145),
elevation: 0,
@ -55,7 +55,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
),
child: InkWell(
child: Padding(
padding: EdgeInsets.all(8.0),
padding: EdgeInsets.all(5.0),
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
@ -172,7 +172,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
print(response);
var product = PharmacyProduct.fromJson(response["products"][0]);
product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: ProductDetailPage(product)));
}, onFailure: (String error, int statusCode) {

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_mo
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
@ -108,8 +109,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
padding: EdgeInsets.all(10.0),
child: InkWell(
child: Container(
child: Texts(
'View All Categories',
child: Texts(TranslationBase.of(context).viewCategorise,
// 'View All Categories',
fontWeight: FontWeight.w300,
),
),
@ -143,10 +144,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
CrossAxisAlignment
.start,
children: [
Texts(model
.categoriseParent[
index]
.name),
Texts( projectViewModel.isArabic ? model.categoriseParent[index].namen
:model.categoriseParent[index].name),
Divider(
thickness: 0.6,
color: Colors
@ -724,10 +723,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
children: [
Stack(
children: [
if (model
.parentProducts[
index]
.discountName !=
if (model.parentProducts[index].discountName !=
null)
RotatedBox(
quarterTurns: 4,
@ -847,10 +843,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
child: Center(
child: Texts(
model
.parentProducts[
index]
.discountName,
model.parentProducts[index].discountName,
regular: true,
color:
Colors.white,
@ -858,11 +851,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
),
),
Texts(
model
.parentProducts[
index]
.name,
Texts( projectViewModel.isArabic ?
model.parentProducts[index].namen
: model.parentProducts[index].name,
regular: true,
fontSize: 12,
fontWeight:
@ -1047,9 +1038,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.width *
0.65,
child: Texts(
model
.parentProducts[index]
.name,
projectViewModel.isArabic ? model.parentProducts[index].namen
: model.parentProducts[index].name ,
regular: true,
fontSize: 13.2,
fontWeight:

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:carousel_slider/carousel_slider.dart';
@ -5,9 +7,11 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
int counter = 0;
int counter = 0;
dynamic languageID;
class ComparePage extends StatefulWidget {
@override
_ComparePageState createState() => _ComparePageState();
@ -15,15 +19,25 @@ class ComparePage extends StatefulWidget {
//CompareList compareItems = CompareList();
class _ComparePageState extends State<ComparePage> {
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
void initState() {
getLanguageID();
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: 'Reviews page',
appBarTitle: TranslationBase.of(context).compare,
isShowAppBar: true,
isPharmacy: true,
body: Container(
body: SingleChildScrollView(
child: Container(
child: compareList(),
),
),
);
}
}
@ -50,8 +64,8 @@ class compareList extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'There is no data',
child: Text(TranslationBase.of(context).noData,
// 'There is no data',
style: TextStyle(fontSize: 30),
),
)
@ -105,7 +119,7 @@ class _slideDetailState extends State<slideDetail> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 550,
height: 750,
width: 150,
margin: EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
@ -157,7 +171,14 @@ class _slideDetailState extends State<slideDetail> {
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: languageID == "ar"? TextSpan(
text: widget.data[index].namen,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
: TextSpan(
text: widget.data[index].name,
style: TextStyle(
fontWeight: FontWeight.bold,
@ -173,7 +194,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].price.toString(),
text: "SAR ${widget.data[index].price.toString()}",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
@ -195,10 +216,21 @@ class _slideDetailState extends State<slideDetail> {
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].nameN :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].name :
"No data",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
@ -212,10 +244,82 @@ class _slideDetailState extends State<slideDetail> {
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].defaultValuen :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].defaultValue :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
),
),
Padding(
padding: EdgeInsets.only(top: 8.0),
child: Container(
height: 1.0,
width: 300.0,
color: Colors.grey,
),
),
Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].nameN :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].name :
"No data",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
),
),
),
),
Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].defaultValuen :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].defaultValue :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
@ -237,10 +341,20 @@ class _slideDetailState extends State<slideDetail> {
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text:widget.data[index].specifications != null ?
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].nameN :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].name :
"No data",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
@ -254,10 +368,82 @@ class _slideDetailState extends State<slideDetail> {
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].defaultValuen :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].defaultValue :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
),
),
Padding(
padding: EdgeInsets.only(top: 8.0),
child: Container(
height: 1.0,
width: 300.0,
color: Colors.grey,
),
),
Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].nameN :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].name :
"No data",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
),
),
),
),
Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].defaultValuen :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].defaultValue :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
@ -279,10 +465,20 @@ class _slideDetailState extends State<slideDetail> {
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text:widget.data[index].specifications != null ?
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].nameN :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].name :
"No data",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
@ -296,10 +492,82 @@ class _slideDetailState extends State<slideDetail> {
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text:widget.data[index].specifications != null ?
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].defaultValuen :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].defaultValue :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
),
),
Padding(
padding: EdgeInsets.only(top: 8.0),
child: Container(
height: 1.0,
width: 300.0,
color: Colors.grey,
),
),
Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].nameN :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].name :
"No data",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
),
),
),
),
Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: languageID == "ar"? TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].defaultValuen :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
):TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].defaultValue :
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle(
color: Colors.black54,
fontSize: 15,

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/review_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:rating_bar/rating_bar.dart';
@ -22,7 +23,7 @@ class _MyReviewsPageState extends State<MyReviewsPage> {
return BaseView<ReviewViewModel>(
onModelReady: (model) => model.getReviewData(),
builder: (_, model, wi) => AppScaffold(
appBarTitle: 'My Reviews',
appBarTitle: TranslationBase.of(context).reviews,
isShowAppBar: true,
isPharmacy: true,
baseViewModel: model,

@ -31,7 +31,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
allowAny: true,
onModelReady: (model) => model.getBrandsData(),
builder: (_, model, wi) => AppScaffold(
appBarTitle: 'Brands page',
appBarTitle: TranslationBase.of(context).brands,
isShowAppBar: true,
isPharmacy: true,
isShowDecPage: false,

@ -17,9 +17,10 @@ import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
int price = 0;
var languageID;
dynamic languageID;
bool isOverQuantity = false;
bool isInWishlit = false;
//int isSelected = 1;
@ -35,7 +36,7 @@ class ProductDetailPage extends StatefulWidget {
// final Products recommendedProducts;
ProductDetailPage(this.product, );
ProductDetailPage(this.product );
@override
@ -43,15 +44,20 @@ class ProductDetailPage extends StatefulWidget {
}
class __ProductDetailPageState extends State<ProductDetailPage> {
AppSharedPreferences sharedPref = AppSharedPreferences();
bool isTrue = true;
bool isDetails = true;
bool isReviews = false;
bool isAvailabilty = false;
dynamic wishlistItems;
var model;
//var model;
// String ProductId="4561";
String productId = "";
// String productId = "";
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
checkWishlist() async {
GifLoaderDialogUtils.showMyDialog(context);
@ -72,11 +78,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
setState(() {});
}
void initState() {
getLanguageID();
price = 1;
specificationData = widget.product;
userInfo();
// recommendedData= widget.recommendedProducts;
super.initState();
}
@ -97,7 +104,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Widget build(BuildContext context) {
return customerId != null
? DetailPageScafold(
appBarTitle: 'product detail page',
appBarTitle: TranslationBase.of(context).productDetails,
isShowAppBar: true,
isPharmacy: true,
isShowDecPage: false,
@ -125,7 +132,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
flex: 1,
child: Container(
alignment: Alignment.centerRight,
child: languageID == 'ar'
child: languageID == "ar"
? Text(
widget.product
.discountDescriptionn,
@ -166,7 +173,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
),
Container(
width: 500,
height: 150,
height: 220,
color: Colors.white,
child: productNameAndPrice(context, widget.product),
),
@ -175,7 +182,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
),
Container(
width: 500,
height: 120,
height: 100,
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -195,7 +202,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text(
"there is no data",
TranslationBase.of(context).noData,
// "there is no data",
),
),
),
@ -335,10 +343,9 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
),
Container(
child: Text(
languageID == 'ar'
languageID == "ar"
? widget.product.fullDescriptionn
: widget.product
.fullDescription ??
: widget.product.fullDescription ??
"",
style: TextStyle(
fontSize: 16,
@ -507,7 +514,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
: Container(
padding: EdgeInsets.all(15),
alignment: Alignment.center,
child: Text('No Reviews Available'),
child: Text(TranslationBase.of(context).noReviewsAvailable,),
// Text('No Reviews Available'),
),
)
: isAvailabilty
@ -521,8 +529,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
? Container(
padding: EdgeInsets.all(15),
alignment: Alignment.center,
child: Text(
'No location Available'),
child: Text(TranslationBase.of(context).noLocationAvailable,),
// Text('No location Available'),
)
: ListView.builder(
physics: ScrollPhysics(),
@ -614,14 +622,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
),
Row(
children: [
// Container(
// width: 500,
// height: 100,
// margin: EdgeInsets.only(bottom: 100),
// color: Colors.white,
// child: Text("ENAD TEST"),
// ),
Container(
customerId != null ? Container(
width: 410,
height: 50,
// margin: EdgeInsets.only(bottom: 5),
@ -630,7 +631,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
TranslationBase.of(context).recommended,
bold: true,
),
),
)
: Container(),
],
),
SingleChildScrollView(
@ -653,7 +655,6 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
onModelReady: (model) => model.getRecommendedProducts(widget.product.id),
builder: (_, model, wi) => Container(
child:
// Text(model.recommendedProductList[0].id),
model.recommendedProductList.length != null
? Expanded(
child: ListView.builder(
@ -668,10 +669,13 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
onTap: ()
async {
GifLoaderDialogUtils.showMyDialog(context);
await Navigator.push(
RecommendedProductModel data = model.recommendedProductList[index];
var json = data.toJson();
PharmacyProduct product = new PharmacyProduct.fromJson(json);
await Navigator.pushReplacement(
context,
FadePage(
page: ProductDetailPage(model.recommendedProductList[index]['id']),
page: ProductDetailPage(product),
));
GifLoaderDialogUtils.hideDialog(context);
},
@ -702,26 +706,26 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
child: Align(
alignment: Alignment.topRight,
child: IconButton(
icon: Icon(model.recommendedProductList[index]['isinwishlist'] != true ? Icons.favorite_border : Icons.favorite),
color: model.recommendedProductList[index]['isinwishlist'] != true ? Colors.grey : Colors.red,
icon: Icon(model.recommendedProductList[index].isinwishlist != true ? Icons.favorite_border : Icons.favorite),
color: model.recommendedProductList[index].isinwishlist != true ? Colors.grey : Colors.red,
onPressed: () async {
if (customerId != null ) {
if (!isInWishlit && model.recommendedProductList[index]['isinwishlist'] != true) {
if (!isInWishlit && model.recommendedProductList[index].isinwishlist != true) {
GifLoaderDialogUtils.showMyDialog(context);
await addToWishlistFunction(model.recommendedProductList[index]['id']);
await addToWishlistFunction(model.recommendedProductList[index].id);
// checkWishlist();
GifLoaderDialogUtils.hideDialog(context);
setState((){
model.recommendedProductList[index]['isinwishlist'] = true;
model.recommendedProductList[index].isinwishlist= true;
});
} else {
GifLoaderDialogUtils.showMyDialog(context);
await deleteFromWishlistFunction(model.recommendedProductList[index]['id']);
await deleteFromWishlistFunction(model.recommendedProductList[index].id);
GifLoaderDialogUtils.hideDialog(context);
setState((){
model.recommendedProductList[index]['isinwishlist'] = false;
model.recommendedProductList[index].isinwishlist = false;
});
}
} else {
@ -773,10 +777,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
alignment:
Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20),
child: (model.recommendedProductList[index]['images'] != null &&
model.recommendedProductList[index]['images'].length > 0)
child: (model.recommendedProductList[index].images != null &&
model.recommendedProductList[index].images.length > 0)
? Image.network(
model.recommendedProductList[index]['images'][0]['src'].toString(),
model.recommendedProductList[index].images[0].src.toString(),
// item.images[0].src,
fit: BoxFit.cover,
height: 60,
@ -788,7 +792,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
),
),
Container(
width: model.recommendedProductList[index]['rx_message'] !=
width: model.recommendedProductList[index].rxMessage !=
null
? MediaQuery.of(context).size.width /
5
@ -802,20 +806,16 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child:
Texts(
model.recommendedProductList[index]['rx_message'] != null
? model.recommendedProductList[index]['rx_message']
: "",
color:
Colors.white,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight.w400,
),
child: model.recommendedProductList[index].rxMessage != null
? Texts(
languageID == "ar"
? model.recommendedProductList[index].rxMessagen
: model.recommendedProductList[index].rxMessage,
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
):Texts (""),
),
]),
Container(
@ -831,10 +831,9 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
.start,
children: [
Text(
languageID ==
"ar"
? model.recommendedProductList[index]['namen']
: model.recommendedProductList[index]['name'],
languageID == "ar"
? model.recommendedProductList[index].namen
: model.recommendedProductList[index].name,
style:
TextStyle(
color:
@ -853,7 +852,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
5),
child:
Texts(
"SAR ${model.recommendedProductList[index]['price']}",
"SAR ${model.recommendedProductList[index].price}",
bold:
true,
fontSize:
@ -879,8 +878,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Alignment.topLeft,
child:
RatingBar.readOnly(
initialRating:
model.recommendedProductList[index]['approved_rating_sum'].toDouble(),
initialRating: model.recommendedProductList[index].approvedRatingSum.toDouble(),
// initialRating: productRate,
size:
13.0,
@ -900,7 +898,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
),
),
Texts(
"(${model.recommendedProductList[index]['approved_total_reviews'].toString()})",
"(${model.recommendedProductList[index].notApprovedTotalReviews.toString()})",
// bold: true,
fontSize:
12,
@ -941,7 +939,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
widget.product),
)
: AppScaffold(
appBarTitle: 'product detail page',
appBarTitle: TranslationBase.of(context).productDetails,
isShowAppBar: true,
isPharmacy: true,
isShowDecPage: false,
@ -1321,7 +1319,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
: Container(
padding: EdgeInsets.all(15),
alignment: Alignment.center,
child: Text('No Reviews Available'),
child: Text(TranslationBase.of(context).noReviewsAvailable),
// Text('No Reviews Available'),
),
)
: isAvailabilty
@ -1938,7 +1937,8 @@ class _productNameAndPriceState extends State<productNameAndPrice> {
width: 40,
),
Text(
widget.item.stockAvailability,
languageID == 'ar'?
widget.item.stockAvailabilityn : widget.item.stockAvailability ,
style: widget.item.stockAvailability == 'Out of stock'
? TextStyle(fontWeight: FontWeight.bold, color: Colors.red)
: TextStyle(
@ -2098,9 +2098,9 @@ fixingString(txt) {
return newTxt;
}
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
//getLanguageID() async {
// languageID = await sharedPref.getString(APP_LANGUAGE);
//}
getSpecificationData(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel();
@ -2165,7 +2165,8 @@ settingModalBottomSheet(context) {
children: <Widget>[
new ListTile(
leading: Icon(Icons.shopping_cart),
title: Text('Add to cart'),
title: Text(TranslationBase.of(context)
.addToCart,),
onTap: () => {
if (price > 0)
{addToCartFunction(price, itemID, context)}
@ -2177,12 +2178,14 @@ settingModalBottomSheet(context) {
}),
ListTile(
leading: Icon(Icons.favorite_border),
title: Text('Add to wishlist'),
title: Text(TranslationBase.of(context)
.addToWishlist,),
onTap: () => {addToWishlistFunction(itemID)},
),
ListTile(
leading: Icon(Icons.compare),
title: Text('Compare'),
title: Text(TranslationBase.of(context)
.compare,),
onTap: () => {
Provider.of<CompareList>(context, listen: false)
.addItem(specificationData),

@ -69,22 +69,15 @@ class CartOrderPage extends StatelessWidget {
child: Column(
children: [
...List.generate(
cart.shoppingCarts != null
? cart.shoppingCarts.length
: 0,
cart.shoppingCarts != null ? cart.shoppingCarts.length : 0,
(index) => ProductOrderItem(
cart.shoppingCarts[index], () {
print(cart.shoppingCarts[index]
.quantity);
cart.shoppingCarts[index], () {print(cart.shoppingCarts[index].quantity);
model.changeProductQuantity(cart.shoppingCarts[index]).then((value) {
if (model.state != ViewState.Error) {
appScaffold.appBar.badgeUpdater('${value.quantityCount ?? 0}');
}
if (model.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(
model.error);
}
ViewState.ErrorLocal) {Utils.showErrorToast(model.error);}
});
},
() {

@ -53,7 +53,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
List<RecommendedProductModel> recommendedProductList = [];
// List<RecommendedProductModel> recommendedProductList = [];
List<ProductDetailViewModel> wishList = [];
var model;
@ -66,8 +66,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
checkWishlist();
// userInfo(widget.product.id, widget.product);
userInfo(id, product);
print("-------------this--------------");
print(itemID);
getLanguageID();
}
@override
@ -138,7 +137,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
return Container(
// width: 160.0,
height:
MediaQuery.of(context).size.height * 0.6,
MediaQuery.of(context).size.height * 0.3,
padding: EdgeInsets.only(
bottom: 5.0, left: 5.0, right: 8.0),
margin: EdgeInsets.only(right: 10.0),
@ -217,16 +216,8 @@ class _PharmacyPageState extends State<PharmacyPage> {
30.0)),
child: Text(
languageID == "ar"
? model
.prescriptionsList[
index]
.isInOutPatientDescriptionN
.toString()
: model
.prescriptionsList[
index]
.isInOutPatientDescription
.toString(),
? model.prescriptionsList[index].isInOutPatientDescriptionN.toString()
: model.prescriptionsList[index].isInOutPatientDescription.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 15.0,

@ -57,10 +57,10 @@ class ProductTileItem extends StatelessWidget {
shape: Border(right: BorderSide(color: Colors.grey.shade300, width: 1)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
vertical: 0,
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 0),
padding: EdgeInsets.symmetric(horizontal: 4),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -92,13 +92,13 @@ class ProductTileItem extends StatelessWidget {
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
item.rxMessage != null ? item.rxMessage : "",
child: item.rxMessage != null ? Texts(
projectProvider.isArabic ? item.rxMessagen : item.rxMessage,
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
): Texts(""),
)
],
),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/wishlist_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/ProductCheckTypeWidget.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -18,7 +19,7 @@ class _WishlistPageState extends State<WishlistPage> {
return BaseView<WishListViewModel>(
onModelReady: (model) => model.getWishlistData(),
builder: (_, model, wi) => AppScaffold(
appBarTitle: 'Wishlist page',
appBarTitle: TranslationBase.of(context).wishlist,
isShowAppBar: widget.showBar,
isShowDecPage: false,
isPharmacy: true,

@ -93,11 +93,12 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
},
builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount,
isShowAppBar: false,
isShowAppBar: true,
isShowDecPage: false,
isPharmacy: true,
body: user != null
? Container(
color: Colors.white,
child: SingleChildScrollView(
child: Column(
children: <Widget>[

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -32,7 +33,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
builder: (BuildContext context, PharmacyCategoriseViewModel model,
Widget child) =>
PharmacyAppScaffold(
appBarTitle: 'Search',
appBarTitle: TranslationBase.of(context).search,
isBottomBar: false,
isShowAppBar: true,
backgroundColor: Colors.white,
@ -53,7 +54,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
key: _formKey,
child: TextFields(
autoFocus: true,
hintText: 'Search',
hintText: TranslationBase.of(context).search,
fontSize: 14.5,
prefixIcon: Icon(Icons.search),
inputAction: TextInputAction.search,
@ -62,12 +63,14 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
},
onSubmit: (value) {
searchMedicine(model, context);
msg = 'No Result Found';
// msg = 'No Result Found';
msg = TranslationBase.of(context).noResultFound;
},
controller: textController,
validator: (value) {
if (value.isEmpty) {
return 'please Enter Product Name';
// return 'please Enter Product Name';
return TranslationBase.of(context).pleaseEnterProductName;
}
return null;
},
@ -79,7 +82,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
),
InkWell(
child: Texts(
'Cancel',
TranslationBase.of(context).cancel,
fontSize: 17.0,
fontWeight: FontWeight.w500,
),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
@ -103,7 +104,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Padding(
padding: EdgeInsets.all(10.0),
child: Container(
child: Texts('View All Categories'),
child: Texts(TranslationBase.of(context).viewCategorise),
),
),
Icon(Icons.arrow_forward)
@ -266,8 +267,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
SizedBox(
width: 10.0,
),
Texts(
'Refine',
Texts(TranslationBase.of(context).refine,
// 'Refine',
fontWeight: FontWeight.w600,
),
],
@ -304,8 +305,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
SizedBox(
width: 10.0,
),
Texts(
'Refine',
Texts(TranslationBase.of(context).refine,
// 'Refine',
fontWeight:
FontWeight.w600,
),
@ -313,8 +314,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
width: 250.0,
),
InkWell(
child: Texts(
'Close',
child: Texts(TranslationBase.of(context).close,
// 'Close',
color: Colors.red,
fontWeight:
FontWeight.w600,
@ -336,7 +337,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
children: [
ExpansionTile(
title:
Texts('Categorise'),
Texts(TranslationBase.of(context).categorise),
children: [
ProcedureListWidget(
model: model,
@ -374,7 +375,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
color: Colors.black12,
),
ExpansionTile(
title: Texts('Brands'),
title: Texts(TranslationBase.of(context).brands),
children: [
ProcedureListWidget(
model: model,
@ -413,7 +414,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
color: Colors.black12,
),
ExpansionTile(
title: Texts('Price'),
title: Texts(TranslationBase.of(context).price),
children: [
Container(
color: Color(
@ -504,7 +505,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Container(
width: 100,
child: Button(
label: 'Reset',
label: TranslationBase.of(context).reset,
// 'Reset',
backgroundColor:
Colors.red,
),
@ -559,7 +561,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
brandId:
brandIds);
},
label: 'Apply',
label: TranslationBase.of(context).apply,
// 'Apply',
backgroundColor:
Colors
.green,

@ -16,9 +16,11 @@ class RecommendedProductService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
List<Map<String, dynamic>> _recommendedProductList = List();
List<Map<String, Object>> get recommendedList => _recommendedProductList;
// List<Map<String, dynamic>> _recommendedProductList = List();
// List<Map<String, Object>> get recommendedList => _recommendedProductList;
List<RecommendedProductModel> _recommendedProductList = List();
List<RecommendedProductModel> get recommendedList => _recommendedProductList;
Future getRecommendedProducts(productId) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
@ -28,11 +30,10 @@ class RecommendedProductService extends BaseService{
onSuccess: (dynamic response, int statusCode) {
_recommendedProductList.clear();
response['products'].forEach((item) {
_recommendedProductList.add(item);
// _recommendedProductList.add(item);
_recommendedProductList.add(RecommendedProductModel.fromJson(item));
});
print("---------------------Recommended Product List------------------------");
print(_recommendedProductList.length);
//print(item['name']);
print(response);
}, onFailure: (String error, int statusCode) {

@ -66,6 +66,8 @@ class TranslationBase {
localizedValues['enterDocName'][locale.languageCode];
String get search => localizedValues['search'][locale.languageCode];
String get noResultFound => localizedValues['noResultFound'][locale.languageCode];
String get pleaseEnterProductName => localizedValues['pleaseEnterProductName'][locale.languageCode];
String get bookNow => localizedValues['bookNow'][locale.languageCode];
@ -725,7 +727,12 @@ class TranslationBase {
String get orders => localizedValues['orders'][locale.languageCode];
String get lakum => localizedValues['lakum'][locale.languageCode];
String get wishlist => localizedValues['wishlist'][locale.languageCode];
String get brands => localizedValues['brands'][locale.languageCode];
String get products => localizedValues['products'][locale.languageCode];
String get reviews => localizedValues['reviews'][locale.languageCode];
String get productDetails => localizedValues['productDetails'][locale.languageCode];
String get noReviewsAvailable => localizedValues['noReviewsAvailable'][locale.languageCode];
String get noLocationAvailable => localizedValues['noLocationAvailable'][locale.languageCode];
String get myPrescriptions =>
localizedValues['myPrescriptions'][locale.languageCode];
String get medicationRefill =>
@ -901,6 +908,10 @@ class TranslationBase {
String get iAm => localizedValues['i-am'][locale.languageCode];
String get yearOld => localizedValues['years-old'][locale.languageCode];
String get categorise => localizedValues['categorise'][locale.languageCode];
String get refine => localizedValues['refine'][locale.languageCode];
String get apply => localizedValues['apply'][locale.languageCode];
String get reset => localizedValues['reset'][locale.languageCode];
String get viewCategorise => localizedValues['viewCategorise'][locale.languageCode];
String get cart => localizedValues['cart'][locale.languageCode];
String get wishList => localizedValues['wishList'][locale.languageCode];
String get Alhabibapp => localizedValues['Alhabibapp'][locale.languageCode];
@ -1377,9 +1388,14 @@ class TranslationBase {
String get quantitySize =>
localizedValues['quantitySize'][locale.languageCode];
String get addToCart => localizedValues['addToCart'][locale.languageCode];
String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode];
String get buyNow => localizedValues['buyNow'][locale.languageCode];
String get quantityShortcut =>
localizedValues['quantityShortcut'][locale.languageCode];
String get noData =>
localizedValues['noData'][locale.languageCode];
String get no_data =>
localizedValues['no_data'][locale.languageCode];
String get year => localizedValues['Year'][locale.languageCode];
String get month => localizedValues['Month'][locale.languageCode];

Loading…
Cancel
Save