diff --git a/assets/translations/en.json b/assets/translations/en.json index 0a541c6..f841b8b 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -122,5 +122,13 @@ "changeLanguage": "Change Language", - "selectPrefferedLanguage": "Select your preferred language for a personalized app experience." + "selectPrefferedLanguage": "Select your preferred language for a personalized app experience.", + "searchStoreItem": "Search the store, item and more...", + "category": "Category", + "highlightsForU": "Highlights for you", + "newArrival": "New Arrivals", + "topBrands": "Top Brands", + "styleUp": "Style up with the latest fits, now at unbeatable prices.", + "additionlOffers": "Additional Offers" + } \ No newline at end of file diff --git a/lib/constant/const_texts.dart b/lib/constant/const_texts.dart index 408d0bb..beb1fbf 100644 --- a/lib/constant/const_texts.dart +++ b/lib/constant/const_texts.dart @@ -122,14 +122,14 @@ class ConstTexts { static String enterManuallyLocation = "enterManuallyLocation"; static String changeLanguage = "changeLanguage"; static String selectPrefferedLanguage = "selectPrefferedLanguage"; - // static String rideDetails = "rideDetails"; - // static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance"; - // static String somethingWentWrong = "somethingWentWrong"; - // static String cash = "cash"; - // static String hugeSelectionOfAds = "hugeSelectionOfAds"; - // static String cosmetics = "cosmetics"; - // static String moreThan1000Products = "moreThan1000Products"; - // static String foodProducts = "foodProducts"; + static String searchStoreItem = "searchStoreItem"; + static String category = "category"; + static String highlightsForU = "highlightsForU"; + static String newArrival = "newArrivals"; + static String viewAllArrivals = "View All Arrivals"; + static String topBrands = "topBrands"; + static String styleUp = "styleUp"; + static String additionlOffers = "additionlOffers"; // static String enableLocation = "enableLocation"; // static String allowLocation = "allowLocation"; // static String useCurrentLocation = "useCurrentLocation"; diff --git a/lib/controllers/0n_demand_payment_controller.dart b/lib/controllers/0n_demand_payment_controller.dart index e647f3a..fd66a94 100644 --- a/lib/controllers/0n_demand_payment_controller.dart +++ b/lib/controllers/0n_demand_payment_controller.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/utils/app_router.dart'; import 'package:get/get.dart'; diff --git a/lib/controllers/cart_controller.dart b/lib/controllers/cart_controller.dart index a149ba1..b4cbca6 100644 --- a/lib/controllers/cart_controller.dart +++ b/lib/controllers/cart_controller.dart @@ -4,6 +4,7 @@ import 'dart:io'; import 'dart:math' as maths; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/cart_product_model.dart'; import 'package:customer/models/coupon_model.dart'; diff --git a/lib/controllers/dine_in_restaurant_details_controller.dart b/lib/controllers/dine_in_restaurant_details_controller.dart index da9c1ec..34b3715 100644 --- a/lib/controllers/dine_in_restaurant_details_controller.dart +++ b/lib/controllers/dine_in_restaurant_details_controller.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/dine_in_booking_model.dart'; import 'package:customer/models/favourite_model.dart'; diff --git a/lib/controllers/edit_profile_controller.dart b/lib/controllers/edit_profile_controller.dart index 6fc31a3..38f94db 100644 --- a/lib/controllers/edit_profile_controller.dart +++ b/lib/controllers/edit_profile_controller.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/user_model.dart'; diff --git a/lib/controllers/forgot_password_controller.dart b/lib/controllers/forgot_password_controller.dart index ec2a1ca..c64621a 100644 --- a/lib/controllers/forgot_password_controller.dart +++ b/lib/controllers/forgot_password_controller.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/controllers/gift_card_controller.dart b/lib/controllers/gift_card_controller.dart index 474e983..1c98016 100644 --- a/lib/controllers/gift_card_controller.dart +++ b/lib/controllers/gift_card_controller.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'dart:math' as maths; import 'dart:math'; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/gift_cards_model.dart'; import 'package:customer/themes/app_them_data.dart'; diff --git a/lib/controllers/on_demand_booking_controller.dart b/lib/controllers/on_demand_booking_controller.dart index 99fabc7..91978f1 100644 --- a/lib/controllers/on_demand_booking_controller.dart +++ b/lib/controllers/on_demand_booking_controller.dart @@ -1,4 +1,5 @@ import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/coupon_model.dart'; import 'package:customer/models/user_model.dart'; diff --git a/lib/controllers/on_demand_order_details_controller.dart b/lib/controllers/on_demand_order_details_controller.dart index a6410c3..c351b6c 100644 --- a/lib/controllers/on_demand_order_details_controller.dart +++ b/lib/controllers/on_demand_order_details_controller.dart @@ -1,5 +1,6 @@ import 'dart:developer'; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/models/coupon_model.dart'; import 'package:customer/models/user_model.dart'; diff --git a/lib/controllers/parcel_order_confirmation_controller.dart b/lib/controllers/parcel_order_confirmation_controller.dart index 25ecfd7..d3d1cc1 100644 --- a/lib/controllers/parcel_order_confirmation_controller.dart +++ b/lib/controllers/parcel_order_confirmation_controller.dart @@ -3,6 +3,7 @@ import 'dart:developer'; import 'dart:io'; import 'dart:math' as maths; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/models/coupon_model.dart'; import 'package:customer/models/wallet_transaction_model.dart'; diff --git a/lib/controllers/rate_product_controller.dart b/lib/controllers/rate_product_controller.dart index 0c0575d..be7d7ce 100644 --- a/lib/controllers/rate_product_controller.dart +++ b/lib/controllers/rate_product_controller.dart @@ -1,6 +1,7 @@ import 'dart:developer'; import 'dart:io'; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/order_model.dart'; import 'package:customer/models/product_model.dart'; diff --git a/lib/controllers/service_list_controller.dart b/lib/controllers/service_list_controller.dart index 6535e58..19d08ed 100644 --- a/lib/controllers/service_list_controller.dart +++ b/lib/controllers/service_list_controller.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/models/section_model.dart'; import 'package:customer/screen_ui/cab_service_screens/cab_dashboard_screen.dart'; import 'package:customer/screen_ui/ecommarce/dash_board_e_commerce_screen.dart'; diff --git a/lib/screen_ui/ecommarce/home_e_commerce_screen.dart b/lib/screen_ui/ecommarce/home_e_commerce_screen.dart index 4a60069..6dbf7f8 100644 --- a/lib/screen_ui/ecommarce/home_e_commerce_screen.dart +++ b/lib/screen_ui/ecommarce/home_e_commerce_screen.dart @@ -298,7 +298,7 @@ class HomeECommerceScreen extends StatelessWidget { ); }, child: TextFieldWidget( - hintText: 'Search the store, item and more...'.tr, + hintText: ConstTexts.searchStoreItem.tr, controller: null, enable: false, backgroundColor: AppThemeData.grey50, @@ -335,7 +335,7 @@ class HomeECommerceScreen extends StatelessWidget { children: [ Expanded( child: Text( - "Category".tr, + ConstTexts.category.tr, textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle( color: @@ -351,7 +351,7 @@ class HomeECommerceScreen extends StatelessWidget { Get.to(const ViewAllCategoryScreen()); }, child: Text( - "View all".tr, + ConstTexts.viewAll.tr, textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle( decoration: TextDecoration.underline, @@ -466,7 +466,9 @@ class HomeECommerceScreen extends StatelessWidget { children: [ Expanded( child: Text( - "Highlights for you".tr, + ConstTexts + .highlightsForU + .tr, textAlign: TextAlign.start, style: TextStyle( fontFamily: @@ -547,7 +549,7 @@ class HomeECommerceScreen extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Text( - "New Arrivals".tr, + ConstTexts.newArrival.tr, textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle( color: @@ -594,14 +596,14 @@ class HomeECommerceScreen extends StatelessWidget { isDark ? AppThemeData.greyDark200 : AppThemeData.grey200, - title: 'View All Arrivals'.tr, + title: ConstTexts.viewAllArrivals.tr, onPress: () { Get.to( RestaurantListScreen(), arguments: { "vendorList": controller.newArrivalRestaurantList, - "title": "New Arrivals".tr, + "title": ConstTexts.newArrival.tr, }, ); }, @@ -614,7 +616,7 @@ class HomeECommerceScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Top Brands".tr, + ConstTexts.topBrands.tr, textAlign: TextAlign.start, style: AppThemeData.semiBoldTextStyle( color: @@ -777,7 +779,7 @@ class HomeECommerceScreen extends StatelessWidget { ), ), Text( - "Style up with the latest fits, now at unbeatable prices." + ConstTexts.styleUp.tr .tr, textAlign: TextAlign.start, style: diff --git a/lib/screen_ui/location_enable_screens/enter_manually_location.dart b/lib/screen_ui/location_enable_screens/enter_manually_location.dart index 67ceb0e..fec9134 100644 --- a/lib/screen_ui/location_enable_screens/enter_manually_location.dart +++ b/lib/screen_ui/location_enable_screens/enter_manually_location.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/user_model.dart'; import 'package:customer/service/fire_store_utils.dart'; diff --git a/lib/screen_ui/multi_vendor_service/advertisement_screens/all_advertisement_screen.dart b/lib/screen_ui/multi_vendor_service/advertisement_screens/all_advertisement_screen.dart index e66a6c5..88c6875 100644 --- a/lib/screen_ui/multi_vendor_service/advertisement_screens/all_advertisement_screen.dart +++ b/lib/screen_ui/multi_vendor_service/advertisement_screens/all_advertisement_screen.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/advertisement_list_controller.dart'; import 'package:customer/models/advertisement_model.dart'; diff --git a/lib/screen_ui/multi_vendor_service/chat_screens/driver_inbox_screen.dart b/lib/screen_ui/multi_vendor_service/chat_screens/driver_inbox_screen.dart index 1d33614..278191e 100644 --- a/lib/screen_ui/multi_vendor_service/chat_screens/driver_inbox_screen.dart +++ b/lib/screen_ui/multi_vendor_service/chat_screens/driver_inbox_screen.dart @@ -1,4 +1,5 @@ import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/inbox_model.dart'; import 'package:customer/models/user_model.dart'; diff --git a/lib/screen_ui/multi_vendor_service/chat_screens/restaurant_inbox_screen.dart b/lib/screen_ui/multi_vendor_service/chat_screens/restaurant_inbox_screen.dart index 5485ddd..016e01f 100644 --- a/lib/screen_ui/multi_vendor_service/chat_screens/restaurant_inbox_screen.dart +++ b/lib/screen_ui/multi_vendor_service/chat_screens/restaurant_inbox_screen.dart @@ -1,4 +1,5 @@ import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/inbox_model.dart'; import 'package:customer/models/user_model.dart'; diff --git a/lib/screen_ui/multi_vendor_service/dine_in_screeen/dine_in_screen.dart b/lib/screen_ui/multi_vendor_service/dine_in_screeen/dine_in_screen.dart index 8806a67..5000f82 100644 --- a/lib/screen_ui/multi_vendor_service/dine_in_screeen/dine_in_screen.dart +++ b/lib/screen_ui/multi_vendor_service/dine_in_screeen/dine_in_screen.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/dine_in_controller.dart'; import 'package:customer/models/favourite_model.dart'; diff --git a/lib/screen_ui/multi_vendor_service/gift_card/redeem_gift_card_screen.dart b/lib/screen_ui/multi_vendor_service/gift_card/redeem_gift_card_screen.dart index 2dc5ca3..1998431 100644 --- a/lib/screen_ui/multi_vendor_service/gift_card/redeem_gift_card_screen.dart +++ b/lib/screen_ui/multi_vendor_service/gift_card/redeem_gift_card_screen.dart @@ -1,4 +1,5 @@ import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/dash_board_controller.dart'; import 'package:customer/controllers/redeem_gift_card_controller.dart'; diff --git a/lib/screen_ui/multi_vendor_service/home_screen/home_screen.dart b/lib/screen_ui/multi_vendor_service/home_screen/home_screen.dart index 61a293c..a321769 100644 --- a/lib/screen_ui/multi_vendor_service/home_screen/home_screen.dart +++ b/lib/screen_ui/multi_vendor_service/home_screen/home_screen.dart @@ -1,4 +1,5 @@ import 'package:badges/badges.dart' as badges; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/map_view_controller.dart'; import 'package:customer/models/advertisement_model.dart'; diff --git a/lib/screen_ui/multi_vendor_service/home_screen/home_screen_two.dart b/lib/screen_ui/multi_vendor_service/home_screen/home_screen_two.dart index 86a840e..3c35f0d 100644 --- a/lib/screen_ui/multi_vendor_service/home_screen/home_screen_two.dart +++ b/lib/screen_ui/multi_vendor_service/home_screen/home_screen_two.dart @@ -1,5 +1,6 @@ import 'dart:math'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/food_home_controller.dart'; import 'package:customer/models/coupon_model.dart'; diff --git a/lib/screen_ui/multi_vendor_service/order_list_screen/order_details_screen.dart b/lib/screen_ui/multi_vendor_service/order_list_screen/order_details_screen.dart index d6d041a..10ab8e3 100644 --- a/lib/screen_ui/multi_vendor_service/order_list_screen/order_details_screen.dart +++ b/lib/screen_ui/multi_vendor_service/order_list_screen/order_details_screen.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/order_details_controller.dart'; import 'package:customer/models/cart_product_model.dart'; diff --git a/lib/screen_ui/multi_vendor_service/profile_screen/profile_screen.dart b/lib/screen_ui/multi_vendor_service/profile_screen/profile_screen.dart index afaf8a3..5f1b3b3 100644 --- a/lib/screen_ui/multi_vendor_service/profile_screen/profile_screen.dart +++ b/lib/screen_ui/multi_vendor_service/profile_screen/profile_screen.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/my_profile_controller.dart'; import 'package:customer/screen_ui/on_demand_service/provider_inbox_screen.dart'; diff --git a/lib/screen_ui/multi_vendor_service/restaurant_details_screen/restaurant_details_screen.dart b/lib/screen_ui/multi_vendor_service/restaurant_details_screen/restaurant_details_screen.dart index c7b9011..4f6f350 100644 --- a/lib/screen_ui/multi_vendor_service/restaurant_details_screen/restaurant_details_screen.dart +++ b/lib/screen_ui/multi_vendor_service/restaurant_details_screen/restaurant_details_screen.dart @@ -1,4 +1,7 @@ +import 'dart:developer'; + import 'package:badges/badges.dart' as badges; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/restaurant_details_controller.dart'; import 'package:customer/models/cart_product_model.dart'; @@ -728,7 +731,7 @@ class RestaurantDetailsScreen extends StatelessWidget { children: [ const SizedBox(height: 20), Text( - "Additional Offers".tr, + ConstTexts.additionlOffers.tr, textAlign: TextAlign.start, maxLines: 1, style: TextStyle( @@ -1543,557 +1546,498 @@ class ProductListView extends StatelessWidget { productModel.disPrice.toString(), ); } - return Padding( - padding: const EdgeInsets.only(bottom: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Constant - .sectionConstantModel! - .isProductDetails == - false - ? SizedBox() - : Row( - children: [ - productModel.nonveg == true - ? SvgPicture.asset( - "assets/icons/ic_nonveg.svg", - ) - : SvgPicture.asset( - "assets/icons/ic_veg.svg", - ), - const SizedBox(width: 5), - Text( + return InkWell( + onTap: () { + log("Product Clicked."); + }, + child: Padding( + padding: const EdgeInsets.only(bottom: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Constant + .sectionConstantModel! + .isProductDetails == + false + ? SizedBox() + : Row( + children: [ productModel.nonveg == true - ? "Non Veg.".tr - : "Pure veg.".tr, - style: TextStyle( - color: - productModel.nonveg == true - ? AppThemeData.danger300 - : AppThemeData.success400, - fontFamily: AppThemeData.semiBold, - fontWeight: FontWeight.w600, + ? SvgPicture.asset( + "assets/icons/ic_nonveg.svg", + ) + : SvgPicture.asset( + "assets/icons/ic_veg.svg", + ), + const SizedBox(width: 5), + Text( + productModel.nonveg == true + ? "Non Veg.".tr + : "Pure veg.".tr, + style: TextStyle( + color: + productModel.nonveg == true + ? AppThemeData.danger300 + : AppThemeData + .success400, + fontFamily: + AppThemeData.semiBold, + fontWeight: FontWeight.w600, + ), ), - ), - ], + ], + ), + const SizedBox(height: 5), + Text( + productModel.name.toString(), + style: TextStyle( + fontSize: 18, + color: + isDark + ? AppThemeData.grey50 + : AppThemeData.grey900, + fontFamily: AppThemeData.semiBold, + fontWeight: FontWeight.w600, ), - const SizedBox(height: 5), - Text( - productModel.name.toString(), - style: TextStyle( - fontSize: 18, - color: - isDark - ? AppThemeData.grey50 - : AppThemeData.grey900, - fontFamily: AppThemeData.semiBold, - fontWeight: FontWeight.w600, ), - ), - double.parse(disPrice) <= 0 - ? Text( - Constant.amountShow(amount: price), - style: TextStyle( - fontSize: 16, - color: - isDark - ? AppThemeData.grey50 - : AppThemeData.grey900, - fontFamily: AppThemeData.semiBold, - fontWeight: FontWeight.w600, - ), - ) - : Row( - children: [ - Text( - Constant.amountShow(amount: disPrice), - style: TextStyle( - fontSize: 16, - color: - isDark - ? AppThemeData.grey50 - : AppThemeData.grey900, - fontFamily: AppThemeData.semiBold, - fontWeight: FontWeight.w600, - ), - ), - const SizedBox(width: 5), - Text( - Constant.amountShow(amount: price), - style: TextStyle( - fontSize: 14, - decoration: - TextDecoration.lineThrough, - decorationColor: - isDark - ? AppThemeData.grey500 - : AppThemeData.grey400, - color: - isDark - ? AppThemeData.grey500 - : AppThemeData.grey400, - fontFamily: AppThemeData.semiBold, - fontWeight: FontWeight.w600, - ), - ), - ], - ), - Row( - children: [ - SvgPicture.asset( - "assets/icons/ic_star.svg", - colorFilter: const ColorFilter.mode( - AppThemeData.warning300, - BlendMode.srcIn, - ), - ), - const SizedBox(width: 5), - Text( - "${Constant.calculateReview(reviewCount: productModel.reviewsCount!.toStringAsFixed(0), reviewSum: productModel.reviewsSum.toString())} (${productModel.reviewsCount!.toStringAsFixed(0)})", - style: TextStyle( - color: - isDark - ? AppThemeData.grey50 - : AppThemeData.grey900, - fontFamily: AppThemeData.regular, - fontWeight: FontWeight.w500, - ), - ), - ], - ), - Text( - "${productModel.description}", - maxLines: 2, - style: TextStyle( - overflow: TextOverflow.ellipsis, - color: - isDark - ? AppThemeData.grey50 - : AppThemeData.grey900, - fontFamily: AppThemeData.regular, - fontWeight: FontWeight.w400, - ), - ), - const SizedBox(height: 5), - InkWell( - onTap: () { - showDialog( - context: context, - builder: (BuildContext context) { - return infoDialog( - controller, - isDark, - productModel, - ); - }, - ); - }, - child: Row( - children: [ - Icon( - Icons.info, - color: - isDark - ? AppThemeData.primary300 - : AppThemeData.primary300, - size: 18, - ), - const SizedBox(width: 8), - Text( - "Info".tr, - maxLines: 2, + double.parse(disPrice) <= 0 + ? Text( + Constant.amountShow(amount: price), style: TextStyle( - overflow: TextOverflow.ellipsis, fontSize: 16, color: isDark - ? AppThemeData.primary300 - : AppThemeData.primary300, + ? AppThemeData.grey50 + : AppThemeData.grey900, + fontFamily: AppThemeData.semiBold, + fontWeight: FontWeight.w600, + ), + ) + : Row( + children: [ + Text( + Constant.amountShow( + amount: disPrice, + ), + style: TextStyle( + fontSize: 16, + color: + isDark + ? AppThemeData.grey50 + : AppThemeData.grey900, + fontFamily: + AppThemeData.semiBold, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox(width: 5), + Text( + Constant.amountShow( + amount: price, + ), + style: TextStyle( + fontSize: 14, + decoration: + TextDecoration.lineThrough, + decorationColor: + isDark + ? AppThemeData.grey500 + : AppThemeData.grey400, + color: + isDark + ? AppThemeData.grey500 + : AppThemeData.grey400, + fontFamily: + AppThemeData.semiBold, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + Row( + children: [ + SvgPicture.asset( + "assets/icons/ic_star.svg", + colorFilter: const ColorFilter.mode( + AppThemeData.warning300, + BlendMode.srcIn, + ), + ), + const SizedBox(width: 5), + Text( + "${Constant.calculateReview(reviewCount: productModel.reviewsCount!.toStringAsFixed(0), reviewSum: productModel.reviewsSum.toString())} (${productModel.reviewsCount!.toStringAsFixed(0)})", + style: TextStyle( + color: + isDark + ? AppThemeData.grey50 + : AppThemeData.grey900, fontFamily: AppThemeData.regular, - fontWeight: FontWeight.w400, + fontWeight: FontWeight.w500, ), ), ], ), - ), - ], - ), - ), - ClipRRect( - borderRadius: const BorderRadius.all( - Radius.circular(16), - ), - child: Stack( - children: [ - NetworkImageWidget( - imageUrl: productModel.photo.toString(), - fit: BoxFit.cover, - height: Responsive.height(16, context), - width: Responsive.width(34, context), - ), - Container( - height: Responsive.height(16, context), - width: Responsive.width(34, context), - decoration: BoxDecoration( - gradient: LinearGradient( - begin: const Alignment(-0.00, -1.00), - end: const Alignment(0, 1), - colors: [ - Colors.black.withOpacity(0), - const Color(0xFF111827), + Text( + "${productModel.description}", + maxLines: 2, + style: TextStyle( + overflow: TextOverflow.ellipsis, + color: + isDark + ? AppThemeData.grey50 + : AppThemeData.grey900, + fontFamily: AppThemeData.regular, + fontWeight: FontWeight.w400, + ), + ), + const SizedBox(height: 5), + InkWell( + onTap: () { + showDialog( + context: context, + builder: (BuildContext context) { + return infoDialog( + controller, + isDark, + productModel, + ); + }, + ); + }, + child: Row( + children: [ + Icon( + Icons.info, + color: + isDark + ? AppThemeData.primary300 + : AppThemeData.primary300, + size: 18, + ), + const SizedBox(width: 8), + Text( + "Info".tr, + maxLines: 2, + style: TextStyle( + overflow: TextOverflow.ellipsis, + fontSize: 16, + color: + isDark + ? AppThemeData.primary300 + : AppThemeData.primary300, + fontFamily: AppThemeData.regular, + fontWeight: FontWeight.w400, + ), + ), ], ), ), - ), - Positioned( - right: 10, - top: 10, - child: InkWell( - onTap: () async { - if (controller.favouriteItemList - .where( - (p0) => - p0.productId == productModel.id, - ) - .isNotEmpty) { - FavouriteItemModel - favouriteModel = FavouriteItemModel( - productId: productModel.id, - storeId: - controller.vendorModel.value.id, - userId: - FireStoreUtils.getCurrentUid(), - ); - controller.favouriteItemList - .removeWhere( - (item) => - item.productId == - productModel.id, - ); - await FireStoreUtils.removeFavouriteItem( - favouriteModel, - ); - } else { - FavouriteItemModel - favouriteModel = FavouriteItemModel( - productId: productModel.id, - storeId: - controller.vendorModel.value.id, - userId: - FireStoreUtils.getCurrentUid(), - ); - controller.favouriteItemList.add( - favouriteModel, - ); - - await FireStoreUtils.setFavouriteItem( - favouriteModel, - ); - } - }, - child: Obx( - () => - controller.favouriteItemList - .where( - (p0) => - p0.productId == - productModel.id, - ) - .isNotEmpty - ? SvgPicture.asset( - "assets/icons/ic_like_fill.svg", - ) - : SvgPicture.asset( - "assets/icons/ic_like.svg", - ), + ], + ), + ), + ClipRRect( + borderRadius: const BorderRadius.all( + Radius.circular(16), + ), + child: Stack( + children: [ + NetworkImageWidget( + imageUrl: productModel.photo.toString(), + fit: BoxFit.cover, + height: Responsive.height(16, context), + width: Responsive.width(34, context), + ), + Container( + height: Responsive.height(16, context), + width: Responsive.width(34, context), + decoration: BoxDecoration( + gradient: LinearGradient( + begin: const Alignment(-0.00, -1.00), + end: const Alignment(0, 1), + colors: [ + Colors.black.withOpacity(0), + const Color(0xFF111827), + ], + ), ), ), - ), - controller.isOpen.value == false || - Constant.userModel == null - ? const SizedBox() - : Positioned( - bottom: 10, - left: 20, - right: 20, - child: - selectedVariants.isNotEmpty || - (productModel.addOnsTitle != - null && - productModel - .addOnsTitle! - .isNotEmpty) - ? RoundedButtonFill( - title: "Add".tr, - width: 10, - height: 4, - color: - isDark - ? AppThemeData.grey900 - : AppThemeData.grey50, - textColor: - AppThemeData.primary300, - onPress: () async { - controller.selectedVariants - .clear(); - controller - .selectedIndexVariants - .clear(); - controller.selectedIndexArray - .clear(); - controller.selectedAddOns - .clear(); - controller.quantity.value = 1; - if (productModel - .itemAttribute != - null) { + Positioned( + right: 10, + top: 10, + child: InkWell( + onTap: () async { + if (controller.favouriteItemList + .where( + (p0) => + p0.productId == + productModel.id, + ) + .isNotEmpty) { + FavouriteItemModel + favouriteModel = FavouriteItemModel( + productId: productModel.id, + storeId: + controller + .vendorModel + .value + .id, + userId: + FireStoreUtils.getCurrentUid(), + ); + controller.favouriteItemList + .removeWhere( + (item) => + item.productId == + productModel.id, + ); + await FireStoreUtils.removeFavouriteItem( + favouriteModel, + ); + } else { + FavouriteItemModel + favouriteModel = FavouriteItemModel( + productId: productModel.id, + storeId: + controller + .vendorModel + .value + .id, + userId: + FireStoreUtils.getCurrentUid(), + ); + controller.favouriteItemList.add( + favouriteModel, + ); + + await FireStoreUtils.setFavouriteItem( + favouriteModel, + ); + } + }, + child: Obx( + () => + controller.favouriteItemList + .where( + (p0) => + p0.productId == + productModel.id, + ) + .isNotEmpty + ? SvgPicture.asset( + "assets/icons/ic_like_fill.svg", + ) + : SvgPicture.asset( + "assets/icons/ic_like.svg", + ), + ), + ), + ), + controller.isOpen.value == false || + Constant.userModel == null + ? const SizedBox() + : Positioned( + bottom: 10, + left: 20, + right: 20, + child: + selectedVariants.isNotEmpty || + (productModel + .addOnsTitle != + null && + productModel + .addOnsTitle! + .isNotEmpty) + ? RoundedButtonFill( + title: "Add".tr, + width: 10, + height: 4, + color: + isDark + ? AppThemeData + .grey900 + : AppThemeData + .grey50, + textColor: + AppThemeData.primary300, + onPress: () async { + controller + .selectedVariants + .clear(); + controller + .selectedIndexVariants + .clear(); + controller + .selectedIndexArray + .clear(); + controller.selectedAddOns + .clear(); + controller + .quantity + .value = 1; if (productModel - .itemAttribute! - .attributes! - .isNotEmpty) { - for (var element - in productModel - .itemAttribute! - .attributes!) { - if (element - .attributeOptions! - .isNotEmpty) { - controller.selectedVariants.add( - productModel + .itemAttribute != + null) { + if (productModel + .itemAttribute! + .attributes! + .isNotEmpty) { + for (var element + in productModel .itemAttribute! - .attributes![productModel - .itemAttribute! - .attributes! - .indexOf( - element, - )] - .attributeOptions![0] - .toString(), - ); - controller - .selectedIndexVariants - .add( - '${productModel.itemAttribute!.attributes!.indexOf(element)} _${productModel.itemAttribute!.attributes![0].attributeOptions![0].toString()}', - ); - controller - .selectedIndexArray - .add( - '${productModel.itemAttribute!.attributes!.indexOf(element)}_0', - ); + .attributes!) { + if (element + .attributeOptions! + .isNotEmpty) { + controller.selectedVariants.add( + productModel + .itemAttribute! + .attributes![productModel + .itemAttribute! + .attributes! + .indexOf( + element, + )] + .attributeOptions![0] + .toString(), + ); + controller + .selectedIndexVariants + .add( + '${productModel.itemAttribute!.attributes!.indexOf(element)} _${productModel.itemAttribute!.attributes![0].attributeOptions![0].toString()}', + ); + controller + .selectedIndexArray + .add( + '${productModel.itemAttribute!.attributes!.indexOf(element)}_0', + ); + } } } - } - final bool - productIsInList = cartItem.any( - (product) => - product.id == - "${productModel.id}~${productModel.itemAttribute!.variants!.where((element) => element.variantSku == controller.selectedVariants.join('-')).isNotEmpty ? productModel.itemAttribute!.variants!.where((element) => element.variantSku == controller.selectedVariants.join('-')).first.variantId.toString() : ""}", - ); - - if (productIsInList) { - CartProductModel element = - cartItem.firstWhere( + final bool + productIsInList = + cartItem.any( (product) => product.id == "${productModel.id}~${productModel.itemAttribute!.variants!.where((element) => element.variantSku == controller.selectedVariants.join('-')).isNotEmpty ? productModel.itemAttribute!.variants!.where((element) => element.variantSku == controller.selectedVariants.join('-')).first.variantId.toString() : ""}", ); - controller - .quantity - .value = - element.quantity!; - if (element.extras != - null) { - for (var element - in element - .extras!) { - controller - .selectedAddOns - .add(element); + + if (productIsInList) { + CartProductModel + element = cartItem + .firstWhere( + (product) => + product + .id == + "${productModel.id}~${productModel.itemAttribute!.variants!.where((element) => element.variantSku == controller.selectedVariants.join('-')).isNotEmpty ? productModel.itemAttribute!.variants!.where((element) => element.variantSku == controller.selectedVariants.join('-')).first.variantId.toString() : ""}", + ); + controller + .quantity + .value = + element.quantity!; + if (element.extras != + null) { + for (var element + in element + .extras!) { + controller + .selectedAddOns + .add(element); + } } } - } - } else { - if (cartItem - .where( - (product) => - product.id == - "${productModel.id}", - ) - .isNotEmpty) { - CartProductModel element = - cartItem.firstWhere( + } else { + if (cartItem + .where( (product) => product.id == "${productModel.id}", - ); - controller - .quantity - .value = - element.quantity!; - if (element.extras != - null) { - for (var element - in element - .extras!) { - controller - .selectedAddOns - .add(element); + ) + .isNotEmpty) { + CartProductModel + element = cartItem + .firstWhere( + (product) => + product + .id == + "${productModel.id}", + ); + controller + .quantity + .value = + element.quantity!; + if (element.extras != + null) { + for (var element + in element + .extras!) { + controller + .selectedAddOns + .add(element); + } } } } - } - controller.update(); - controller.calculatePrice( - productModel, - ); - productDetailsBottomSheet( - context, - productModel, - ); - }, - ) - : Obx( - () => - cartItem - .where( - (p0) => - p0.id == - productModel - .id, - ) - .isNotEmpty - ? Container( - width: - Responsive.width( - 100, - context, - ), - height: - Responsive.height( - 4, - context, - ), - decoration: ShapeDecoration( - color: - isDark - ? AppThemeData - .grey900 - : AppThemeData - .grey50, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular( - 200, - ), - ), - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - InkWell( - onTap: () { - controller.addToCart( - productModel: - productModel, - price: - price, - discountPrice: - disPrice, - isIncrement: - false, - quantity: - cartItem - .where( - ( - p0, - ) => - p0.id == - productModel.id, - ) - .first - .quantity! - - 1, - ); - }, - child: Icon( - Icons.remove, - color: - isDark - ? AppThemeData - .grey50 - : AppThemeData - .greyDark50, + controller.update(); + controller.calculatePrice( + productModel, + ); + productDetailsBottomSheet( + context, + productModel, + ); + }, + ) + : Obx( + () => + cartItem + .where( + (p0) => + p0.id == + productModel + .id, + ) + .isNotEmpty + ? Container( + width: + Responsive.width( + 100, + context, ), - ), - Padding( - padding: - const EdgeInsets.symmetric( - horizontal: - 14, + height: + Responsive.height( + 4, + context, + ), + decoration: ShapeDecoration( + color: + isDark + ? AppThemeData + .grey900 + : AppThemeData + .grey50, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 200, ), - child: Text( - cartItem - .where( - (p0) => - p0.id == - productModel.id, - ) - .first - .quantity - .toString(), - textAlign: - TextAlign - .start, - maxLines: 1, - style: TextStyle( - fontSize: - 16, - overflow: - TextOverflow - .ellipsis, - fontFamily: - AppThemeData - .medium, - fontWeight: - FontWeight - .w500, - color: - isDark - ? AppThemeData.grey100 - : AppThemeData.grey800, - ), - ), ), - InkWell( - onTap: () { - if ((cartItem - .where( - ( - p0, - ) => - p0.id == - productModel.id, - ) - .first - .quantity ?? - 0) < - (productModel.quantity ?? - 0) || - (productModel.quantity ?? - 0) == - -1) { + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + InkWell( + onTap: () { controller.addToCart( productModel: productModel, @@ -2102,7 +2046,7 @@ class ProductListView extends StatelessWidget { discountPrice: disPrice, isIncrement: - true, + false, quantity: cartItem .where( @@ -2113,75 +2057,161 @@ class ProductListView extends StatelessWidget { productModel.id, ) .first - .quantity! + + .quantity! - 1, ); - } else { - ShowToastDialog.showToast( - "Out of stock" - .tr, - ); - } - }, - child: Icon( - Icons.add, - color: - isDark - ? AppThemeData - .grey50 - : AppThemeData - .greyDark50, + }, + child: Icon( + Icons + .remove, + color: + isDark + ? AppThemeData.grey50 + : AppThemeData.greyDark50, + ), ), - ), - ], + Padding( + padding: const EdgeInsets.symmetric( + horizontal: + 14, + ), + child: Text( + cartItem + .where( + ( + p0, + ) => + p0.id == + productModel.id, + ) + .first + .quantity + .toString(), + textAlign: + TextAlign + .start, + maxLines: + 1, + style: TextStyle( + fontSize: + 16, + overflow: + TextOverflow.ellipsis, + fontFamily: + AppThemeData.medium, + fontWeight: + FontWeight.w500, + color: + isDark + ? AppThemeData.grey100 + : AppThemeData.grey800, + ), + ), + ), + InkWell( + onTap: () { + if ((cartItem + .where( + ( + p0, + ) => + p0.id == + productModel.id, + ) + .first + .quantity ?? + 0) < + (productModel.quantity ?? + 0) || + (productModel.quantity ?? + 0) == + -1) { + controller.addToCart( + productModel: + productModel, + price: + price, + discountPrice: + disPrice, + isIncrement: + true, + quantity: + cartItem + .where( + ( + p0, + ) => + p0.id == + productModel.id, + ) + .first + .quantity! + + 1, + ); + } else { + ShowToastDialog.showToast( + "Out of stock" + .tr, + ); + } + }, + child: Icon( + Icons.add, + color: + isDark + ? AppThemeData.grey50 + : AppThemeData.greyDark50, + ), + ), + ], + ), + ) + : RoundedButtonFill( + title: "Add".tr, + width: 10, + height: 4, + color: + isDark + ? AppThemeData + .grey900 + : AppThemeData + .grey50, + textColor: + AppThemeData + .primary300, + onPress: () async { + if (1 <= + (productModel.quantity ?? + 0) || + (productModel.quantity ?? + 0) == + -1) { + controller.addToCart( + productModel: + productModel, + price: + price, + discountPrice: + disPrice, + isIncrement: + true, + quantity: 1, + ); + } else { + ShowToastDialog.showToast( + "Out of stock" + .tr, + ); + } + }, ), - ) - : RoundedButtonFill( - title: "Add".tr, - width: 10, - height: 4, - color: - isDark - ? AppThemeData - .grey900 - : AppThemeData - .grey50, - textColor: - AppThemeData - .primary300, - onPress: () async { - if (1 <= - (productModel - .quantity ?? - 0) || - (productModel - .quantity ?? - 0) == - -1) { - controller.addToCart( - productModel: - productModel, - price: price, - discountPrice: - disPrice, - isIncrement: - true, - quantity: 1, - ); - } else { - ShowToastDialog.showToast( - "Out of stock" - .tr, - ); - } - }, - ), - ), - ), - ], + ), + ), + ], + ), ), - ), - ], + ], + ), ), ); }, diff --git a/lib/screen_ui/multi_vendor_service/scan_qrcode_screen/scan_qr_code_screen.dart b/lib/screen_ui/multi_vendor_service/scan_qrcode_screen/scan_qr_code_screen.dart index 74cca90..b5f9119 100644 --- a/lib/screen_ui/multi_vendor_service/scan_qrcode_screen/scan_qr_code_screen.dart +++ b/lib/screen_ui/multi_vendor_service/scan_qrcode_screen/scan_qr_code_screen.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/controllers/scan_qr_code_controller.dart'; import 'package:customer/models/vendor_model.dart'; import 'package:customer/themes/app_them_data.dart'; diff --git a/lib/screen_ui/on_demand_service/on_demand_booking_screen.dart b/lib/screen_ui/on_demand_service/on_demand_booking_screen.dart index 61b4359..fd01d93 100644 --- a/lib/screen_ui/on_demand_service/on_demand_booking_screen.dart +++ b/lib/screen_ui/on_demand_service/on_demand_booking_screen.dart @@ -1,4 +1,5 @@ import 'package:bottom_picker/bottom_picker.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:dotted_border/dotted_border.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screen_ui/on_demand_service/on_demand_home_screen.dart b/lib/screen_ui/on_demand_service/on_demand_home_screen.dart index 982aa12..3d22b0c 100644 --- a/lib/screen_ui/on_demand_service/on_demand_home_screen.dart +++ b/lib/screen_ui/on_demand_service/on_demand_home_screen.dart @@ -1,4 +1,5 @@ import 'package:cached_network_image/cached_network_image.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/controllers/theme_controller.dart'; import 'package:customer/models/banner_model.dart'; diff --git a/lib/screen_ui/on_demand_service/on_demand_order_details_screen.dart b/lib/screen_ui/on_demand_service/on_demand_order_details_screen.dart index 4687960..23f7c36 100644 --- a/lib/screen_ui/on_demand_service/on_demand_order_details_screen.dart +++ b/lib/screen_ui/on_demand_service/on_demand_order_details_screen.dart @@ -1,4 +1,5 @@ import 'package:clipboard/clipboard.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:dotted_border/dotted_border.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screen_ui/on_demand_service/provider_inbox_screen.dart b/lib/screen_ui/on_demand_service/provider_inbox_screen.dart index 4e21735..344835a 100644 --- a/lib/screen_ui/on_demand_service/provider_inbox_screen.dart +++ b/lib/screen_ui/on_demand_service/provider_inbox_screen.dart @@ -1,4 +1,5 @@ import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/inbox_model.dart'; import 'package:customer/models/user_model.dart'; diff --git a/lib/screen_ui/on_demand_service/worker_inbox_screen.dart b/lib/screen_ui/on_demand_service/worker_inbox_screen.dart index b11ad2d..d500bbb 100644 --- a/lib/screen_ui/on_demand_service/worker_inbox_screen.dart +++ b/lib/screen_ui/on_demand_service/worker_inbox_screen.dart @@ -1,4 +1,5 @@ import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/inbox_model.dart'; import 'package:customer/models/user_model.dart'; diff --git a/lib/screen_ui/parcel_service/home_parcel_screen.dart b/lib/screen_ui/parcel_service/home_parcel_screen.dart index c6d9f11..23dd4df 100644 --- a/lib/screen_ui/parcel_service/home_parcel_screen.dart +++ b/lib/screen_ui/parcel_service/home_parcel_screen.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; diff --git a/lib/screen_ui/parcel_service/parcel_order_details.dart b/lib/screen_ui/parcel_service/parcel_order_details.dart index 65b0768..fbb482a 100644 --- a/lib/screen_ui/parcel_service/parcel_order_details.dart +++ b/lib/screen_ui/parcel_service/parcel_order_details.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/screen_ui/parcel_service/parcel_review_screen.dart'; import 'package:dotted_border/dotted_border.dart'; diff --git a/lib/screen_ui/rental_service/rental_order_details_screen.dart b/lib/screen_ui/rental_service/rental_order_details_screen.dart index 8662f2b..f471eff 100644 --- a/lib/screen_ui/rental_service/rental_order_details_screen.dart +++ b/lib/screen_ui/rental_service/rental_order_details_screen.dart @@ -1,3 +1,4 @@ +import 'package:customer/constant/const_texts.dart'; import 'package:customer/constant/constant.dart'; import 'package:customer/models/rental_order_model.dart'; import 'package:customer/payment/createRazorPayOrderModel.dart';