From 7ab5c896f0754cd8b0cfd84a9795de68092806ef Mon Sep 17 00:00:00 2001 From: bestonemitRam Date: Tue, 18 Mar 2025 18:48:07 +0530 Subject: [PATCH] fixed category issue --- .DS_Store | Bin 10244 -> 8196 bytes .dart_tool/package_config.json | 342 ++++----- .dart_tool/package_config_subset | 666 +++++++++--------- .dart_tool/version | 2 +- .flutter-plugins | 102 +-- .flutter-plugins-dependencies | 2 +- .../logic/provider/addTocart_provider.dart | 1 + lib/src/ui/coupons/coupons_screen.dart | 3 +- .../fruitvegidetail/fruit_veggie_detail.dart | 179 +++-- lib/utils/extensions/uicontext.dart | 3 +- pubspec.lock | 24 +- 11 files changed, 679 insertions(+), 645 deletions(-) diff --git a/.DS_Store b/.DS_Store index a73a8bf30f61ac2a8d6cafbd2e1d749af657ca8d..cd2f32f9fcbec2060249580bdb38bf5f7aab73a0 100644 GIT binary patch literal 8196 zcmeHMyKdA#6upDjWO+!T+yV)AY0!%O0!*}s3MnE1rGmuSkgV8^qkRxc)4?B5Qc!>* zrJn%28n#gfsF=Xm(AY#<6^di(>Oq)LVM+|4!+{6V z9X2#J(N>3((BUKuvoIBkQ0#~clskz~TQ@odoC0M9WbJ;D+SH>>8u9vlu+v%Hiii6$ zq;Y(@Tjw{7yWMCIN5Gpet}cE1Jo|L3-naM1zWcj5zyIb74v9NOn|7#A6P_DA@P2WO z=d=}Xlp~yXd?8y4CXSzV8RdNBt!Tah7$ZyZ z%Qxi%$%6(!IN$Uz(>g=*b1b74-{P6%^VL!Jpz$+{lh&mC4CTBZX6xyCvpjO{Y7dK_ z%=`|q(zZ$(d+%Q={tV^(_r7kVYs@F+k@Hu3Sp0qn0$lGCtnqQ-dZ$L4W1KrWIeC&@ z?X#3X4!~>AGrg79xj{JR(T|KXL-TVjqZXfjnOOi|U)^D1Y}r?|SULc2 z!GrU^TYQ-6UGmEF@LRJ~nSz&{&v%fyHYW;r`aD~*{=Z%S{eMo>aHr`Mm`?>nqr2K& z#<`o?x}<`vwFC4Gbl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|=DgV~)p { // ) ], ), - body: Row( - children: [filterCategory(), productWidget()], + body: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [filterCategory(), productWidget()], + ), ), ); } @@ -130,7 +133,7 @@ class _FruitVeggieDetailState extends State { child: DataNotFound( imagePath: 'assets/images/cart.jpg', message: "Product not abailable ", - width: 200.w, + width: 220.w, height: 250.h, ), ), @@ -225,7 +228,7 @@ class _FruitVeggieDetailState extends State { children: [ AppNetworkImage( height: 70, - width: 70, + width: 150, imageUrl: product .productImages!.first.url ?? "https://5.imimg.com/data5/SELLER/Default/2024/2/385126988/OL/DA/VW/8627346/1l-fortune-sunflower-oil.jpg", @@ -319,12 +322,16 @@ class _FruitVeggieDetailState extends State { Text( product.name ?? " ", textAlign: TextAlign.left, - maxLines: 3, + maxLines: 2, overflow: TextOverflow.ellipsis, - style: context.customMedium( - APPCOLOR.balck1A1A1A, 14), + style: context + .customMedium( + APPCOLOR.balck1A1A1A, + 15, + ) + .copyWith(fontWeight: FontWeight.bold), ), - const SizedBox(height: 5), + const SizedBox(height: 2), Text( product.unit ?? " ", textAlign: TextAlign.left, @@ -332,10 +339,10 @@ class _FruitVeggieDetailState extends State { overflow: TextOverflow.ellipsis, style: context.customMedium( Colors.grey.withOpacity(0.8), - 12, + 13, ), ), - const SizedBox(height: 3), + const SizedBox(height: 1), Spacer(), Row( children: [ @@ -349,7 +356,7 @@ class _FruitVeggieDetailState extends State { maxLines: 1, overflow: TextOverflow.ellipsis, style: context.customSemiBold( - Colors.black, 12), + Colors.black, 16), ), const SizedBox(width: 5), Text( @@ -360,7 +367,7 @@ class _FruitVeggieDetailState extends State { style: context .customMedium( Colors.grey.withOpacity(0.8), - 12, + 16, ) .copyWith( decoration: @@ -388,7 +395,7 @@ class _FruitVeggieDetailState extends State { child: Container( height: MediaQuery.of(context).size.height * - 0.035, + 0.038, width: MediaQuery.of(context).size.width * 0.1, @@ -583,84 +590,108 @@ class _FruitVeggieDetailState extends State { ), ); } else { - // Add "All" category at the beginning final categories = [Datum(id: "all", name: "ALL")]; categories.addAll(provider.categoryList.cast()); return Container( decoration: const BoxDecoration(color: Colors.white), - width: 100, + width: 70, child: ListView.builder( itemCount: categories.length, scrollDirection: Axis.vertical, itemBuilder: (context, index) { var category = categories[index]; - return InkWell( - onTap: () { - provider.iscroll = true; - provider.products.clear(); - provider.isLoadingg = false; - provider.hasMore = true; - provider.page = 1; - provider.notifyListeners(); + return Padding( + padding: const EdgeInsets.only(bottom: 8), + child: InkWell( + onTap: () { + provider.iscroll = true; + provider.products.clear(); + provider.isLoadingg = false; + provider.hasMore = true; + provider.page = 1; + provider.notifyListeners(); - if (category.id == "all") { - provider.gettAllProduct(context, "", true, ''); - } else { - // Load filtered products - provider.gettAllProduct( - context, "/category/${category.id}", true, ''); - } + if (category.id == "all") { + provider.gettAllProduct(context, "", true, ''); + } else { + // Load filtered products + provider.gettAllProduct( + context, "/category/${category.id}", true, ''); + } - activeIndexProvider.setActiveIndex(index); - }, - child: SizedBox( - height: 150, - child: Column( - children: [ - Row( - children: [ - Expanded( - child: Center( - child: Container( - decoration: BoxDecoration( - color: - activeIndexProvider.activeIndex == index - ? Colors.greenAccent.withOpacity(0.1) - : APPCOLOR.bgGrey, - borderRadius: BorderRadius.circular(5), + activeIndexProvider.setActiveIndex(index); + }, + child: Container( + decoration: BoxDecoration( + color: activeIndexProvider.activeIndex == index + ? Colors.greenAccent.withOpacity(0.3) + : APPCOLOR.bgGrey, + borderRadius: BorderRadius.circular(5)), + child: Padding( + padding: const EdgeInsets.only(top: 10, bottom: 10), + child: SizedBox( + // height: 80, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + children: [ + Center( + child: Container( + // decoration: BoxDecoration( + // color: activeIndexProvider.activeIndex == + // index + // ? Colors.greenAccent.withOpacity(0.1) + // : APPCOLOR.bgGrey, + // borderRadius: BorderRadius.circular(5), + // ), + child: AppNetworkImage( + height: 30, + width: 50, + imageUrl: category.image ?? + 'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png', + backGroundColor: APPCOLOR.bgGrey, + radius: 10, + ), + ), ), - child: AppNetworkImage( - height: 80, - width: 80, - imageUrl: category.image ?? - 'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png', - backGroundColor: APPCOLOR.bgGrey, - radius: 10, + SizedBox( + height: 5, ), - ), + Container( + width: 50, + child: Text( + category.name, + textAlign: TextAlign.center, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: + activeIndexProvider.activeIndex == index + ? context.customExtraBold( + APPCOLOR.balck1A1A1A, 9) + : context.customMedium( + APPCOLOR.balck1A1A1A, 10), + ), + ), + ], ), - ), - Container( - width: 3, - height: 100, - color: activeIndexProvider.activeIndex == index - ? APPCOLOR.lightGreen - : Colors.transparent, - ), - ], + SizedBox( + width: 5, + ), + Container( + width: 2, + // height: 60, + color: activeIndexProvider.activeIndex == index + ? APPCOLOR.lightGreen + : Colors.transparent, + ), + ], + ), ), - Text( - category.name, - textAlign: TextAlign.center, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: activeIndexProvider.activeIndex == index - ? context.customExtraBold(APPCOLOR.balck1A1A1A, 14) - : context.customMedium(APPCOLOR.balck1A1A1A, 14), - ), - ], + ), ), ), ); diff --git a/lib/utils/extensions/uicontext.dart b/lib/utils/extensions/uicontext.dart index 8fc01e7..c67742b 100644 --- a/lib/utils/extensions/uicontext.dart +++ b/lib/utils/extensions/uicontext.dart @@ -15,7 +15,8 @@ extension CustomUITheme on BuildContext { return TextStyle(fontWeight: FontWeight.w400, color: color, fontSize: fontSize, fontFamily: 'Nunito'); } - TextStyle customMedium(Color color, double fontSize) { + TextStyle customMedium(Color color, double fontSize) + { return TextStyle(fontWeight: FontWeight.w500, color: color, fontSize: fontSize, fontFamily: 'Nunito'); } diff --git a/pubspec.lock b/pubspec.lock index 7e67761..8f08b68 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -724,18 +724,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.4" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.3" leak_tracker_testing: dependency: transitive description: @@ -780,10 +780,10 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.8.0" material_design_icons_flutter: dependency: "direct main" description: @@ -796,10 +796,10 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.12.0" mime: dependency: transitive description: @@ -1153,10 +1153,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.0" typed_data: dependency: transitive description: @@ -1273,10 +1273,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.2.1" web: dependency: transitive description: