From cd7d33eacee9e720cc7e8a6e0d20b05ce984164a Mon Sep 17 00:00:00 2001 From: bestonemitRam Date: Mon, 24 Mar 2025 18:09:54 +0530 Subject: [PATCH] review issue fixed --- .DS_Store | Bin 10244 -> 10244 bytes .dart_tool/extension_discovery/README.md | 31 ++ .dart_tool/extension_discovery/vs_code.json | 1 + .dart_tool/package_config.json | 2 +- .flutter-plugins-dependencies | 2 +- lib/src/common_widget/network_image.dart | 32 +- lib/src/logic/provider/order_provider.dart | 20 +- lib/src/ui/bestdeal/bestdeal_screen.dart | 14 +- lib/src/ui/cart/cartview_screen.dart | 35 ++- lib/src/ui/favourite/favourite_screen.dart | 2 + .../fruitvegidetail/fruit_veggie_detail.dart | 249 +++++++++++---- lib/src/ui/home/home_screen.dart | 13 +- lib/src/ui/myOrder/OrderDetailsScreen.dart | 50 +-- lib/src/ui/product_review.dart | 63 +++- .../ui/productdetails/product_details.dart | 284 ++++++++++-------- lib/src/ui/profilepage/profile_screen.dart | 1 - 16 files changed, 517 insertions(+), 282 deletions(-) create mode 100644 .dart_tool/extension_discovery/README.md create mode 100644 .dart_tool/extension_discovery/vs_code.json diff --git a/.DS_Store b/.DS_Store index 6dbf4dbea096e05e464bdbfaaaa2a3c13f1b890e..475e57c3e4d13661d94c3e20f00ebd7637df7aeb 100644 GIT binary patch delta 59 zcmZn(XbISGM3Cu{>E>gCw-`B$P0e)_49yHSuMo~;Wac%VG+9J6gz>}XOwkqmDBRgh E0A0lsU;qFB delta 59 zcmZn(XbISGM3Cv6?B-*Fw-`B$EX;Kj3{A~9uMo~;WafDmG+9J6gmJ; { } Widget floatingAction() { - return Consumer(builder: (context, provider, child) - { + return Consumer(builder: (context, provider, child) { if (provider.countList.isEmpty) { return Center(); } else { @@ -354,6 +353,7 @@ class _BestDealScreenState extends State { .productImages?.first.url ?? "", backGroundColor: Colors.transparent, + radius: 10, ), ), Positioned( @@ -361,7 +361,7 @@ class _BestDealScreenState extends State { bottom: 0, child: Container( padding: EdgeInsets.symmetric( - horizontal: 6, vertical: 2), + horizontal: 10, vertical: 10), decoration: BoxDecoration( color: Colors.red, borderRadius: BorderRadius.circular(5), @@ -370,7 +370,7 @@ class _BestDealScreenState extends State { child: Text( "${calculateDiscountPercentage(double.parse(bestdealproduct.basePrice), double.parse(bestdealproduct.discountPrice))}% OFF", style: TextStyle( - color: Colors.white, fontSize: 12)), + color: Colors.white, fontSize: 15)), ), ), ) @@ -403,7 +403,7 @@ class _BestDealScreenState extends State { Spacer(), Row( children: [ - Row( + Column( children: [ Text( "₹${bestdealproduct.discountPrice ?? ""} ", @@ -411,7 +411,7 @@ class _BestDealScreenState extends State { maxLines: 1, overflow: TextOverflow.ellipsis, style: - context.customSemiBold(Colors.black, 12), + context.customSemiBold(Colors.black, 15), ), Text( "₹${bestdealproduct.basePrice ?? ""}", @@ -421,7 +421,7 @@ class _BestDealScreenState extends State { style: context .customMedium( Colors.grey.withOpacity(0.8), - 12, + 15, ) .copyWith( decoration: TextDecoration.lineThrough, diff --git a/lib/src/ui/cart/cartview_screen.dart b/lib/src/ui/cart/cartview_screen.dart index 024ff28..6df9e56 100644 --- a/lib/src/ui/cart/cartview_screen.dart +++ b/lib/src/ui/cart/cartview_screen.dart @@ -156,20 +156,21 @@ class _MycartState extends State { alignment: Alignment.center, children: [ AppNetworkImage( - height: MediaQuery.of(context).size.height * - 0.08, - width: cardWidth * 0.7, - imageUrl: bestdealproduct - .productImages?.first?.url ?? - "", - backGroundColor: Colors.transparent, - ), + height: + MediaQuery.of(context).size.height * + 0.08, + width: cardWidth * 0.7, + imageUrl: bestdealproduct + .productImages?.first?.url ?? + "", + backGroundColor: Colors.transparent, + radius: 10), Positioned( right: 1, bottom: 0, child: Container( padding: EdgeInsets.symmetric( - horizontal: 6, vertical: 2), + horizontal: 10, vertical: 10), decoration: BoxDecoration( color: Colors.red, borderRadius: BorderRadius.circular(5), @@ -179,7 +180,7 @@ class _MycartState extends State { "${calculateDiscountPercentage(double.parse(bestdealproduct!.basePrice), double.parse(bestdealproduct!.discountPrice))}% OFF", style: TextStyle( color: Colors.white, - fontSize: 12)), + fontSize: 15)), ), ), ) @@ -217,7 +218,7 @@ class _MycartState extends State { const Spacer(), Row( children: [ - Row( + Column( children: [ Text( "₹${bestdealproduct.discountPrice ?? ""} ", @@ -225,7 +226,7 @@ class _MycartState extends State { maxLines: 1, overflow: TextOverflow.ellipsis, style: context.customSemiBold( - Colors.black, 12), + Colors.black, 15), ), Text( "₹${bestdealproduct.basePrice ?? ""}", @@ -234,7 +235,7 @@ class _MycartState extends State { style: context .customMedium( Colors.grey.withOpacity(0.8), - 12, + 15, ) .copyWith( decoration: @@ -760,8 +761,7 @@ class _MycartState extends State { color: Colors.white, ), ); - } else if (provider.allitem == null) - { + } else if (provider.allitem == null) { return Center(child: Text('🛒 Your Front Shop Cart is empty')); } else if (provider.allitem.items == null || provider.allitem.items!.isEmpty) { @@ -791,8 +791,7 @@ class _MycartState extends State { size: 15, ), onTap: () { - if (provider.couponDataModel.data!.isNotEmpty) - { + if (provider.couponDataModel.data!.isNotEmpty) { context.push(MyRoutes.COUPONSSCREEN, extra: provider.allitem.id); } else { @@ -813,7 +812,7 @@ class _MycartState extends State { SummaryRow( label: 'Item Total Price', value: '₹${provider.totalPrice}'), SummaryRow(label: 'Discount Price', value: "${provider.discount}"), - SummaryRow(label: 'Delivery Free', value: 'Free', isGreen: true), + // SummaryRow(label: 'Delivery Free', value: 'Free', isGreen: true), Divider( thickness: 0.2, ), diff --git a/lib/src/ui/favourite/favourite_screen.dart b/lib/src/ui/favourite/favourite_screen.dart index f013ad9..c64737e 100644 --- a/lib/src/ui/favourite/favourite_screen.dart +++ b/lib/src/ui/favourite/favourite_screen.dart @@ -92,6 +92,7 @@ class _FavouriteScreenState extends State .productDatumlastImageurl ?? "https://5.imimg.com/data5/SELLER/Default/2024/2/385126988/OL/DA/VW/8627346/1l-fortune-sunflower-oil.jpg", backGroundColor: Colors.white, + ), ), ], @@ -215,6 +216,7 @@ class _FavouriteScreenState extends State backGroundColor: APPCOLOR.bgGrey, height: 20, width: 20, + radius: 10, ), ), ), diff --git a/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart b/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart index ccc0cd6..d6c47e7 100644 --- a/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart +++ b/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -224,13 +225,14 @@ class _FruitVeggieDetailState extends State { .productImages!.first.url ?? "https://5.imimg.com/data5/SELLER/Default/2024/2/385126988/OL/DA/VW/8627346/1l-fortune-sunflower-oil.jpg", backGroundColor: Colors.transparent, + radius: 10, ), Positioned( right: 1, bottom: 0, child: Container( padding: EdgeInsets.symmetric( - horizontal: 6, vertical: 2), + horizontal: 10, vertical: 10), decoration: BoxDecoration( color: Colors.red, borderRadius: @@ -241,7 +243,7 @@ class _FruitVeggieDetailState extends State { "${calculateDiscountPercentage(double.parse(product.basePrice), double.parse(product!.discountPrice))}% OFF", style: TextStyle( color: Colors.white, - fontSize: 12)), + fontSize: 15)), ), ), ) @@ -347,7 +349,7 @@ class _FruitVeggieDetailState extends State { maxLines: 1, overflow: TextOverflow.ellipsis, style: context.customSemiBold( - Colors.black, 16), + Colors.black, 15), ), const SizedBox(width: 5), Text( @@ -358,7 +360,7 @@ class _FruitVeggieDetailState extends State { style: context .customMedium( Colors.grey.withOpacity(0.8), - 16, + 15, ) .copyWith( decoration: @@ -529,65 +531,198 @@ class _FruitVeggieDetailState extends State { if (category.name == "ALL") ...{ if (provider.categoriesss.isNotEmpty) PopupMenuButton( - onSelected: (ProductCategoryModel value) { - activeIndexProvider.setActiveIndex(0); + onSelected: (ProductCategoryModel value) { + activeIndexProvider.setActiveIndex(0); - if (value.id == "all") { - provider.iscroll = true; - provider.products.clear(); - provider.isLoadingg = false; - provider.hasMore = true; - provider.page = 1; - provider.gettAllProduct( - context, "", true, ''); - provider.getAllcategory(context); - } else { - provider.categoryList.clear(); - provider.getSubcategory( - context, value.id); - } + if (value.id == "all") { + provider.iscroll = true; + provider.products.clear(); + provider.isLoadingg = false; + provider.hasMore = true; + provider.page = 1; + provider.gettAllProduct( + context, "", true, ''); + provider.getAllcategory(context); + } else { + provider.categoryList.clear(); + provider.getSubcategory( + context, value.id); + } + + provider.setSelectedCategory(value); + }, + itemBuilder: (BuildContext context) => + provider.categoriesss + .map( + (category) => PopupMenuItem( + value: category, + child: Text( + category.name ?? "Unknown"), + ), + ) + .toList(), + child: Center( + child: CachedNetworkImage( + + /// height: height, + ///width: width, + errorWidget: (context, url, error) { + return Container( + height: 50, + width: 50, + decoration: BoxDecoration( + color: APPCOLOR.bgGrey, + borderRadius: + BorderRadius.circular(10), + border: Border.all( + color: Colors.transparent, + width: 1, + )), + child: Center( + child: Image.asset( + APPASSETS.placeHolder, + height: 50 * 0.4, + color: APPCOLOR.bgGrey, + )), + ); + }, + placeholder: (context, url) { + return Container( + height: 50, + width: 50, + decoration: BoxDecoration( + color: APPCOLOR.bgGrey, + borderRadius: + BorderRadius.circular(10), + border: Border.all( + color: APPCOLOR.bgGrey, + width: 1, + )), + child: const Center( + child: + CupertinoActivityIndicator(), + ), + ); + }, + imageBuilder: (context, cIMage) { + return Container( + width: 60, + height: 70, + decoration: BoxDecoration( + color: APPCOLOR.bgGrey, + borderRadius: + BorderRadius.only( + topLeft: + Radius.circular(5!), + topRight: + Radius.circular(5!), + ), + border: Border.all( + color: APPCOLOR.bgGrey, + width: 1), + image: DecorationImage( + fit: BoxFit.fill, + image: cIMage, + )), + ); + }, + imageUrl: provider + .selectedCategory?.image ?? + 'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png'), + ) + + // Container( + // child: AppNetworkImage( + // height: 50, + // width: 60, + // imageUrl: provider + // .selectedCategory?.image ?? + // 'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png', + // backGroundColor: APPCOLOR.bgGrey, + // radius: 10, + // ), + // ), + // ), - provider.setSelectedCategory(value); - }, - itemBuilder: (BuildContext context) => - provider.categoriesss - .map( - (category) => PopupMenuItem( - value: category, - child: Text( - category.name ?? "Unknown"), - ), - ) - .toList(), - child: Center( - child: Container( - child: AppNetworkImage( - height: 50, - width: 60, - imageUrl: provider - .selectedCategory?.image ?? - 'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png', - backGroundColor: APPCOLOR.bgGrey, - radius: 10, - ), ), - ), - ), } else ...{ Column( children: [ - Center( - child: Container( - child: AppNetworkImage( - height: 50, - width: 50, - imageUrl: category.image ?? - 'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png', - backGroundColor: APPCOLOR.bgGrey, - radius: 10, - ), - ), - ), + // Center( + // child: Container( + // child: AppNetworkImage( + // height: 50, + // width: 50, + // imageUrl: category.image ?? + // 'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png', + // backGroundColor: APPCOLOR.bgGrey, + // radius: 10, + // ), + // ), + // ), + + CachedNetworkImage( + + /// height: height, + ///width: width, + errorWidget: (context, url, error) { + return Container( + // height: 50, + // width: 50, + decoration: BoxDecoration( + color: APPCOLOR.bgGrey, + borderRadius: + BorderRadius.circular(10), + border: Border.all( + color: Colors.transparent, + width: 1, + )), + child: Center( + child: Image.asset( + APPASSETS.placeHolder, + height: 50 * 0.4, + color: APPCOLOR.bgGrey, + )), + ); + }, + placeholder: (context, url) { + return Container( + height: 50, + width: 50, + decoration: BoxDecoration( + color: APPCOLOR.bgGrey, + borderRadius: + BorderRadius.circular(10), + border: Border.all( + color: APPCOLOR.bgGrey, + width: 1, + )), + child: const Center( + child: CupertinoActivityIndicator(), + ), + ); + }, + imageBuilder: (context, cIMage) { + return Container( + width: 60, + height: 70, + decoration: BoxDecoration( + color: APPCOLOR.bgGrey, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(5!), + topRight: Radius.circular(5!), + ), + border: Border.all( + color: APPCOLOR.bgGrey, + width: 1), + image: DecorationImage( + fit: BoxFit.fill, + image: cIMage, + )), + ); + }, + imageUrl: category.image), + SizedBox( height: 5, ), diff --git a/lib/src/ui/home/home_screen.dart b/lib/src/ui/home/home_screen.dart index cc29acb..6772c15 100644 --- a/lib/src/ui/home/home_screen.dart +++ b/lib/src/ui/home/home_screen.dart @@ -522,6 +522,7 @@ class _HomeScreenState extends State { ?.first ?.url ?? "", + radius: 10, backGroundColor: Colors.transparent, ), Positioned( @@ -529,7 +530,7 @@ class _HomeScreenState extends State { bottom: 0, child: Container( padding: EdgeInsets.symmetric( - horizontal: 6, vertical: 2), + horizontal: 10, vertical: 10), decoration: BoxDecoration( color: Colors.red, borderRadius: @@ -540,7 +541,9 @@ class _HomeScreenState extends State { "${calculateDiscountPercentage(double.parse(bestdealproduct.basePrice), double.parse(bestdealproduct.discountPrice))}% OFF", style: TextStyle( color: Colors.white, - fontSize: 12)), + fontWeight: + FontWeight.bold, + fontSize: 18)), ), ), ) @@ -579,7 +582,7 @@ class _HomeScreenState extends State { const Spacer(), Row( children: [ - Row( + Column( children: [ Text( "₹${bestdealproduct.discountPrice ?? ""} ", @@ -587,7 +590,7 @@ class _HomeScreenState extends State { maxLines: 1, overflow: TextOverflow.ellipsis, style: context.customSemiBold( - Colors.black, 11), + Colors.black, 15), ), Text( "₹${bestdealproduct.basePrice ?? ""}", @@ -598,7 +601,7 @@ class _HomeScreenState extends State { .customMedium( Colors.grey .withOpacity(0.8), - 12) + 15) .copyWith( decoration: TextDecoration .lineThrough), diff --git a/lib/src/ui/myOrder/OrderDetailsScreen.dart b/lib/src/ui/myOrder/OrderDetailsScreen.dart index aadee57..2404e6e 100644 --- a/lib/src/ui/myOrder/OrderDetailsScreen.dart +++ b/lib/src/ui/myOrder/OrderDetailsScreen.dart @@ -285,34 +285,34 @@ class _OrderDetailsScreenState extends State { ], ), ), - if (orderitem.orderItemStatus == "DELIVERED") - RichText( - text: TextSpan( - text: " ", - style: context.buttonTestStyle.copyWith( - color: context.appColor.blackColor, - ), - children: [ - TextSpan( - text: "Give Feedback", - style: context.buttonTestStyle.copyWith( - color: Colors.blue, - decoration: TextDecoration.underline, - ), - recognizer: TapGestureRecognizer()..onTap = () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - RatingScreen(orderId: orderitem.productId), - ), - ); - }, + RichText( + text: TextSpan( + text: " ", + style: context.buttonTestStyle.copyWith( + color: context.appColor.blackColor, ), - ], + children: [ + TextSpan( + text: "Give Feedback", + style: context.buttonTestStyle.copyWith( + color: Colors.blue, + decoration: TextDecoration.underline, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => RatingScreen( + orderId: orderitem.productId), + ), + ); + }, + ), + ], + ), ), - ), ], ), ), diff --git a/lib/src/ui/product_review.dart b/lib/src/ui/product_review.dart index bcce1a2..d9c5789 100644 --- a/lib/src/ui/product_review.dart +++ b/lib/src/ui/product_review.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; +import 'package:fluttertoast/fluttertoast.dart'; import 'package:grocery_app/src/logic/provider/order_provider.dart'; import 'package:grocery_app/utils/constants/color_constant.dart'; import 'package:grocery_app/utils/extensions/uicontext.dart'; @@ -96,23 +97,53 @@ class _RatingScreenState extends State { child: Center( child: InkWell( onTap: () async { - final ratingData = { - "rating": _rating, - "title": _titleController.text, - "description": _descriptionController.text, - "imageUrls": - _selectedImages.map((file) => file.path).toList(), - }; - var response = await provider.productReview( - context, ratingData, widget.orderId); - if (response) { - Navigator.pop(context); - } else { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text("failed to Give feedback"), - ), + if (_rating == 0.0) { + Fluttertoast.showToast( + msg: "Please Give a rating atleast 1 star", + toastLength: Toast.LENGTH_SHORT, + gravity: ToastGravity.BOTTOM, + backgroundColor: Colors.red, + textColor: Colors.white, + fontSize: 14.0, ); + } else if (_titleController.text.isEmpty) { + Fluttertoast.showToast( + msg: "Please review title", + toastLength: Toast.LENGTH_SHORT, + gravity: ToastGravity.BOTTOM, + backgroundColor: Colors.red, + textColor: Colors.white, + fontSize: 14.0, + ); + } else if (_descriptionController.text.isEmpty) { + Fluttertoast.showToast( + msg: "Please review description", + toastLength: Toast.LENGTH_SHORT, + gravity: ToastGravity.BOTTOM, + backgroundColor: Colors.red, + textColor: Colors.white, + fontSize: 14.0, + ); + } else { + final ratingData = { + "rating": _rating, + "title": _titleController.text, + "description": _descriptionController.text, + "imageUrls": _selectedImages + .map((file) => file.path) + .toList(), + }; + var response = await provider.productReview( + context, ratingData, widget.orderId); + if (response) { + Navigator.pop(context); + } else { + // ScaffoldMessenger.of(context).showSnackBar( + // SnackBar( + // content: Text("failed to Give feedback"), + // ), + // ); + } } // if (_formKey.currentState?.validate() ?? false) { diff --git a/lib/src/ui/productdetails/product_details.dart b/lib/src/ui/productdetails/product_details.dart index fdce20c..2bbdc2e 100644 --- a/lib/src/ui/productdetails/product_details.dart +++ b/lib/src/ui/productdetails/product_details.dart @@ -152,6 +152,7 @@ class _ProductDetailsState extends State { width: 2000, imageUrl: productImage.url, backGroundColor: Colors.transparent, + radius: 10, ); // Image.network(productImage.url ?? @@ -800,135 +801,136 @@ class _ProductDetailsState extends State { ], ), ) - : Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text("Reviews & Ratings", - style: TextStyle( - fontSize: 20, fontWeight: FontWeight.bold)), - SizedBox(height: 10), - Row( - children: [ - Text("4.2", - style: TextStyle( - fontSize: 30, fontWeight: FontWeight.bold)), - SizedBox( - width: 10, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RatingStars( - value: value, - onValueChanged: (v) { - // - }, - starBuilder: (index, color) => Icon( - Icons.star, - color: color, - ), - starCount: 5, - starSize: 20, - valueLabelColor: const Color(0xff9b9b9b), - valueLabelTextStyle: const TextStyle( - color: Colors.white, - fontWeight: FontWeight.w400, - fontStyle: FontStyle.normal, - fontSize: 12.0), - valueLabelRadius: 10, - maxValue: 5, - starSpacing: 2, - maxValueVisibility: false, - valueLabelVisibility: false, - animationDuration: Duration(milliseconds: 1000), - valueLabelPadding: const EdgeInsets.symmetric( - vertical: 1, horizontal: 8), - valueLabelMargin: const EdgeInsets.only(right: 8), - starOffColor: const Color(0xffe7e8ea), - starColor: Colors.green, - ), - Text( - "April 10, 2023", - style: TextStyle(color: Colors.grey), - ), - ], - ), - ], - ), - SizedBox(height: 10), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, // Align items at the top - children: [ - CircleAvatar( - backgroundImage: - NetworkImage('https://via.placeholder.com/50'), - ), - SizedBox(width: 10), + : SizedBox.shrink(); + // Padding( + // padding: const EdgeInsets.symmetric(horizontal: 16.0), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Text("Reviews & Ratings", + // style: TextStyle( + // fontSize: 20, fontWeight: FontWeight.bold)), + // SizedBox(height: 10), + // Row( + // children: [ + // Text("4.2", + // style: TextStyle( + // fontSize: 30, fontWeight: FontWeight.bold)), + // SizedBox( + // width: 10, + // ), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // RatingStars( + // value: value, + // onValueChanged: (v) { + // // + // }, + // starBuilder: (index, color) => Icon( + // Icons.star, + // color: color, + // ), + // starCount: 5, + // starSize: 20, + // valueLabelColor: const Color(0xff9b9b9b), + // valueLabelTextStyle: const TextStyle( + // color: Colors.white, + // fontWeight: FontWeight.w400, + // fontStyle: FontStyle.normal, + // fontSize: 12.0), + // valueLabelRadius: 10, + // maxValue: 5, + // starSpacing: 2, + // maxValueVisibility: false, + // valueLabelVisibility: false, + // animationDuration: Duration(milliseconds: 1000), + // valueLabelPadding: const EdgeInsets.symmetric( + // vertical: 1, horizontal: 8), + // valueLabelMargin: const EdgeInsets.only(right: 8), + // starOffColor: const Color(0xffe7e8ea), + // starColor: Colors.green, + // ), + // Text( + // "April 10, 2023", + // style: TextStyle(color: Colors.grey), + // ), + // ], + // ), + // ], + // ), + // SizedBox(height: 10), + // Row( + // crossAxisAlignment: + // CrossAxisAlignment.start, // Align items at the top + // children: [ + // CircleAvatar( + // backgroundImage: + // NetworkImage('https://via.placeholder.com/50'), + // ), + // SizedBox(width: 10), - // Column for Text and RatingStars - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, // Proper spacing - children: [ - Text( - "Johnson Smith", - style: - TextStyle(fontWeight: FontWeight.bold), - ), - RatingStars( - value: value, - starBuilder: (index, color) => Icon( - Icons.star, - color: color, - ), - starCount: 5, - starSize: 20, - maxValue: 5, - starSpacing: 2, - maxValueVisibility: false, - valueLabelVisibility: false, - animationDuration: - Duration(milliseconds: 1000), - valueLabelPadding: - const EdgeInsets.symmetric( - vertical: 1, horizontal: 8), - valueLabelMargin: - const EdgeInsets.only(right: 8), - starOffColor: const Color(0xffe7e8ea), - starColor: Colors.green, - ), - ], - ), - SizedBox(height: 4), - Text( - "April 10, 2023", - style: TextStyle(color: Colors.grey), - ), - ], - ), - ), - ], - ), - SizedBox(height: 10), - ReadMoreText( - 'Flutter is Google’s mobile UI open source framework to build high-quality native (super fast) interfaces for iOS and Android apps with the unified codebase.', - trimMode: TrimMode.Line, - trimLines: 2, - colorClickableText: APPCOLOR.appGreen, - trimCollapsedText: 'Read More', - trimExpandedText: 'Show less', - style: context.customMedium(APPCOLOR.balck1A1A1A, 14), - ), - ], - ), - ); + // // Column for Text and RatingStars + // Expanded( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisAlignment: MainAxisAlignment + // .spaceBetween, // Proper spacing + // children: [ + // Text( + // "", + // style: + // TextStyle(fontWeight: FontWeight.bold), + // ), + // RatingStars( + // value: value, + // starBuilder: (index, color) => Icon( + // Icons.star, + // color: color, + // ), + // starCount: 5, + // starSize: 20, + // maxValue: 5, + // starSpacing: 2, + // maxValueVisibility: false, + // valueLabelVisibility: false, + // animationDuration: + // Duration(milliseconds: 1000), + // valueLabelPadding: + // const EdgeInsets.symmetric( + // vertical: 1, horizontal: 8), + // valueLabelMargin: + // const EdgeInsets.only(right: 8), + // starOffColor: const Color(0xffe7e8ea), + // starColor: Colors.green, + // ), + // ], + // ), + // SizedBox(height: 4), + // Text( + // "", + // style: TextStyle(color: Colors.grey), + // ), + // ], + // ), + // ), + // ], + // ), + // SizedBox(height: 10), + // ReadMoreText( + // '', + // trimMode: TrimMode.Line, + // trimLines: 2, + // colorClickableText: APPCOLOR.appGreen, + // trimCollapsedText: 'Read More', + // trimExpandedText: 'Show less', + // style: context.customMedium(APPCOLOR.balck1A1A1A, 14), + // ), + // ], + // ), + // ); } }); } @@ -1033,7 +1035,27 @@ class _ProductDetailsState extends State { .productImages?.first?.url ?? "", backGroundColor: Colors.transparent, + radius: 10, ), + Positioned( + right: 1, + bottom: 0, + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 10, vertical: 10), + decoration: BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(5), + ), + child: Center( + child: Text( + "${calculateDiscountPercentage(double.parse(bestdealproduct.basePrice), double.parse(bestdealproduct!.discountPrice))}% OFF", + style: TextStyle( + color: Colors.white, + fontSize: 15)), + ), + ), + ) ], ), ), @@ -1068,7 +1090,7 @@ class _ProductDetailsState extends State { const Spacer(), Row( children: [ - Row( + Column( children: [ Text( "₹${bestdealproduct.discountPrice ?? ""} ", @@ -1076,7 +1098,7 @@ class _ProductDetailsState extends State { maxLines: 1, overflow: TextOverflow.ellipsis, style: context.customSemiBold( - Colors.black, 12), + Colors.black, 15), ), Text( "₹${bestdealproduct.basePrice ?? ""}", @@ -1086,7 +1108,7 @@ class _ProductDetailsState extends State { style: context .customMedium( Colors.grey.withOpacity(0.8), - 12, + 15, ) .copyWith( decoration: diff --git a/lib/src/ui/profilepage/profile_screen.dart b/lib/src/ui/profilepage/profile_screen.dart index a61e019..e3d81af 100644 --- a/lib/src/ui/profilepage/profile_screen.dart +++ b/lib/src/ui/profilepage/profile_screen.dart @@ -330,7 +330,6 @@ class _ProfileScreenState extends State { ); } - void _showBottomSheet(BuildContext context) { showModalBottomSheet( context: context,