From ce9bb33bdd84d0e497d54db037ffc68e236ecfd2 Mon Sep 17 00:00:00 2001 From: ram-flutterdeveloper Date: Mon, 5 May 2025 00:24:42 +0530 Subject: [PATCH] issue --- .DS_Store | Bin 10244 -> 10244 bytes .dart_tool/package_config.json | 382 ++++----- .dart_tool/package_config_subset | 746 +++++++++--------- .dart_tool/version | 2 +- .flutter-plugins | 124 +-- .flutter-plugins-dependencies | 2 +- lib/main.dart | 12 +- lib/src/data/coupon_response.dart | 84 +- .../logic/provider/addTocart_provider.dart | 5 +- lib/src/logic/repo/product_repo.dart | 12 +- lib/src/ui/cart/cartview_screen.dart | 4 +- .../ui/edit_profile/edit_profile_screen.dart | 21 +- lib/src/ui/home/home_screen.dart | 12 +- lib/src/ui/myOrder/OrderDetailsScreen.dart | 4 +- lib/src/ui/myOrder/my_order.dart | 36 +- lib/src/ui/onboarding/on_boarding_screen.dart | 5 +- .../ui/payment/payment_success_screen.dart | 14 +- pubspec.lock | 24 +- 18 files changed, 764 insertions(+), 725 deletions(-) diff --git a/.DS_Store b/.DS_Store index 371dea3f7a006301e8ebc3ec0f063823c8734230..80b924aa8c4e27b2fb3dd29357cc583279f85655 100644 GIT binary patch delta 209 zcmZn(XbG6$&*-)>U^hRb+vEfRiOnhkN14q$bMljua`KZH7#IW?7#O>OwBCO(0J0bu zSQ(NSN*OX4au`yQ%8Lu2DtAoI7A;hlsIE3P)KM@ru&mWls5Ue(1#--d3~FmRIYgE9 zt%KsTb8_?YyCz2p$uo9OzAfA=j$~R{a8X`PeqK7z4#v&VBGb4wvn%{!VP#0k&3Bos PBO*UpQ^XXH`pHZHP%}Gu delta 54 zcmV-60LlM^P=rvBPXR-*P`eKSLz7?-7_%f0#RHS&6m_$76_X0FfEEF>2O# CouponResponse.fromJson(json.decode(str)); + +// String couponResponseToJson(CouponResponse data) => json.encode(data.toJson()); + +// class CouponResponse { +// bool? isValid; +// String? originalPrice; +// int? discountAmount; +// int? finalPrice; +// String? message; +// CouponDetails? couponDetails; + +// CouponResponse({ +// this.isValid, +// this.originalPrice, +// this.discountAmount, +// this.finalPrice, +// this.message, +// this.couponDetails, +// }); + +// factory CouponResponse.fromJson(Map json) => CouponResponse( +// isValid: json["isValid"], +// originalPrice: json["originalPrice"], +// discountAmount: json["discountAmount"], +// finalPrice: json["finalPrice"], +// message: json["message"], +// couponDetails: CouponDetails.fromJson(json["couponDetails"]), +// ); + +// Map toJson() => { +// "isValid": isValid, +// "originalPrice": originalPrice, +// "discountAmount": discountAmount, +// "finalPrice": finalPrice, +// "message": message, +// "couponDetails": couponDetails!.toJson(), +// }; +// } + +// class CouponDetails { +// String? code; +// String? type; +// String? discountValue; + +// CouponDetails({ +// this.code, +// this.type, +// this.discountValue, +// }); + +// factory CouponDetails.fromJson(Map json) => CouponDetails( +// code: json["code"], +// type: json["type"], +// discountValue: json["discountValue"], +// ); + +// Map toJson() => { +// "code": code, +// "type": type, +// "discountValue": discountValue, +// }; +// } + + + + // To parse this JSON data, do // // final couponResponse = couponResponseFromJson(jsonString); @@ -10,7 +83,8 @@ String couponResponseToJson(CouponResponse data) => json.encode(data.toJson()); class CouponResponse { bool? isValid; - String? originalPrice; + int? originalPrice; + int? eligibleSubtotal; int? discountAmount; int? finalPrice; String? message; @@ -19,6 +93,7 @@ class CouponResponse { CouponResponse({ this.isValid, this.originalPrice, + this.eligibleSubtotal, this.discountAmount, this.finalPrice, this.message, @@ -28,6 +103,7 @@ class CouponResponse { factory CouponResponse.fromJson(Map json) => CouponResponse( isValid: json["isValid"], originalPrice: json["originalPrice"], + eligibleSubtotal: json["eligibleSubtotal"], discountAmount: json["discountAmount"], finalPrice: json["finalPrice"], message: json["message"], @@ -37,6 +113,7 @@ class CouponResponse { Map toJson() => { "isValid": isValid, "originalPrice": originalPrice, + "eligibleSubtotal": eligibleSubtotal, "discountAmount": discountAmount, "finalPrice": finalPrice, "message": message, @@ -46,8 +123,8 @@ class CouponResponse { class CouponDetails { String? code; - String? type; - String? discountValue; + String ?type; + String ?discountValue; CouponDetails({ this.code, @@ -67,3 +144,4 @@ class CouponDetails { "discountValue": discountValue, }; } + diff --git a/lib/src/logic/provider/addTocart_provider.dart b/lib/src/logic/provider/addTocart_provider.dart index 4b0b0e3..d8e77b6 100644 --- a/lib/src/logic/provider/addTocart_provider.dart +++ b/lib/src/logic/provider/addTocart_provider.dart @@ -253,8 +253,10 @@ class AddtocartProvider extends ChangeNotifier { notifyListeners(); var data = {"couponCode": couponscode, "cartId": cartId}; + print("ijdfhjhgjfgihj $data"); try { var result = await _homeRepo.applyCoupon(data); + return result.fold( (error) { @@ -271,7 +273,8 @@ class AddtocartProvider extends ChangeNotifier { notifyListeners(); return false; }, - (response) { + (response) + { if (response != null) { couponResponse = response; _couponId = id; diff --git a/lib/src/logic/repo/product_repo.dart b/lib/src/logic/repo/product_repo.dart index 541913c..7cb8b99 100644 --- a/lib/src/logic/repo/product_repo.dart +++ b/lib/src/logic/repo/product_repo.dart @@ -239,6 +239,8 @@ class ProductRepo { CouponResponse couponresponse = couponResponseFromJson(response.toString()); + print("jdjkgdfjkhdfg $couponresponse"); + return right(couponresponse); } on DioException catch (e) { var error = CustomDioExceptions.handleError(e); @@ -442,8 +444,7 @@ class ProductRepo { } } - FutureResult refreshToken(data, BuildContext context) async - { + FutureResult refreshToken(data, BuildContext context) async { try { var response = await _productService.refresh_token(data); LoginResponse loginResponse = loginResponseFromJson(response.toString()); @@ -464,12 +465,11 @@ class ProductRepo { } } - FutureResult updateDeviceToken(data, BuildContext context) async - { + FutureResult updateDeviceToken(data, BuildContext context) async { try { var response = await _productService.updateDeviceToken(data); - final String model = response.toString(); - return right(model); + final String model = response.toString(); + return right(model); } on DioException catch (e) { var error = CustomDioExceptions.handleError(e); return left(error); diff --git a/lib/src/ui/cart/cartview_screen.dart b/lib/src/ui/cart/cartview_screen.dart index 78ef0da..98e3f6d 100644 --- a/lib/src/ui/cart/cartview_screen.dart +++ b/lib/src/ui/cart/cartview_screen.dart @@ -30,9 +30,7 @@ class _MycartState extends State { @override void initState() { Future.microtask(() { - final addToCartProvider = - Provider.of(context, listen: false); - + final addToCartProvider = Provider.of(context, listen: false); addToCartProvider.getItemCards(context); addToCartProvider.offerCoupon(context); addToCartProvider.getCurrentLocation(context); diff --git a/lib/src/ui/edit_profile/edit_profile_screen.dart b/lib/src/ui/edit_profile/edit_profile_screen.dart index a6c62bd..3352738 100644 --- a/lib/src/ui/edit_profile/edit_profile_screen.dart +++ b/lib/src/ui/edit_profile/edit_profile_screen.dart @@ -35,7 +35,7 @@ class _EditProfileScreenState extends State { @override void initState() { getUserDetails(); - // TODO: implement initState + super.initState(); } @@ -116,22 +116,17 @@ class _EditProfileScreenState extends State { Expanded( child: InkWell( onTap: () async { - var status = await imageProvider.updateProfile( - context, - firstController.text, - lastController.text); + var status = await imageProvider.updateProfile( + context, firstController.text, lastController.text); - if (status) { - Navigator.pop(context); - } - } - , + if (status) { + Navigator.pop(context); + } + }, child: Container( height: 50, decoration: BoxDecoration( - color: imageProvider.isImageLoading - ? APPCOLOR.lightGreen - : Colors.grey.withOpacity(0.7), + color: APPCOLOR.lightGreen, borderRadius: BorderRadius.circular(10)), child: Center( child: Text( diff --git a/lib/src/ui/home/home_screen.dart b/lib/src/ui/home/home_screen.dart index d31c9f2..0df68d2 100644 --- a/lib/src/ui/home/home_screen.dart +++ b/lib/src/ui/home/home_screen.dart @@ -143,7 +143,8 @@ class _HomeScreenState extends State { children: [ Expanded( child: Consumer( - builder: (context, provider, child) { + builder: (context, provider, child) + { return CompositedTransformTarget( link: _layerLink, child: Container( @@ -155,6 +156,11 @@ class _HomeScreenState extends State { child: TextFormField( controller: _searchController, onChanged: (value) { + if (value.isEmpty) { + provider.getHomeProduct(context, "", + _searchController.text, '', '', ''); + } + provider.searchProducts(value, context); if (value.isNotEmpty) { @@ -734,7 +740,7 @@ class _HomeScreenState extends State { crossAxisSpacing: 5, mainAxisSpacing: 5, childAspectRatio: MediaQuery.of(context).size.width / - (MediaQuery.of(context).size.height / 1.4), + (MediaQuery.of(context).size.height / 1.2), ), itemBuilder: (context, index) { var product = provider.homeproducts[index]; @@ -754,7 +760,7 @@ class _HomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - height: 95, + height: 95.h, decoration: BoxDecoration( color: APPCOLOR.bgGrey, borderRadius: BorderRadius.circular(5), diff --git a/lib/src/ui/myOrder/OrderDetailsScreen.dart b/lib/src/ui/myOrder/OrderDetailsScreen.dart index 9444662..e6b3775 100644 --- a/lib/src/ui/myOrder/OrderDetailsScreen.dart +++ b/lib/src/ui/myOrder/OrderDetailsScreen.dart @@ -261,7 +261,8 @@ class _OrderDetailsScreenState extends State { ), Gap(5), if (orderitem.orderItemStatus != "PENDING" && - orderitem.orderItemStatus != "CANCELLED") + orderitem.orderItemStatus != "CANCELLED" && + orderitem.orderItemStatus != "DELIVERED") RichText( text: TextSpan( text: " ", @@ -321,7 +322,6 @@ class _OrderDetailsScreenState extends State { width: 50, height: 50, child: AppNetworkImage( - imageUrl: orderitem.productImage ?? "", backGroundColor: Colors.transparent, ), diff --git a/lib/src/ui/myOrder/my_order.dart b/lib/src/ui/myOrder/my_order.dart index 93bdc9e..ceb1bc8 100644 --- a/lib/src/ui/myOrder/my_order.dart +++ b/lib/src/ui/myOrder/my_order.dart @@ -142,9 +142,7 @@ class _MyOrderScreenState extends State { Text(order.orderNumber, style: TextStyle( fontWeight: FontWeight.bold)), - Text(order.paymentStatus ?? "", - style: - TextStyle(color: Colors.grey)), + Text( order.totalItems.toString() + " items", @@ -154,16 +152,7 @@ class _MyOrderScreenState extends State { ), Spacer(), - // Container( - // padding: EdgeInsets.symmetric( - // horizontal: 5, vertical: 5), - // decoration: BoxDecoration( - // color: Colors.green.shade100, - // borderRadius: BorderRadius.circular(10), - // ), - // child: Text(order.orderStatus, - // style: TextStyle(color: Colors.green)), - // ), + ], ), SizedBox(height: 10), @@ -180,27 +169,6 @@ class _MyOrderScreenState extends State { fontWeight: FontWeight.bold)), Row( children: [ - // ElevatedButton( - // onPressed: () {}, - // style: ElevatedButton.styleFrom( - // backgroundColor: Colors.white, - // side: BorderSide(color: Colors.green), - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular(10), - // ), - // ), - // child: Row( - // children: [ - // // Icon(Icons.message, - // // color: Colors.green), - // // SizedBox(width: 5), - // // Text('Message', - // // style: TextStyle( - // // color: Colors.green)), - // ], - // ), - // ), SizedBox(width: 10), ElevatedButton( onPressed: () { diff --git a/lib/src/ui/onboarding/on_boarding_screen.dart b/lib/src/ui/onboarding/on_boarding_screen.dart index 34dca51..1d2df94 100644 --- a/lib/src/ui/onboarding/on_boarding_screen.dart +++ b/lib/src/ui/onboarding/on_boarding_screen.dart @@ -31,11 +31,12 @@ class _OnBoardingScreenState extends State { ); } - skipbyarrowFunction() { + skipbyarrowFunction() + { SharedPrefUtils.setFreshInstall(isFresh: false).then( (value) => context.clearAndPush(routePath: MyRoutes.SIGNUP, args: 0), ); - } + } onChangedFunction(int index) { setState(() { diff --git a/lib/src/ui/payment/payment_success_screen.dart b/lib/src/ui/payment/payment_success_screen.dart index d3a4de7..88eefe5 100644 --- a/lib/src/ui/payment/payment_success_screen.dart +++ b/lib/src/ui/payment/payment_success_screen.dart @@ -39,13 +39,13 @@ class PaymentSuccessScreen extends StatelessWidget { ), ), actions: [ - InkWell( - onTap: () {}, - child: Icon( - MdiIcons.magnify, - size: 35, - ), - ) + // InkWell( + // onTap: () {}, + // child: Icon( + // MdiIcons.magnify, + // size: 35, + // ), + // ) ], ), body: Center( diff --git a/pubspec.lock b/pubspec.lock index c982a3c..8e0e359 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -828,18 +828,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -884,10 +884,10 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" material_design_icons_flutter: dependency: "direct main" description: @@ -900,10 +900,10 @@ packages: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mime: dependency: transitive description: @@ -1305,10 +1305,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" timezone: dependency: transitive description: @@ -1433,10 +1433,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.5" web: dependency: transitive description: