diff --git a/lib/config/config.dart b/lib/config/config.dart index 5aa86526..955ba36b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -383,7 +383,7 @@ const GET_TOP_BRANDS = "topmanufacturer?page=1&limit=8"; const GET_PRODUCT_DETAIL = "products/"; const GET_LOCATION = "Services/Patients.svc/REST/GetPharmcyListBySKU"; const GET_SPECIFICATION = "productspecification/"; -const GET_BRAND_ITEMS = "products?ManufacturerId="; +const GET_BRAND_ITEMS = "products"; // External API const ADD_ADDRESS_INFO = "addcustomeraddress"; @@ -400,7 +400,8 @@ const GET_PARENT_PRODUCTS = 'products?categoryid='; const GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; const GET_SUB_PRODUCTS = 'products?categoryid='; const GET_FINAL_PRODUCTS = - 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId=';const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; + 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; +const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; const GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cabb9977..4b4ef89b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -590,6 +590,7 @@ const Map localizedValues = { "checkBeneficiary": {"en": "CHECK BENEFICIARY", "ar": "تحقق من المستفيد"}, "beneficiaryName": {"en": "Beneficiary Name", "ar": "اسم المستفيد"}, "accountActivation": {"en": "Account Activation", "ar": "تفعيل الحساب"}, + "lakumTransfer": {"en": "Lakum Transfer", "ar": "تفعيل الحساب"}, "acceptLbl": {"en": "Accept", "ar": "موافقة"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, @@ -1333,6 +1334,11 @@ const Map localizedValues = { "en": "UPDATE THE APP", "ar": "تحديث التطبيق" }, + "enterIdentificationNumber": {"en" : "Enter Identification Number", "ar": "أدخل رقم التعريف"}, + "accountActivationDesc": {"en" : "This service allows you to activate your LAKUM account after registering through the Vida system.", "ar": "تتيح لك هذه الخدمة تفعيل حساب LAKUM الخاص بك بعد التسجيل من خلال نظام Vida."}, + "pointsToTransfer": {"en" : "Point's to Transfer :", "ar": "النقاط المراد تحويلها:"}, + "enterBeneficiaryAccountNo": {"en" : "Enter Beneficiary Account No.", "ar": "أدخل رقم حساب المستفيد"}, + // "visit": {"en" : "Visit", "ar": "الزيارة"}, "confirm-prescription": { "en": "Are you sure !! you want to send this request", "ar": "تاكيد ارسال الطلب؟" diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 5f953f4f..8584e970 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -281,10 +281,10 @@ class BaseAppClient { final response = await http.get(url.trim(), headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', - 'Authorization': token, - 'Mobilenumber':getPhoneNumberWithoutZero(user['MobileNumber'].toString()), + 'Authorization': token??'', + 'Mobilenumber': user != null ? getPhoneNumberWithoutZero(user['MobileNumber'].toString()): "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', - 'Username': user['PatientID'].toString(), + 'Username': user != null ? user['PatientID'].toString() : "", }); final int statusCode = response.statusCode; print("statusCode :$statusCode"); diff --git a/lib/core/service/pharmacy_categorise_service.dart b/lib/core/service/pharmacy_categorise_service.dart index 0082cc49..d7dc0429 100644 --- a/lib/core/service/pharmacy_categorise_service.dart +++ b/lib/core/service/pharmacy_categorise_service.dart @@ -49,6 +49,8 @@ class PharmacyCategoriseService extends BaseService { List _scanList = List(); List get scanList => _scanList; + List manufacturerProducts = List(); + clearSearchList() { _searchList.clear(); } @@ -222,4 +224,23 @@ class PharmacyCategoriseService extends BaseService { }, ); } + + Future getManufacturerProducts(String id) async { + hasError = false; + Map queryParams = {'ManufacturerId': id}; + + manufacturerProducts.clear(); + await baseAppClient.getPharmacy( + GET_BRAND_ITEMS, + onSuccess: (dynamic response, int statusCode) { + response['products'].forEach((item) { + manufacturerProducts.add(FinalProductsModel.fromJson(item)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, queryParams: queryParams, + ); + } } diff --git a/lib/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart b/lib/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart index f8f5ea05..f2ed5913 100644 --- a/lib/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart +++ b/lib/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart @@ -19,11 +19,13 @@ class LacumRegistrationViewModel extends LacumViewModel { error = _lacumService.error; setState(ViewState.Error); } else { - if(_lacumService.lacumInformation.yahalaAccountNo != 0){ - error = "The account has already been activated"; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); + if(_lacumService.lacumInformation != null){ + if(_lacumService.lacumInformation.yahalaAccountNo == 0){ + error = _lacumService.lacumInformation.errorEndUserMessage; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } } } } diff --git a/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart b/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart index ba8d70d9..1ee1a41c 100644 --- a/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart +++ b/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart @@ -19,6 +19,9 @@ class LacumViewModel extends BaseViewModel { LacumAccountInformation get lacumGroupInformation => _lacumService.lacumGroupInformation; + String get successMsg => + _lacumService.successMsg; + Future getLacumData() async { await getLacumAccountData(); getLacumGroupData(); @@ -70,16 +73,14 @@ class LacumViewModel extends BaseViewModel { } } - Future createLakumAccount(String name, String phone) async { - setState(ViewState.Busy); + Future createLakumAccount(String name, String phone) async { + setState(ViewState.BusyLocal); await _lacumService.createLakumAccount(name, phone, lacumInformation.yahalaAccountNo, lacumInformation.identificationNo, null); if (_lacumService.hasError) { error = _lacumService.error; - setState(ViewState.Error); - return 404; + setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); - return 200; } } diff --git a/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart index e3a6255e..339afa95 100644 --- a/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart @@ -11,17 +11,14 @@ import '../../../locator.dart'; class ProductDetailViewModel extends BaseViewModel{ ProductDetailService _productDetailService = locator(); - ProductDetailService _productLocationService = locator(); - ProductDetailService _productWishlistService = locator(); - ProductDetailService _productSpecification = locator(); List get productDetailService => _productDetailService.productDetailList; - List get productLocationService => _productLocationService.productLocationList; + List get productLocationService => _productDetailService.productLocationList; - List get wishListItems => _productWishlistService.wishListProducts; + List get wishListItems => _productDetailService.wishListProducts; - List get productSpecification => _productSpecification.productSpecification; + List get productSpecification => _productDetailService.productSpecification; bool hasError = false; @@ -42,9 +39,9 @@ class ProductDetailViewModel extends BaseViewModel{ print('ENAD in model view'); hasError = false; setState(ViewState.Busy); - await _productLocationService.getProductAvailabiltyDetail(); - if (_productLocationService.hasError) { - error = _productLocationService.error; + await _productDetailService.getProductAvailabiltyDetail(); + if (_productDetailService.hasError) { + error = _productDetailService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -53,9 +50,9 @@ class ProductDetailViewModel extends BaseViewModel{ Future notifyMe(customerId, itemID) async { hasError = false; setState(ViewState.Busy); - await _productLocationService.notifyMe(customerId, itemID); - if (_productLocationService.hasError) { - error = _productLocationService.error; + await _productDetailService.notifyMe(customerId, itemID); + if (_productDetailService.hasError) { + error = _productDetailService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -64,9 +61,9 @@ class ProductDetailViewModel extends BaseViewModel{ Future addToCartData(quantity, itemID) async { hasError = false; setState(ViewState.Busy); - await _productLocationService.addToCart(quantity, itemID); - if (_productLocationService.hasError) { - error = _productLocationService.error; + await _productDetailService.addToCart(quantity, itemID); + if (_productDetailService.hasError) { + error = _productDetailService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -75,9 +72,9 @@ class ProductDetailViewModel extends BaseViewModel{ Future addToWishlistData(itemID) async { hasError = false; setState(ViewState.Busy); - await _productLocationService.addToWishlist(itemID); - if (_productLocationService.hasError) { - error = _productLocationService.error; + await _productDetailService.addToWishlist(itemID); + if (_productDetailService.hasError) { + error = _productDetailService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -86,9 +83,9 @@ class ProductDetailViewModel extends BaseViewModel{ Future checkWishlistData() async { hasError = false; setState(ViewState.Busy); - await _productWishlistService.getWishlistItems(); - if (_productWishlistService.hasError) { - error = _productWishlistService.error; + await _productDetailService.getWishlistItems(); + if (_productDetailService.hasError) { + error = _productDetailService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -98,9 +95,9 @@ class ProductDetailViewModel extends BaseViewModel{ Future deletWishlistData(itemID) async { hasError = false; setState(ViewState.Busy); - await _productWishlistService.delteItemFromWishlist(itemID); - if (_productWishlistService.hasError) { - error = _productWishlistService.error; + await _productDetailService.delteItemFromWishlist(itemID); + if (_productDetailService.hasError) { + error = _productDetailService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -110,9 +107,9 @@ class ProductDetailViewModel extends BaseViewModel{ Future productSpecificationData(itemID) async { hasError = false; setState(ViewState.Busy); - await _productWishlistService.productSpecificationData(itemID); - if (_productWishlistService.hasError) { - error = _productWishlistService.error; + await _productDetailService.productSpecificationData(itemID); + if (_productDetailService.hasError) { + error = _productDetailService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModels/pharmacy_categorise_view_model.dart b/lib/core/viewModels/pharmacy_categorise_view_model.dart index d26d860d..6d036777 100644 --- a/lib/core/viewModels/pharmacy_categorise_view_model.dart +++ b/lib/core/viewModels/pharmacy_categorise_view_model.dart @@ -147,4 +147,15 @@ class PharmacyCategoriseViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getManufacturerProducts(String id) async { + setState(ViewState.Busy); + await _pharmacyCategoriseService.getManufacturerProducts(id); + if (_pharmacyCategoriseService.hasError) { + error = _pharmacyCategoriseService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/pages/final_products_page.dart b/lib/pages/final_products_page.dart index 03adee97..5e71f745 100644 --- a/lib/pages/final_products_page.dart +++ b/lib/pages/final_products_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; @@ -8,15 +9,20 @@ import 'package:flutter/material.dart'; import 'base/base_view.dart'; class FinalProductsPage extends StatefulWidget { - String id; - FinalProductsPage({this.id}); + final String id; + final int productType; + + FinalProductsPage({this.id, this.productType = 1}); + @override _FinalProductsPageState createState() => _FinalProductsPageState(id: id); } class _FinalProductsPageState extends State { String id; + _FinalProductsPageState({this.id}); + String categoriseName = "Personal Care"; bool styleOne = true; bool styleTwo = false; @@ -25,14 +31,17 @@ class _FinalProductsPageState extends State { color: Colors.blue, size: 29.0, ); + @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getFinalProducts(i: id), + onModelReady: (model) => widget.productType == 1 + ? model.getFinalProducts(i: id) + : model.getManufacturerProducts(id), builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => PharmacyAppScaffold( - appBarTitle: 'Products', + appBarTitle: "Products", isBottomBar: false, isShowAppBar: true, backgroundColor: Colors.white, diff --git a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart index fc1270c0..9e281694 100644 --- a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart +++ b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart @@ -20,8 +20,9 @@ class LakumActivationVidaPage extends StatelessWidget { return BaseView( builder: (_, model, wi) => AppScaffold( - title: "Acount Activation", + appBarTitle: TranslationBase.of(context).accountActivation, isShowAppBar: true, + isPharmacy: true, isShowDecPage: false, backgroundColor: Colors.white, baseViewModel: model, @@ -35,7 +36,7 @@ class LakumActivationVidaPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Texts( - " This service allows you to activate your LAKUM account after registering through the Vida system. ", + TranslationBase.of(context).accountActivationDesc, fontSize: 14, ), Padding( @@ -43,8 +44,10 @@ class LakumActivationVidaPage extends StatelessWidget { child: TextField( controller: _identificationNumberController, decoration: new InputDecoration( - hintText: 'Enter Identification Number', + hintText: TranslationBase.of(context) + .enterIdentificationNumber, ), + keyboardType: TextInputType.number, style: TextStyle( fontSize: 16, color: Colors.grey.shade700, @@ -89,7 +92,7 @@ class LakumActivationVidaPage extends StatelessWidget { } }); } - : null, + : () {}, ), ), ], diff --git a/lib/pages/pharmacies/screens/lacum-setting-page.dart b/lib/pages/pharmacies/screens/lacum-setting-page.dart index 861279f3..4f7f5fd6 100644 --- a/lib/pages/pharmacies/screens/lacum-setting-page.dart +++ b/lib/pages/pharmacies/screens/lacum-setting-page.dart @@ -1,7 +1,10 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lacum-banner-widget.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -44,6 +47,7 @@ class _LakumSettingPageState extends State { appBarTitle: "${TranslationBase.of(context).lakum}", isShowAppBar: true, isShowDecPage: false, + isPharmacy: true, backgroundColor: Colors.white, baseViewModel: model, body: Container( @@ -220,13 +224,18 @@ class _LakumSettingPageState extends State { hPadding: 8, vPadding: 12, handler: canUpdate - ? () { - model.createLakumAccount(_nameController.text, _phoneController.text).then((status) => { - if (status == 200) {Navigator.pop(context, "")} - // back to previous page - }); + ? () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.createLakumAccount(_nameController.text, _phoneController.text); + GifLoaderDialogUtils.hideDialog(context); + if(model.state == ViewState.Idle){ + AppToast.showSuccessToast(message: model.successMsg); + Navigator.pop(context, ""); + } else if(model.state == ViewState.ErrorLocal){ + AppToast.showErrorToast(message: model.error); + } } - : null, + : (){}, ), ) ], diff --git a/lib/pages/pharmacies/screens/lacum-transfer-page.dart b/lib/pages/pharmacies/screens/lacum-transfer-page.dart index 9103b646..f05c6da4 100644 --- a/lib/pages/pharmacies/screens/lacum-transfer-page.dart +++ b/lib/pages/pharmacies/screens/lacum-transfer-page.dart @@ -37,8 +37,9 @@ class _LacumTransferPageState extends State { onModelReady: (model) => model.setLakumData( widget.lacumInformation, widget.lacumGroupInformation), builder: (_, model, wi) => AppScaffold( - appBarTitle: "${TranslationBase.of(context).lakum}", + appBarTitle: "${TranslationBase.of(context).lakumTransfer}", isShowAppBar: true, + isPharmacy: true, isShowDecPage: false, backgroundColor: Colors.white, baseViewModel: model, @@ -83,7 +84,7 @@ class _LacumTransferPageState extends State { children: [ Container( child: Texts( - "Point Balance", + "${TranslationBase.of(context).point} ${TranslationBase.of(context).balance}", fontSize: 14, fontWeight: FontWeight.bold, color: Colors.white, @@ -143,7 +144,7 @@ class _LacumTransferPageState extends State { children: [ Container( child: Texts( - "Riyal Balance", + "${TranslationBase.of(context).riyal} ${TranslationBase.of(context).balance}", fontSize: 14, fontWeight: FontWeight.bold, color: Colors.white, @@ -182,7 +183,7 @@ class _LacumTransferPageState extends State { child: TextField( controller: _beneficieryAccountController, decoration: new InputDecoration( - hintText: 'Enter Beneficiary Account No.', + hintText: TranslationBase.of(context).enterBeneficiaryAccountNo, ), style: TextStyle( fontSize: 16, @@ -209,7 +210,7 @@ class _LacumTransferPageState extends State { _beneficieryAccountController .text); } - : null, + : (){}, ), ), (model.lacumReceiverInformation != null && @@ -250,7 +251,7 @@ class _LacumTransferPageState extends State { width: double.infinity, ), Texts( - "Point's to Transfer :", + TranslationBase.of(context).pointsToTransfer, color: Colors.black, ), Padding( @@ -284,7 +285,7 @@ class _LacumTransferPageState extends State { Container( margin: EdgeInsets.all(8), child: BorderedButton( - "LACUM TRANSFER", + TranslationBase.of(context).lakumTransfer, backgroundColor: Color(0xff339933), textColor: Colors.white, fontSize: 18, diff --git a/lib/pages/pharmacies/screens/lakum-main-page.dart b/lib/pages/pharmacies/screens/lakum-main-page.dart index adbb07c2..fdf3cc78 100644 --- a/lib/pages/pharmacies/screens/lakum-main-page.dart +++ b/lib/pages/pharmacies/screens/lakum-main-page.dart @@ -22,7 +22,7 @@ class LakumMainPage extends StatelessWidget { return BaseView( onModelReady: (model) => model.getLacumData(), builder: (_, model, wi) => AppScaffold( - title: "Lakum", + appBarTitle: TranslationBase.of(context).lakum, isShowAppBar: true, isPharmacy: true, isShowDecPage: false, @@ -346,7 +346,7 @@ class LakumHomeButtons extends StatelessWidget { child: Container( padding: EdgeInsets.symmetric(horizontal: 16), child: Texts( - "Account Activation", + TranslationBase.of(context).accountActivation, fontSize: 14, fontWeight: FontWeight.bold, ), @@ -394,7 +394,7 @@ class LakumHomeButtons extends StatelessWidget { child: Container( padding: EdgeInsets.symmetric(horizontal: 16), child: Texts( - "Lakum Transfer", + TranslationBase.of(context).lakumTransfer, fontSize: 14, fontWeight: FontWeight.bold, ), diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index b41c1804..d4e5eb72 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -285,7 +285,7 @@ class PharmacyPage extends StatelessWidget { ), Container( - margin: EdgeInsets.fromLTRB(10, 0, 10, 0), + margin: EdgeInsets.fromLTRB(10, 10, 10, 0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/pharmacies/widgets/manufacturerItem.dart b/lib/pages/pharmacies/widgets/manufacturerItem.dart index 7ffa3d89..3ccf2313 100644 --- a/lib/pages/pharmacies/widgets/manufacturerItem.dart +++ b/lib/pages/pharmacies/widgets/manufacturerItem.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; import 'package:flutter/material.dart'; +import '../../final_products_page.dart'; + class ManufacturerItem extends StatelessWidget { final Manufacturer item; @@ -8,25 +10,37 @@ class ManufacturerItem extends StatelessWidget { @override Widget build(BuildContext context) { - return Card( - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), - margin: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - decoration: BoxDecoration( - border: Border( - right: BorderSide(color: Colors.grey.shade300, width: 1), - bottom: BorderSide(color: Colors.grey.shade300, width: 1), - left: BorderSide(color: Colors.grey.shade300, width: 1), - top: BorderSide(color: Colors.grey.shade300, width: 1)), + return InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FinalProductsPage( + id: item.id, productType: 2, + ), + ), + ); + }, + child: Card( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, ), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 8), - child: Image.network( - item.image.src, - fit: BoxFit.cover, + child: Container( + decoration: BoxDecoration( + border: Border( + right: BorderSide(color: Colors.grey.shade300, width: 1), + bottom: BorderSide(color: Colors.grey.shade300, width: 1), + left: BorderSide(color: Colors.grey.shade300, width: 1), + top: BorderSide(color: Colors.grey.shade300, width: 1)), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: Image.network( + item.image.src, + fit: BoxFit.cover, + ), ), ), ), diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index fb1e1c2a..2eb6b32f 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -47,8 +47,6 @@ class _ProfilePageState extends State { String lastName, mobileNo, identificationNo; int languageId; - _ProfilePageState({this.customerId}); - getLanguageID() async { languageID = await sharedPref.getString(APP_LANGUAGE); } @@ -94,7 +92,10 @@ class _ProfilePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getOrder(customerId, page_id), + onModelReady: (model) async { + var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + model.getOrder(customerId, page_id); + }, builder: (_, model, wi) => AppScaffold( appBarTitle: TranslationBase.of(context).myAccount, isShowAppBar: false, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 6090a80e..c24ac57f 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -632,6 +632,7 @@ class TranslationBase { String get checkBeneficiary => localizedValues['checkBeneficiary'][locale.languageCode]; String get beneficiaryName => localizedValues['beneficiaryName'][locale.languageCode]; String get accountActivation => localizedValues['accountActivation'][locale.languageCode]; + String get lakumTransfer => localizedValues['lakumTransfer'][locale.languageCode]; String get acceptLbl => localizedValues['acceptLbl'][locale.languageCode]; String get termsService => localizedValues['TermsService'][locale.languageCode]; @@ -1107,6 +1108,10 @@ class TranslationBase { String get submitncontinue => localizedValues["submitncontinue"][locale.languageCode]; String get areyousure => localizedValues["areyousure"][locale.languageCode]; String get preferredunit => localizedValues["preferredunit"][locale.languageCode]; + String get enterIdentificationNumber => localizedValues["enterIdentificationNumber"][locale.languageCode]; + String get accountActivationDesc => localizedValues["accountActivationDesc"][locale.languageCode]; + String get pointsToTransfer => localizedValues["pointsToTransfer"][locale.languageCode]; + String get enterBeneficiaryAccountNo => localizedValues["enterBeneficiaryAccountNo"][locale.languageCode]; String get confirmPrescription => localizedValues["confirm-prescription"][locale.languageCode]; String get youAlreadyHaveOrder => localizedValues["you-already-have-order"][locale.languageCode]; String get orderOverview => localizedValues["order-overview"][locale.languageCode];