From a35e14908883ee3eadfb2faa983d01c532479742 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 10 Nov 2021 15:19:19 +0200 Subject: [PATCH] product pagination --- .../service/pharmacy_categorise_service.dart | 10 +- .../pharmacy_categorise_view_model.dart | 77 +- lib/pages/parent_categorise_page.dart | 1945 ++++++++++------- .../screens/cart-page/cart-order-page.dart | 2 +- pubspec.yaml | 3 + 5 files changed, 1253 insertions(+), 784 deletions(-) diff --git a/lib/core/service/pharmacy_categorise_service.dart b/lib/core/service/pharmacy_categorise_service.dart index 023d0859..3cc45680 100644 --- a/lib/core/service/pharmacy_categorise_service.dart +++ b/lib/core/service/pharmacy_categorise_service.dart @@ -143,11 +143,14 @@ class PharmacyCategoriseService extends BaseService { ); } - Future getParentProducts({String id}) async { + Future getParentProducts( + {String id, int pageNumber, bool isLoading = false}) async { hasError = false; - _parentProductsList.clear(); + if (isLoading == false) { + _parentProductsList.clear(); + } String endPoint = id != null - ? GET_PARENT_PRODUCTS + "$id" + '&page=1&limit=50' + ? GET_PARENT_PRODUCTS + "$id" + '&page=' + '$pageNumber' + '&limit=24' : GET_PARENT_PRODUCTS + ""; await baseAppClient.getPharmacy( endPoint, @@ -155,6 +158,7 @@ class PharmacyCategoriseService extends BaseService { response['products'].forEach((item) { _parentProductsList.add(PharmacyProduct.fromJson(item)); }); + //pageNumber++; }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/pharmacy_categorise_view_model.dart b/lib/core/viewModels/pharmacy_categorise_view_model.dart index 153ec12e..7fb68431 100644 --- a/lib/core/viewModels/pharmacy_categorise_view_model.dart +++ b/lib/core/viewModels/pharmacy_categorise_view_model.dart @@ -10,20 +10,36 @@ import 'base_view_model.dart'; class PharmacyCategoriseViewModel extends BaseViewModel { bool hasError = false; - PharmacyCategoriseService _pharmacyCategoriseService = locator(); - List get categorise => _pharmacyCategoriseService.categoriseList; + int firstSubsetIndex = 0; + int inPatientPageSize = 20; + int lastSubsetIndex = 20; - List get categoriseParent => _pharmacyCategoriseService.parentCategoriseList; + List filteredInPatientItems = List(); + List filteredMyInPatientItems = List(); - List get parentProducts => _pharmacyCategoriseService.parentProductsList; + PharmacyCategoriseService _pharmacyCategoriseService = + locator(); - List get subCategorise => _pharmacyCategoriseService.subCategoriseList; + List get categorise => + _pharmacyCategoriseService.categoriseList; - List get subProducts => _pharmacyCategoriseService.subProductsList; + List get categoriseParent => + _pharmacyCategoriseService.parentCategoriseList; - List get finalProducts => _pharmacyCategoriseService.finalProducts; - List get brandsList => _pharmacyCategoriseService.brandsList; + List get parentProducts => + _pharmacyCategoriseService.parentProductsList; + + List get subCategorise => + _pharmacyCategoriseService.subCategoriseList; + + List get subProducts => + _pharmacyCategoriseService.subProductsList; + + List get finalProducts => + _pharmacyCategoriseService.finalProducts; + List get brandsList => + _pharmacyCategoriseService.brandsList; List get searchList => _pharmacyCategoriseService.searchList; @@ -81,7 +97,7 @@ class PharmacyCategoriseViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getCategoriseParent({String i}) async { + Future getCategoriseParent({String i, int pageIndex, bool isLoading}) async { hasError = false; // _insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); @@ -90,15 +106,16 @@ class PharmacyCategoriseViewModel extends BaseViewModel { error = _pharmacyCategoriseService.error; setState(ViewState.ErrorLocal); } else - await getParentProducts(i: i); - await getBrands(id: i); + await getBrands(id: i); + await getParentProducts(i: i, pageIndex: pageIndex, isLoading: isLoading); } - Future getParentProducts({String i}) async { + Future getParentProducts({String i, int pageIndex, bool isLoading}) async { hasError = false; // _insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _pharmacyCategoriseService.getParentProducts(id: i); + setState(ViewState.BusyLocal); + await _pharmacyCategoriseService.getParentProducts( + id: i, pageNumber: pageIndex, isLoading: isLoading); if (_pharmacyCategoriseService.hasError) { error = _pharmacyCategoriseService.error; setState(ViewState.ErrorLocal); @@ -142,11 +159,13 @@ class PharmacyCategoriseViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getFilteredProducts({String categoryId, String brandId, String min, String max}) async { + Future getFilteredProducts( + {String categoryId, String brandId, String min, String max}) async { hasError = false; // _insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _pharmacyCategoriseService.getFilteredProducts(categoryId: categoryId, brandId: brandId, max: max, min: min); + await _pharmacyCategoriseService.getFilteredProducts( + categoryId: categoryId, brandId: brandId, max: max, min: min); if (_pharmacyCategoriseService.hasError) { error = _pharmacyCategoriseService.error; setState(ViewState.ErrorLocal); @@ -154,7 +173,8 @@ class PharmacyCategoriseViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getFilteredSubProducts({String categoryId, String brandId, String min, String max}) async { + Future getFilteredSubProducts( + {String categoryId, String brandId, String min, String max}) async { hasError = false; // _insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); @@ -221,4 +241,27 @@ class PharmacyCategoriseViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + addOnFilteredList() { + if (lastSubsetIndex < parentProducts.length) { + firstSubsetIndex = firstSubsetIndex + + (parentProducts.length - lastSubsetIndex < inPatientPageSize - 1 + ? parentProducts.length - lastSubsetIndex + : inPatientPageSize - 1); + lastSubsetIndex = lastSubsetIndex + + (parentProducts.length - lastSubsetIndex < inPatientPageSize - 1 + ? parentProducts.length - lastSubsetIndex + : inPatientPageSize - 1); + filteredInPatientItems + .addAll(parentProducts.sublist(firstSubsetIndex, lastSubsetIndex)); + setState(ViewState.Idle); + } + } + + removeOnFilteredList() { + if (lastSubsetIndex - inPatientPageSize - 1 > 0) { + filteredInPatientItems.removeAt(lastSubsetIndex - inPatientPageSize - 1); + setState(ViewState.Idle); + } + } } diff --git a/lib/pages/parent_categorise_page.dart b/lib/pages/parent_categorise_page.dart index d8c2279c..6a59b122 100644 --- a/lib/pages/parent_categorise_page.dart +++ b/lib/pages/parent_categorise_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; @@ -22,6 +23,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:rating_bar/rating_bar.dart'; import 'base/base_view.dart'; @@ -30,12 +32,14 @@ class ParentCategorisePage extends StatefulWidget { String id; String titleName; - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); ParentCategorisePage({this.id, this.titleName}); @override - _ParentCategorisePageState createState() => _ParentCategorisePageState(id: id, titleName: titleName); + _ParentCategorisePageState createState() => + _ParentCategorisePageState(id: id, titleName: titleName); } class _ParentCategorisePageState extends State { @@ -49,7 +53,6 @@ class _ParentCategorisePageState extends State { this.productID, }); - Map values = {'huusam': false, 'ali': false, 'noor': false}; bool checkedBrands = false; bool checkedCategorise = false; String categoriseName = "Personal Care"; @@ -61,83 +64,111 @@ class _ParentCategorisePageState extends State { size: 29.0, ); + int pageIndex = 1; + List entityList = List(); List entityListBrands = List(); + RefreshController controller = RefreshController(); + @override Widget build(BuildContext context) { TextEditingController minField = TextEditingController(); TextEditingController maxField = TextEditingController(); ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getCategoriseParent(i: id), + onModelReady: (model) => model.getCategoriseParent( + i: id, pageIndex: pageIndex, isLoading: false), allowAny: true, - builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold( - isPharmacy: true, - appBarTitle: titleName, - isBottomBar: true, - isShowAppBar: true, - backgroundColor: Colors.white, - isShowDecPage: false, - baseViewModel: model, - body: SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Image.network( - id == '1' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' - : id == '2' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' - : id == '3' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' - : id == '4' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' - : id == '5' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' - : id == '6' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' - : id == '7' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' - : id == '8' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' - : id == '9' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' - : id == '10' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' - : '', - fit: BoxFit.fill, - height: 160.0, - width: double.infinity), - ), - if (model.categoriseParent.length > 8) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.all(10.0), - child: InkWell( - child: Container( - child: Texts( - TranslationBase.of(context).viewCategorise, + builder: + (BuildContext context, PharmacyCategoriseViewModel model, + Widget child) => + AppScaffold( + isPharmacy: true, + appBarTitle: titleName, + isBottomBar: true, + isShowAppBar: true, + backgroundColor: Colors.white, + isShowDecPage: false, + baseViewModel: model, + body: SmartRefresher( + enablePullDown: false, + controller: controller, + enablePullUp: true, + onLoading: () async { + setState(() { + ++pageIndex; + }); + await model.getParentProducts( + pageIndex: pageIndex, i: id, isLoading: true); + if (model.state != ViewState.BusyLocal && + pageIndex < 5) { + controller.loadComplete(); + } else { + controller.loadFailed(); + } + }, + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Image.network( + id == '1' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' + : id == '2' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' + : id == '3' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' + : id == '4' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' + : id == '5' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' + : id == '6' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' + : id == '7' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' + : id == '8' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' + : id == '9' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' + : id == '10' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' + : '', + fit: BoxFit.fill, + height: 160.0, + width: double.infinity), + ), + if (model.categoriseParent.length > 8) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: InkWell( + child: Container( + child: Texts( + TranslationBase.of(context) + .viewCategorise, // 'View All Categories', - fontWeight: FontWeight.w300, - ), - ), - onTap: () { - Navigator.push( - context, - FadePage( - page: SubCategoriseModalsheet( + fontWeight: FontWeight.w300, + ), + ), + onTap: () { + Navigator.push( + context, + FadePage( + page: + SubCategoriseModalsheet( // id: model.categorise[0].id, // titleName: model.categorise[0].name, - )), - ); + )), + ); // showModalBottomSheet( // isScrollControlled: true, // context: context, @@ -188,759 +219,1145 @@ class _ParentCategorisePageState extends State { // ); // }, // ); - }, - ), + }, + ), + ), + Icon(Icons.arrow_forward) + ], + ), + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + ], ), - Icon(Icons.arrow_forward) - ], - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - ], - ), //Expanded widget heree if nassery - Padding( - padding: EdgeInsets.only(top: 35.0), - child: Container( - height: MediaQuery.of(context).size.height * 0.2, - child: Center( - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: model.categoriseParent.length > 8 ? 8 : model.categoriseParent.length, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - child: InkWell( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 13.0), - child: Container( - height: 60.0, - width: 65.0, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.orange.shade200.withOpacity(0.45), - ), - child: Center( - child: Icon( - Icons.apps_sharp, - size: 32.0, - ), + Padding( + padding: EdgeInsets.only(top: 35.0), + child: Container( + height: + MediaQuery.of(context).size.height * 0.2, + child: Center( + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: + model.categoriseParent.length > 8 + ? 8 + : model.categoriseParent.length, + itemBuilder: + (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric( + horizontal: 8.0), + child: InkWell( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Padding( + padding: + EdgeInsets.symmetric( + horizontal: 13.0), + child: Container( + height: 60.0, + width: 65.0, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors + .orange.shade200 + .withOpacity(0.45), + ), + child: Center( + child: Icon( + Icons.apps_sharp, + size: 32.0, + ), + ), + ), + ), + Container( + width: + MediaQuery.of(context) + .size + .width * + 0.197, + // height: MediaQuery.of(context) + // .size + // .height * + // 0.08, + child: Center( + child: Texts( + projectViewModel + .isArabic + ? model + .categoriseParent[ + index] + .namen + : model + .categoriseParent[ + index] + .name, + fontSize: 13.4, + fontWeight: + FontWeight.w600, + maxLines: 3, + ), + ), + ), + ], ), + onTap: () { + Navigator.push( + context, + FadePage( + page: SubCategorisePage( + title: model + .categoriseParent[index] + .name, + id: model + .categoriseParent[index] + .id, + parentId: id, + )), + ); + print(id); + }, ), + ); + }), + ), + ), + ), + + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + InkWell( + child: Row( + children: [ + Icon( + Icons.wrap_text, ), - Container( - width: MediaQuery.of(context).size.width * 0.197, - // height: MediaQuery.of(context) - // .size - // .height * - // 0.08, - child: Center( - child: Texts( - projectViewModel.isArabic ? model.categoriseParent[index].namen : model.categoriseParent[index].name, - fontSize: 13.4, - fontWeight: FontWeight.w600, - maxLines: 3, - ), - ), + SizedBox( + width: 10.0, + ), + Texts( + 'Refine', + fontWeight: FontWeight.w600, ), ], ), onTap: () { - Navigator.push( - context, - FadePage( - page: SubCategorisePage( - title: model.categoriseParent[index].name, - id: model.categoriseParent[index].id, - parentId: id, - )), - ); - print(id); - }, - ), - ); - }), - ), - ), - ), - - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - child: Row( - children: [ - Icon( - Icons.wrap_text, - ), - SizedBox( - width: 10.0, - ), - Texts( - 'Refine', - fontWeight: FontWeight.w600, - ), - ], - ), - onTap: () { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext context) { - return DraggableScrollableSheet( - initialChildSize: 0.95, - maxChildSize: 0.95, - minChildSize: 0.9, - builder: (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - controller: scrollController, - child: Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 1.95, - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - Icon( - Icons.wrap_text, - ), - SizedBox( - width: 10.0, - ), - Texts( - TranslationBase.of(context).refine, + showModalBottomSheet( + isScrollControlled: true, + context: context, + builder: (BuildContext context) { + return DraggableScrollableSheet( + initialChildSize: 0.95, + maxChildSize: 0.95, + minChildSize: 0.9, + builder: (BuildContext context, + ScrollController + scrollController) { + return SingleChildScrollView( + controller: + scrollController, + child: Container( + color: Colors.white, + height: + MediaQuery.of(context) + .size + .height * + 1.95, + child: Column( + children: [ + Padding( + padding: + EdgeInsets.all( + 8.0), + child: Row( + children: [ + Icon( + Icons + .wrap_text, + ), + SizedBox( + width: 10.0, + ), + Texts( + TranslationBase.of( + context) + .refine, // 'Refine', - fontWeight: FontWeight.w600, - ), - SizedBox( - width: 250.0, - ), - InkWell( - child: Texts( + fontWeight: + FontWeight + .w600, + ), + SizedBox( + width: 250.0, + ), + InkWell( + child: Texts( // 'Close', - TranslationBase.of(context).closeIt, - color: Colors.red, - fontWeight: FontWeight.w600, - fontSize: 15.0, + TranslationBase.of( + context) + .closeIt, + color: Colors + .red, + fontWeight: + FontWeight + .w600, + fontSize: + 15.0, + ), + onTap: () { + Navigator.pop( + context); + }, + ), + ], + ), ), - onTap: () { - Navigator.pop(context); - }, - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - Column( - children: [ - ExpansionTile( - title: Texts(TranslationBase.of(context).categorise), - children: [ - ProcedureListWidget( - model: model, - masterList: model.categoriseParent, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => isEntityListSelected(master), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - ExpansionTile( - title: Texts(TranslationBase.of(context).brands), - children: [ - ProcedureListWidget( - model: model, - masterList: model.brandsList, - removeHistory: (item) { - setState(() { - entityListBrands.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityListBrands.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => isEntityListSelectedBrands(master), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors.black12, - ), - ExpansionTile( - title: Texts(TranslationBase.of(context).price), - children: [ - Container( - color: Color(0xffEEEEEE), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, + Divider( + thickness: 1.0, + color: + Colors.black12, + ), + Column( + children: [ + ExpansionTile( + title: Texts( + TranslationBase.of( + context) + .categorise), + children: [ + ProcedureListWidget( + model: + model, + masterList: + model + .categoriseParent, + removeHistory: + (item) { + setState( + () { + entityList + .remove(item); + }); + }, + addHistory: + (history) { + setState( + () { + entityList + .add(history); + }); + }, + addSelectedHistories: + () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: + (master) => + isEntityListSelected(master), + ) + ], + ), + Divider( + thickness: 1.0, + color: Colors + .black12, + ), + ExpansionTile( + title: Texts( + TranslationBase.of( + context) + .brands), + children: [ + ProcedureListWidget( + model: + model, + masterList: + model + .brandsList, + removeHistory: + (item) { + setState( + () { + entityListBrands + .remove(item); + }); + }, + addHistory: + (history) { + setState( + () { + entityListBrands + .add(history); + }); + }, + addSelectedHistories: + () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: + (master) => + isEntityListSelectedBrands(master), + ) + ], + ), + Divider( + thickness: 1.0, + color: Colors + .black12, + ), + ExpansionTile( + title: Texts( + TranslationBase.of( + context) + .price), + children: [ + Container( + color: Color( + 0xffEEEEEE), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceAround, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Texts('Min'), + Container( + color: Colors.white, + width: 200, + height: 40, + child: TextFormField( + decoration: InputDecoration( + border: OutlineInputBorder(), + ), + controller: minField, + ), + ), + ], + ), + Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Texts('Max'), + Container( + color: Colors.white, + width: 200, + height: 40, + child: TextFormField( + decoration: InputDecoration( + border: OutlineInputBorder(), + ), + controller: maxField, + ), + ), + ], + ), + ], + ), + ) + ], + ), + Divider( + thickness: 1.0, + color: Colors + .black12, + ), + SizedBox( + height: MediaQuery.of( + context) + .size + .height * + 0.4, + ), + Padding( + padding: + EdgeInsets + .all( + 8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, children: [ - Texts('Min'), Container( - color: Colors.white, - width: 200, - height: 40, - child: TextFormField( - decoration: InputDecoration( - border: OutlineInputBorder(), - ), - controller: minField, + width: + 100, + child: + Button( + label: TranslationBase.of(context) + .reset, + backgroundColor: + Colors.red, ), ), - ], - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Texts('Max'), + SizedBox( + width: 30, + ), Container( - color: Colors.white, - width: 200, - height: 40, - child: TextFormField( - decoration: InputDecoration( - border: OutlineInputBorder(), - ), - controller: maxField, + width: + 200, + child: + Button( + onTap: + () async { + String + categoriesId = + ""; + for (CategoriseParentModel category + in entityList) { + if (categoriesId == + "") { + categoriesId = category.id; + } else { + categoriesId = "$categoriesId,${category.id}"; + } + } + String + brandIds = + ""; + for (CategoriseParentModel brand + in entityListBrands) { + if (brandIds == + "") { + brandIds = brand.id; + } else { + brandIds = "$brandIds,${brand.id}"; + } + } + + GifLoaderDialogUtils.showMyDialog( + context); + + await model.getFilteredProducts( + min: minField.text.toString(), + max: maxField.text.toString(), + categoryId: categoriesId, + brandId: brandIds); + GifLoaderDialogUtils.hideDialog( + context); + + Navigator.pop( + context); + }, + label: TranslationBase.of(context) + .apply, + backgroundColor: + Colors.green, ), ), ], ), - ], - ), - ) + ), + ], + ), ], ), - Divider( - thickness: 1.0, - color: Colors.black12, + ), + ); + }); + }, + ); + }, + ), + Row( + children: [ + Container( + height: 44.0, + child: VerticalDivider( + color: Colors.black45, + thickness: 1.0, +//width: 0.3, +// indent: 0.0, + ), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: InkWell( + child: styleIcon, + onTap: () { + setState(() { + if (styleOne == true) { + styleOne = false; + styleTwo = true; + styleIcon = Icon( + Icons.auto_awesome_mosaic, + color: CustomColors.green, + size: 29.0, + ); + } else { + styleOne = true; + styleTwo = false; + styleIcon = Icon( + Icons.widgets_sharp, + color: CustomColors.green, + size: 29.0, + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + model.parentProducts.isNotEmpty + ? styleOne == true + ? Container( + height: model.parentProducts.length * + MediaQuery.of(context) + .size + .height * + 0.15, + child: GridView.builder( + physics: + NeverScrollableScrollPhysics(), + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 0.5, + mainAxisSpacing: 2.0, + childAspectRatio: 0.9, + ), + itemCount: + model.parentProducts.length, + itemBuilder: (BuildContext context, + int index) { + return NetworkBaseView( + baseViewModel: model, + child: InkWell( + child: Card( + color: model + .parentProducts[ + index] + .discountName != + null + ? Color(0xffFFFF00) + : Colors.white, + elevation: 0, + shape: Border( + right: BorderSide( + color: Colors + .grey.shade300, + width: 1, + ), + left: BorderSide( + color: Colors + .grey.shade300, + width: 1, + ), + bottom: BorderSide( + color: Colors + .grey.shade300, + width: 1, + ), + top: BorderSide( + color: Colors + .grey.shade300, + width: 1, + ), ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.4, + margin: + EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, ), - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + child: Container( + decoration: + BoxDecoration( + borderRadius: + BorderRadius.only( + topLeft: + Radius.circular( + 110.0), + ), + color: Colors.white, + ), + padding: EdgeInsets + .symmetric( + horizontal: 0), + width: MediaQuery.of( + context) + .size + .width / + 3, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, children: [ - Container( - width: 100, - child: Button( - label: TranslationBase.of(context).reset, - backgroundColor: Colors.red, - ), - ), - SizedBox( - width: 30, + Stack( + children: [ + if (model + .parentProducts[ + index] + .discountName != + null) + RotatedBox( + quarterTurns: + 4, + child: + Container( + decoration: + BoxDecoration(), + child: + Padding( + padding: + EdgeInsets.only( + right: + 5.0, + top: + 20.0, + bottom: + 5.0, + ), + child: + Texts( + 'offer' + .toUpperCase(), + color: + Colors.red, + fontSize: + 13.0, + fontWeight: + FontWeight.w900, + ), + ), + transform: + new Matrix4.rotationZ( + 5.837200), + ), + ), + Container( + margin: EdgeInsets + .fromLTRB( + 0, + 16, + 0, + 0), + alignment: + Alignment + .center, + child: Image + .network( + model + .parentProducts[ + index] + .images + .isNotEmpty + ? model + .parentProducts[index] + .images[0] + .thumb + : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', + fit: BoxFit + .cover, + height: 80, + ), + ), + Container( + width: model.parentProducts[index].rxMessage != + null + ? MediaQuery.of(context) + .size + .width / + 5 + : 0, + padding: + EdgeInsets + .all( + 4), + decoration: + BoxDecoration( + color: Color( + 0xffb23838), + borderRadius: + BorderRadius.only( + topLeft: + Radius.circular(6)), + ), + child: Texts( + model.parentProducts[index].rxMessage != + null + ? model + .parentProducts[index] + .rxMessage + : "", + color: Colors + .white, + regular: + true, + fontSize: + 10, + fontWeight: + FontWeight + .w400, + ), + ), + ], ), Container( - width: 200, - child: Button( - onTap: () async { - String categoriesId = ""; - for (CategoriseParentModel category in entityList) { - if (categoriesId == "") { - categoriesId = category.id; - } else { - categoriesId = "$categoriesId,${category.id}"; - } - } - String brandIds = ""; - for (CategoriseParentModel brand in entityListBrands) { - if (brandIds == "") { - brandIds = brand.id; - } else { - brandIds = "$brandIds,${brand.id}"; - } - } - - GifLoaderDialogUtils.showMyDialog(context); - - await model.getFilteredProducts( - min: minField.text.toString(), max: maxField.text.toString(), categoryId: categoriesId, brandId: brandIds); - GifLoaderDialogUtils.hideDialog(context); - - Navigator.pop(context); - }, - label: TranslationBase.of(context).apply, - backgroundColor: Colors.green, + margin: EdgeInsets + .symmetric( + horizontal: 6, + vertical: 0, + ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + if (model + .parentProducts[ + index] + .discountName != + null) + Container( + width: double + .infinity, + height: + 13.0, + decoration: + BoxDecoration( + color: Color( + 0xff5AB145), + ), + child: + Center( + child: + Texts( + model + .parentProducts[index] + .discountName, + regular: + true, + color: + Colors.white, + fontSize: + 10.4, + ), + ), + ), + Texts( + projectViewModel + .isArabic + ? model + .parentProducts[ + index] + .namen + : model + .parentProducts[index] + .name, + regular: + true, + fontSize: + 12, + fontWeight: + FontWeight + .w700, + ), + Padding( + padding: const EdgeInsets + .only( + top: 4, + bottom: + 4), + child: + Texts( + "SAR ${model.parentProducts[index].price}", + bold: + true, + fontSize: + 14, + ), + ), + Row( + children: [ +// StarRating( +// totalAverage: model.parentProducts[index].approvedRatingSum > 0 +// ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() +// : 0, +// forceStars: true), + RatingBar + .readOnly( + initialRating: model + .parentProducts[index] + .approvedRatingSum + .toDouble(), + size: + 15.0, + filledColor: + Colors.yellow[700], + emptyColor: + Colors.grey[500], + isHalfAllowed: + true, + halfFilledIcon: + Icons.star_half, + filledIcon: + Icons.star, + emptyIcon: + Icons.star, + ), + Texts( + "(${model.parentProducts[index].approvedTotalReviews})", + regular: + true, + fontSize: + 10, + fontWeight: + FontWeight.w400, + ) + ], + ), + ], ), ), ], ), ), - ], - ), - ], - ), - ), - ); - }); - }, - ); - }, - ), - Row( - children: [ - Container( - height: 44.0, - child: VerticalDivider( - color: Colors.black45, - thickness: 1.0, -//width: 0.3, -// indent: 0.0, - ), - ), - Padding( - padding: EdgeInsets.all(8.0), - child: InkWell( - child: styleIcon, - onTap: () { - setState(() { - if (styleOne == true) { - styleOne = false; - styleTwo = true; - styleIcon = Icon( - Icons.auto_awesome_mosaic, - color: CustomColors.green, - size: 29.0, - ); - } else { - styleOne = true; - styleTwo = false; - styleIcon = Icon( - Icons.widgets_sharp, - color: CustomColors.green, - size: 29.0, - ); - } - }); - }, - ), - ), - ], - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - model.parentProducts.isNotEmpty - ? styleOne == true - ? Container( - height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.15, - child: GridView.builder( - physics: NeverScrollableScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 2.0, - childAspectRatio: 0.9, - ), - itemCount: model.parentProducts.length, - itemBuilder: (BuildContext context, int index) { - return NetworkBaseView( - baseViewModel: model, - child: InkWell( - child: Card( - color: model.parentProducts[index].discountName != null ? Color(0xffFFFF00) : Colors.white, - elevation: 0, - shape: Border( - right: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - left: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - bottom: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - top: BorderSide( - color: Colors.grey.shade300, - width: 1, - ), - ), - margin: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(110.0), - ), - color: Colors.white, - ), - padding: EdgeInsets.symmetric(horizontal: 0), - width: MediaQuery.of(context).size.width / 3, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( + ), + onTap: () => { + Navigator.push( + context, + FadePage( + page: ProductDetailPage( + model.parentProducts[ + index]), + )), + }, + )); + }, + ), + ) + : Container( + height: model.parentProducts.length * + MediaQuery.of(context) + .size + .height * + 0.122, + child: ListView.builder( + physics: + NeverScrollableScrollPhysics(), + itemCount: + model.parentProducts.length, + itemBuilder: + (BuildContext context, + int index) { + return InkWell( + child: Card( + child: Row( children: [ - if (model.parentProducts[index].discountName != null) - RotatedBox( - quarterTurns: 4, - child: Container( - decoration: BoxDecoration(), - child: Padding( - padding: EdgeInsets.only( - right: 5.0, - top: 20.0, - bottom: 5.0, + Stack( + children: [ + Column( + children: [ + Container( + decoration: + BoxDecoration(), + child: + Padding( + padding: + EdgeInsets + .only( + left: 9.0, + top: 8.0, + right: + 10.0, + ), + ), ), - child: Texts( - 'offer'.toUpperCase(), - color: Colors.red, - fontSize: 13.0, - fontWeight: FontWeight.w900, + Container( + margin: EdgeInsets + .fromLTRB( + 0, + 0, + 0, + 0), + alignment: + Alignment + .center, + child: model + .parentProducts[ + index] + .images + .isNotEmpty + ? Image + .network( + model + .parentProducts[index] + .images[0] + .thumb, + fit: BoxFit + .contain, + height: + 70, + ) + : Text(TranslationBase.of( + context) + .noImage), ), - ), - transform: new Matrix4.rotationZ(5.837200), + ], ), - ), - Container( - margin: EdgeInsets.fromLTRB(0, 16, 0, 0), - alignment: Alignment.center, - child: Image.network( - model.parentProducts[index].images.isNotEmpty - ? model.parentProducts[index].images[0].thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.cover, - height: 80, - ), + Column( + children: [ + Container( + width: model.parentProducts[index].rxMessage != + null + ? MediaQuery.of(context) + .size + .width / + 5.3 + : 0, + padding: + EdgeInsets + .all( + 4), + decoration: + BoxDecoration( + color: Color( + 0xffb23838), + borderRadius: + BorderRadius.only( + topLeft: + Radius.circular(6)), + ), + child: Texts( + model.parentProducts[index].rxMessage != + null + ? model + .parentProducts[index] + .rxMessage + : "", + color: Colors + .white, + regular: + true, + fontSize: + 10, + fontWeight: + FontWeight + .w400, + ), + ), + ], + ), + ], ), Container( - width: model.parentProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 5 : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), - ), - child: Texts( - model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: FontWeight.w400, + margin: EdgeInsets + .symmetric( + horizontal: 0, + vertical: 0, ), - ), - ], - ), - Container( - margin: EdgeInsets.symmetric( - horizontal: 6, - vertical: 0, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (model.parentProducts[index].discountName != null) - Container( - width: double.infinity, - height: 13.0, - decoration: BoxDecoration( - color: Color(0xff5AB145), + child: Column( + mainAxisAlignment: + MainAxisAlignment + .spaceAround, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + SizedBox( + height: 4.0, ), - child: Center( + Container( + width: MediaQuery.of( + context) + .size + .width * + 0.635, child: Texts( - model.parentProducts[index].discountName, + projectViewModel + .isArabic + ? model + .parentProducts[ + index] + .namen + : model + .parentProducts[ + index] + .name, regular: true, - color: Colors.white, - fontSize: 10.4, + fontSize: + 13.2, + fontWeight: + FontWeight + .w500, + maxLines: 5, ), ), - ), - Texts( - projectViewModel.isArabic ? model.parentProducts[index].namen : model.parentProducts[index].name, - regular: true, - fontSize: 12, - fontWeight: FontWeight.w700, - ), - Padding( - padding: const EdgeInsets.only(top: 4, bottom: 4), - child: Texts( - "SAR ${model.parentProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ -// StarRating( -// totalAverage: model.parentProducts[index].approvedRatingSum > 0 -// ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() -// : 0, -// forceStars: true), - RatingBar.readOnly( - initialRating: model.parentProducts[index].approvedRatingSum.toDouble(), - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, + SizedBox( + height: 8.0, ), - Texts( - "(${model.parentProducts[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: FontWeight.w400, - ) - ], - ), - ], - ), - ), - ], - ), - ), - ), - onTap: () => { - Navigator.push( - context, - FadePage( - page: ProductDetailPage(model.parentProducts[index]), - )), - }, - )); - }, - ), - ) - : Container( - height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.122, - child: ListView.builder( - physics: NeverScrollableScrollPhysics(), - itemCount: model.parentProducts.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - child: Card( - child: Row( - children: [ - Stack( - children: [ - Column( - children: [ - Container( - decoration: BoxDecoration(), - child: Padding( - padding: EdgeInsets.only( - left: 9.0, - top: 8.0, - right: 10.0, - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - alignment: Alignment.center, - child: model.parentProducts[index].images.isNotEmpty - ? Image.network( - model.parentProducts[index].images[0].thumb, - fit: BoxFit.contain, - height: 70, - ) - : Text(TranslationBase.of(context).noImage), - ), - ], - ), - Column( - children: [ - Container( - width: model.parentProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 5.3 : 0, - padding: EdgeInsets.all(4), - decoration: BoxDecoration( - color: Color(0xffb23838), - borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), - ), - child: Texts( - model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "", - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: FontWeight.w400, - ), - ), - ], - ), - ], - ), - Container( - margin: EdgeInsets.symmetric( - horizontal: 0, - vertical: 0, - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 4.0, - ), - Container( - width: MediaQuery.of(context).size.width * 0.635, - child: Texts( - projectViewModel.isArabic ? model.parentProducts[index].namen : model.parentProducts[index].name, - regular: true, - fontSize: 13.2, - fontWeight: FontWeight.w500, - maxLines: 5, - ), - ), - SizedBox( - height: 8.0, - ), - Padding( - padding: const EdgeInsets.only(top: 4, bottom: 4), - child: Texts( - "SAR ${model.parentProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ + Padding( + padding: + const EdgeInsets + .only( + top: 4, + bottom: + 4), + child: Texts( + "SAR ${model.parentProducts[index].price}", + bold: true, + fontSize: 14, + ), + ), + Row( + children: [ // StarRating( // totalAverage: model.parentProducts[index].approvedRatingSum > 0 // ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() // : 0, // forceStars: true), - RatingBar.readOnly( - initialRating: model.parentProducts[index].approvedRatingSum.toDouble(), - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, + RatingBar + .readOnly( + initialRating: model + .parentProducts[ + index] + .approvedRatingSum + .toDouble(), + size: 15.0, + filledColor: + Colors.yellow[ + 700], + emptyColor: + Colors.grey[ + 500], + isHalfAllowed: + true, + halfFilledIcon: + Icons + .star_half, + filledIcon: + Icons + .star, + emptyIcon: + Icons + .star, + ), + Texts( + "(${model.parentProducts[index].approvedTotalReviews})", + regular: + true, + fontSize: + 10, + fontWeight: + FontWeight + .w400, + ) + ], + ), + ], ), - Texts( - "(${model.parentProducts[index].approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: FontWeight.w400, - ) - ], - ), - ], + ), + widget.authenticatedUserObject + .isLogin + ? Container( + child: + IconButton( + icon: + Icon( + Icons + .shopping_cart, + size: + 18, + color: + CustomColors.green, + ), + onPressed: + () async { + if (model.parentProducts[index].rxMessage == + null) { + GifLoaderDialogUtils.showMyDialog(context); + await addToCartFunction(1, + model.parentProducts[index].id); + GifLoaderDialogUtils.hideDialog(context); + Navigator.push(context, + FadePage(page: CartOrderPage())); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); + } + }), + ) + : Container(), + ], + ), ), + onTap: () => { + Navigator.push( + context, + FadePage( + page: ProductDetailPage( + model.parentProducts[ + index]), + )), + }, + ); + }), + ) + : Padding( + padding: const EdgeInsets.all(12.0), + child: Container( + child: Center( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Padding( + padding: + const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/new-design/empty_box.png', + width: 100, + height: 100, + fit: BoxFit.cover, ), - widget.authenticatedUserObject.isLogin - ? Container( - child: IconButton( - icon: Icon( - Icons.shopping_cart, - size: 18, - color: CustomColors.green, - ), - onPressed: () async { - if (model.parentProducts[index].rxMessage == null) { - GifLoaderDialogUtils.showMyDialog(context); - await addToCartFunction(1, model.parentProducts[index].id); - GifLoaderDialogUtils.hideDialog(context); - Navigator.push(context, FadePage(page: CartOrderPage())); - } else { - AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); - } - }), - ) - : Container(), - ], - ), + ), + Padding( + padding: + const EdgeInsets.all(8.0), + child: Text( + 'There is no data', + style: + TextStyle(fontSize: 30), + ), + ) + ], ), - onTap: () => { - Navigator.push( - context, - FadePage( - page: ProductDetailPage(model.parentProducts[index]), - )), - }, - ); - }), - ) - : Padding( - padding: const EdgeInsets.all(12.0), - child: Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - 'assets/images/new-design/empty_box.png', - width: 100, - height: 100, - fit: BoxFit.cover, ), ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - 'There is no data', - style: TextStyle(fontSize: 30), - ), - ) - ], - ), - ), - ), - ) - ], - ), - ), - ), - )); + ) + ], + ), + ), + ), + ))); } addToCartFunction(quantity, itemID) async { @@ -949,7 +1366,8 @@ class _ParentCategorisePageState extends State { } bool isEntityListSelected(CategoriseParentModel masterKey) { - Iterable history = entityList.where((element) => masterKey.id == element.id); + Iterable history = + entityList.where((element) => masterKey.id == element.id); if (history.length > 0) { return true; } @@ -957,7 +1375,8 @@ class _ParentCategorisePageState extends State { } bool isEntityListSelectedBrands(CategoriseParentModel masterKey) { - Iterable history = entityListBrands.where((element) => masterKey.id == element.id); + Iterable history = + entityListBrands.where((element) => masterKey.id == element.id); if (history.length > 0) { return true; } diff --git a/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart index a2f3ba6c..b246e7d9 100644 --- a/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart @@ -56,7 +56,7 @@ class _CartOrderPageState extends State { showHomeAppBarIcon: false, isShowDecPage: false, isMainPharmacyPages: true, - //isBottomBar: true, + isBottomBar: true, showPharmacyCart: true, baseViewModel: model, backgroundColor: Colors.white, diff --git a/pubspec.yaml b/pubspec.yaml index da332f80..57c417a8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,6 +42,9 @@ dependencies: # Flutter Html View flutter_html: ^1.2.0 + # Pagnation + pull_to_refresh: ^1.6.2 + # Native flutter_device_type: ^0.2.0 local_auth: ^0.6.2+3