From 961d1f249cd8cae58b77488df2db427e9b951308 Mon Sep 17 00:00:00 2001 From: saritabirare Date: Tue, 8 Oct 2024 14:06:36 +0530 Subject: [PATCH] 1)RD get Order APi Integration done --- lib/controller/rd_get_order_controller.dart | 34 + lib/controller/rd_get_order_service.dart | 38 + lib/models/rd_get_order_model.dart | 297 ++++++++ lib/models/rd_order_item_model.dart | 82 +++ lib/screens/home_screen.dart | 20 + .../rd orders/rd_order_details_screen.dart | 672 ++++++++++++++++++ lib/screens/rd orders/rd_order_screen.dart | 343 +++++++++ lib/screens/splash_screen.dart | 138 ++-- lib/utils/api_urls.dart | 11 +- pubspec.lock | 132 ++-- 10 files changed, 1632 insertions(+), 135 deletions(-) create mode 100644 lib/controller/rd_get_order_controller.dart create mode 100644 lib/controller/rd_get_order_service.dart create mode 100644 lib/models/rd_get_order_model.dart create mode 100644 lib/models/rd_order_item_model.dart create mode 100644 lib/screens/rd orders/rd_order_details_screen.dart create mode 100644 lib/screens/rd orders/rd_order_screen.dart diff --git a/lib/controller/rd_get_order_controller.dart b/lib/controller/rd_get_order_controller.dart new file mode 100644 index 0000000..8c06215 --- /dev/null +++ b/lib/controller/rd_get_order_controller.dart @@ -0,0 +1,34 @@ +import 'package:cheminova/controller/product_mannual_service.dart'; +import 'package:cheminova/controller/rd_get_order_service.dart'; +import 'package:cheminova/models/rd_get_order_model.dart'; +import 'package:get/get.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import '../models/product_mannual_model.dart'; // Your model import +// Your service import + +class GetProductRDController extends GetxController { + var isLoading = true.obs; // Tracks the loading state + var productRDList = [].obs; // List of products + + @override + void onInit() { + fetchRDProduct(); + super.onInit(); + } + + // Fetch the products from the API + Future fetchRDProduct() async { + try { + SharedPreferences prefs = await SharedPreferences.getInstance(); + String? token = prefs.getString('token'); + isLoading(true); // Start loading + final response = await GetProductRDService().getRDProducts(token!); // Fetch products from API + if (response != null) { + productRDList.assignAll(response); // Assign products to the observable list + } + } finally { + isLoading(false); // End loading + } + } +} + diff --git a/lib/controller/rd_get_order_service.dart b/lib/controller/rd_get_order_service.dart new file mode 100644 index 0000000..bea4568 --- /dev/null +++ b/lib/controller/rd_get_order_service.dart @@ -0,0 +1,38 @@ +import 'package:cheminova/models/rd_get_order_model.dart'; + +import '../utils/api_urls.dart'; +import '../utils/common_api_service.dart'; + +class GetProductRDService { + // Method to fetch product manuals using an authorization token + Future?> getRDProducts(String token) async { + try { + String url = ApiUrls.getRdOrderUrl; // Base URL to fetch product manuals + + final response = await commonApiService>( + method: "GET", + url: url, + additionalHeaders: { // Pass the token here + 'Authorization': 'Bearer $token', + }, + fromJson: (json) { + if (json['plcaedOrders'] != null) { + // If the productManuals key is present, map the response to a list of ProductManualModel objects + final List productManuals = (json['plcaedOrders'] as List) + .map((manualJson) => PlacedOrdersResponse.fromJson(manualJson)) + .toList(); + return productManuals; // Return the list of product manuals + } else { + return []; + } + }, + ); + return response; + } catch (e) { + + print("fkfgghgh ,${e.toString()}"); + //print(e.toString()); + return null; + } + } +} \ No newline at end of file diff --git a/lib/models/rd_get_order_model.dart b/lib/models/rd_get_order_model.dart new file mode 100644 index 0000000..892a6b2 --- /dev/null +++ b/lib/models/rd_get_order_model.dart @@ -0,0 +1,297 @@ +import 'dart:convert'; + +import 'package:cheminova/models/rd_order_item_model.dart'; + +//class PlacedOrdersResponse { +// final List placedOrders; +// final int totalOrders; +// +// PlacedOrdersResponse({required this.placedOrders, required this.totalOrders}); +// +// factory PlacedOrdersResponse.fromJson(Map json) { +// return PlacedOrdersResponse( +// placedOrders: (json['placedOrders'] != null +// ? (json['placedOrders'] as List) +// .map((i) => PlacedOrder.fromJson(i)) +// .toList() +// : []), // Fallback to empty list if null +// totalOrders: json['totalOrders'] ?? 0, // Fallback to 0 if null +// ); +// } +// Map toJson() { +// return { +// 'plcaedOrders': placedOrders.map((order) => order.toJson()).toList(), +// 'totalOrders': totalOrders, +// }; +// } +// +// @override +// String toString() { +// return 'PlacedOrdersResponse(placedOrders: $placedOrders, totalOrders: $totalOrders)'; +// } +// } + +// class PlacedOrdersResponse { +// final String id; +// final String paymentMode; +// final String shipTo; +// final String billTo; +// final List orderItems; +// final double subtotal; +// final double gstTotal; +// final double grandTotal; +// final String status; +// final List invoices; +// final String addedBy; +// final String pd; +// final bool isCancelled; +// final bool isDelivered; +// final String deliveredDate; +// final String statusUpdatedAt; +// final String uniqueId; +// final DateTime createdAt; +// final DateTime updatedAt; +// +// final int v; +// +// PlacedOrdersResponse({ +// required this.id, +// required this.paymentMode, +// required this.shipTo, +// required this.billTo, +// required this.orderItems, +// required this.subtotal, +// required this.gstTotal, +// required this.grandTotal, +// required this.status, +// required this.invoices, +// required this.addedBy, +// required this.pd, +// required this.isCancelled, +// required this.isDelivered, +// required this.deliveredDate, +// required this.statusUpdatedAt, +// required this.uniqueId, +// required this.createdAt, +// required this.updatedAt, +// required this.v, +// }); +// +// factory PlacedOrdersResponse.fromJson(Map json) { +// return PlacedOrdersResponse( +// id: json['_id']??22343, +// paymentMode: json['paymentMode']??"uuiu", +// shipTo: json['shipTo']??"iiouui", +// billTo: json['billTo']??"iiouio", +// orderItems: (json['orderItem'] as List) +// .map((i) => OrderItem2.fromJson(i)) +// .toList(), +// subtotal: json['subtotal'].toDouble()??"78787.99", +// gstTotal: json['gstTotal'].toDouble()??"", +// grandTotal: json['grandTotal'].toDouble()??"", +// status: json['status']??"", +// invoices: json['invoices']??"", +// addedBy: json['addedBy']??"", +// pd: json['pd']??"", +// isCancelled: json['iscancelled']??"", +// isDelivered: json['isDelivered']??"", +// deliveredDate: json['DeliveredDate']??"", +// statusUpdatedAt: json['statusUpdatedAt']??"", +// uniqueId: json['uniqueId']??"uyiy", +// createdAt: DateTime.parse(json['createdAt']), +// updatedAt: DateTime.parse(json['updatedAt']), +// v: json['__v'], +// ); +// } +// +// Map toJson() { +// return { +// '_id': id, +// 'paymentMode': paymentMode, +// 'shipTo': shipTo, +// 'billTo': billTo, +// 'orderItem': orderItems.map((item) => item.toJson()).toList(), +// 'subtotal': subtotal, +// 'gstTotal': gstTotal, +// 'grandTotal': grandTotal, +// 'status': status, +// 'invoices': invoices, +// 'addedBy': addedBy, +// 'pd': pd, +// 'iscancelled': isCancelled, +// 'isDelivered': isDelivered, +// 'DeliveredDate': deliveredDate, +// 'statusUpdatedAt': statusUpdatedAt, +// 'uniqueId': uniqueId, +// 'createdAt': createdAt.toIso8601String(), +// 'updatedAt': updatedAt.toIso8601String(), +// '__v': v, +// }; +// } +// +// @override +// String toString() { +// return 'PlacedOrder(id: $id, paymentMode: $paymentMode, shipTo: $shipTo, billTo: $billTo, orderItems: $orderItems, subtotal: $subtotal, gstTotal: $gstTotal, grandTotal: $grandTotal, status: $status, invoices: $invoices, addedBy: $addedBy, pd: $pd, isCancelled: $isCancelled, isDelivered: $isDelivered, deliveredDate: $deliveredDate, statusUpdatedAt: $statusUpdatedAt, uniqueId: $uniqueId, createdAt: $createdAt, updatedAt: $updatedAt, v: $v)'; +// } +// } +// +// class OrderItem2 { +// final String productId; +// final String sku; +// final String name; +// final String categoryName; +// final String brandName; +// final double price; +// final double gst; +// final String hsnCode; +// final String description; +// final List image; +// final int quantity; +// final int remainingQuantity; +// final String id; +// +// OrderItem2({ +// required this.productId, +// required this.sku, +// required this.name, +// required this.categoryName, +// required this.brandName, +// required this.price, +// required this.gst, +// required this.hsnCode, +// required this.description, +// required this.image, +// required this.quantity, +// required this.remainingQuantity, +// required this.id, +// }); +// +// factory OrderItem2.fromJson(Map json) { +// return OrderItem2( +// productId: json['productId']??"", +// sku: json['SKU']??"", +// name: json['name']??"", +// categoryName: json['categoryName']??"", +// brandName: json['brandName']??"", +// price: json['price'].toDouble()??"", +// gst: json['GST'].toDouble()??"", +// hsnCode: json['HSN_Code']??"", +// description: json['description']??"", +// image: json['image']??"", +// quantity: json['quantity']??5, +// remainingQuantity: json['remainingQuantity']??6, +// id: json['_id']??555, +// ); +// } +// +// Map toJson() { +// return { +// 'productId': productId, +// 'SKU': sku, +// 'name': name, +// 'categoryName': categoryName, +// 'brandName': brandName, +// 'price': price, +// 'GST': gst, +// 'HSN_Code': hsnCode, +// 'description': description, +// 'image': image, +// 'quantity': quantity, +// 'remainingQuantity': remainingQuantity, +// '_id': id, +// }; +// } +// +// @override +// String toString() { +// return 'OrderItem(productId: $productId, sku: $sku, name: $name, categoryName: $categoryName, brandName: $brandName, price: $price, gst: $gst, hsnCode: $hsnCode, description: $description, image: $image, quantity: $quantity, remainingQuantity: $remainingQuantity, id: $id)'; +// } +// } + + +class PlacedOrdersResponse { + final String id; + final String paymentMode; + final String shipTo; + final String billTo; + final List orderItem; + final double subtotal; + final double gstTotal; + final double grandTotal; + final String status; + final bool isCancelled; + final bool isDelivered; + final String deliveredDate; + final String statusUpdatedAt; + final String uniqueId; + final String createdAt; + final String updatedAt; + final int version; + + PlacedOrdersResponse({ + required this.id, + required this.paymentMode, + required this.shipTo, + required this.billTo, + required this.orderItem, + required this.subtotal, + required this.gstTotal, + required this.grandTotal, + required this.status, + required this.isCancelled, + required this.isDelivered, + required this.deliveredDate, + required this.statusUpdatedAt, + required this.uniqueId, + required this.createdAt, + required this.updatedAt, + required this.version, + }); + + factory PlacedOrdersResponse.fromJson(Map json) { + return PlacedOrdersResponse( + id: json['_id'] ?? '', // Handle null values or incorrect types + paymentMode: json['paymentMode'] ?? '', + shipTo: json['shipTo'] ?? '', + billTo: json['billTo'] ?? '', + orderItem: (json['orderItem'] as List) + .map((item) => RDOrderItem.fromJson(item)) + .toList(), + subtotal: (json['subtotal'] as num).toDouble(), // Ensure it is double + gstTotal: (json['gstTotal'] as num).toDouble(), // Ensure it is double + grandTotal: (json['grandTotal'] as num).toDouble(), // Ensure it is double + status: json['status'] ?? '', + isCancelled: json['iscancelled'] ?? false, + isDelivered: json['isDelivered'] ?? false, + deliveredDate: json['DeliveredDate'] ?? '', + statusUpdatedAt: json['statusUpdatedAt'] ?? '', + uniqueId: json['uniqueId']?.toString() ?? '', // Ensure this is a String + createdAt: json['createdAt'] ?? '', + updatedAt: json['updatedAt'] ?? '', + version: json['__v'] ?? 0, + ); + } + // Method to convert instance to JSON + Map toJson() { + return { + '_id': id, + 'paymentMode': paymentMode, + 'shipTo': shipTo, + 'billTo': billTo, + 'orderItem': orderItem.map((item) => item.toJson()).toList(), + 'subtotal': subtotal, + 'gstTotal': gstTotal, + 'grandTotal': grandTotal, + 'status': status, + 'iscancelled': isCancelled, + 'isDelivered': isDelivered, + 'DeliveredDate': deliveredDate, + 'statusUpdatedAt': statusUpdatedAt, + 'uniqueId': uniqueId, + 'createdAt': createdAt, + 'updatedAt': updatedAt, + '__v': version, + }; + } +} + diff --git a/lib/models/rd_order_item_model.dart b/lib/models/rd_order_item_model.dart new file mode 100644 index 0000000..e5e7863 --- /dev/null +++ b/lib/models/rd_order_item_model.dart @@ -0,0 +1,82 @@ + + class RDOrderItem { + final String productId; + final String sku; + final String name; + final String categoryName; + final String brandName; + final double price; // Ensure price is double + final int gst; // Ensure GST is int + final int hsnCode; // Ensure HSN_Code is int + final String description; + final List image; + final int quantity; + final int remainingQuantity; + int? processquantity; + RDOrderItem({ + required this.productId, + required this.sku, + required this.name, + required this.categoryName, + required this.brandName, + required this.price, + required this.gst, + required this.hsnCode, + required this.description, + required this.image, + required this.quantity, + required this.remainingQuantity, + this.processquantity, + }); + + factory RDOrderItem.fromJson(Map json) { + return RDOrderItem( + productId: json['productId'] ?? '', + sku: json['SKU'] ?? '', + name: json['name'] ?? '', + categoryName: json['categoryName'] ?? '', + brandName: json['brandName'] ?? '', + price: (json['price'] as num).toDouble(), + // Ensure price is double + gst: json['GST'] ?? 0, + // Handle GST as int + hsnCode: json['HSN_Code'] ?? 0, + // Handle HSN_Code as int + description: json['description'] ?? '', + image: List.from(json['image'] ?? []), + quantity: json['quantity'] ?? 0, + // Handle quantity as int + processquantity: json['processquantity']??1, + remainingQuantity: json['remainingQuantity'] ?? + 0, // Handle remainingQuantity as int + ); + } + + // Method to convert instance to JSON + Map toJson() { + return { + 'productId': productId, + 'SKU': sku, + 'name': name, + 'categoryName': categoryName, + 'brandName': brandName, + 'price': price, + 'GST': gst, + 'HSN_Code': hsnCode, + 'description': description, + 'image': image, + 'quantity': quantity, + 'remainingQuantity': remainingQuantity, + 'processquantity':processquantity, + }; + } + + // Overriding the toString method + @override + String toString() { + return 'RDOrderItem(productId: $productId, sku: $sku, name: $name, categoryName: $categoryName, ' + 'brandName: $brandName, price: $price, gst: $gst, hsnCode: $hsnCode, description: $description, ' + 'image: $image, quantity: $quantity, remainingQuantity: $remainingQuantity, processquantity: $processquantity)'; + } + } + diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index 70ab880..45b6ed2 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -6,6 +6,7 @@ import 'package:cheminova/screens/order/order_tracking_screen.dart'; import 'package:cheminova/screens/order_management/order_management_screen.dart'; import 'package:cheminova/screens/product/product_catalog_screen.dart'; import 'package:cheminova/screens/product/product_mannual.dart'; +import 'package:cheminova/screens/rd%20orders/rd_order_screen.dart'; import 'package:cheminova/screens/report/order_history_report_screen.dart'; import 'package:cheminova/screens/report/reporting_analytics_screen.dart'; import 'package:cheminova/screens/retail/retail_distributer_on_boarding_screen.dart'; @@ -176,7 +177,26 @@ class _HomeScreenState extends State { ], ), + const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + HomeCard( + title: 'RD Orders', + onTap: () => Get.to( + () => RdOrderScreen(), + ), + ), + // HomeCard( + // title: 'Kyc', + // onTap: () => Get.to( + // () => KycRetailerInfoScreen(), + // ), + // ), + + ], + ), ], ), ), diff --git a/lib/screens/rd orders/rd_order_details_screen.dart b/lib/screens/rd orders/rd_order_details_screen.dart new file mode 100644 index 0000000..d5ca64d --- /dev/null +++ b/lib/screens/rd orders/rd_order_details_screen.dart @@ -0,0 +1,672 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:cheminova/controller/get_order_placed_controller.dart'; +import 'package:cheminova/controller/rd_get_order_controller.dart'; +import 'package:cheminova/models/oder_place_model.dart'; +import 'package:cheminova/models/order_item_model.dart'; +import 'package:cheminova/models/place_order_list_model.dart'; +import 'package:cheminova/models/rd_get_order_model.dart'; +import 'package:cheminova/models/rd_order_item_model.dart'; +import 'package:cheminova/models/rd_placed_order_model.dart'; +import 'package:cheminova/screens/rd%20orders/partial_processing_dialog_screen.dart'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:get/get.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:intl/intl.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../../controller/cart_controller.dart'; +import '../../controller/rd_processing_order_controller.dart'; +import '../../models/product_model1.dart'; +import '../../utils/show_snackbar.dart'; + +class RdOrderDetailScreen extends StatefulWidget { + //final Product? productModel; + // PlacedOrderList and PlacedOrderModel are optional parameters passed to this screen + PlacedOrdersResponse? placedOrderList; +// PlacedOrderModel? placedOrderModel; + // Constructor for initializing the screen with placed order details + RdOrderDetailScreen({super.key,this.placedOrderList}); + + @override + State createState() => + _RdOrderDetailScreenState(); +} + + +class _RdOrderDetailScreenState + extends State { + // Controllers for managing cart and placed orders + + final GetProductRDController _getPlacedOrderController = Get.put(GetProductRDController()); + final RDOrderPlacedController controller = Get.put(RDOrderPlacedController()); + String? orderId; + final List statusOptions = [ + "new", + "pending", + "processing", + "dispatched", + "cancelled", + "delivered", + ]; + String selectedStatus = "All"; + String _groupValue = "cheque"; + // Function to format date from the API to a more readable format + + + String formatDate(String apiDate) { + + DateTime parsedDate = DateTime.parse(apiDate); + + String formattedDate = DateFormat('dd-MMM-yyyy').format(parsedDate); + + return formattedDate; + } + // Function to capitalize the first letter of a string + String capitalizeFirstLetter(String text) { + if (text.isEmpty) return text; + return text[0].toUpperCase() + text.substring(1).toLowerCase(); + } + + + void _onPaymentModeChanged(String? value) { + setState(() { + _groupValue = value!; + }); + _saveSelectedPaymentMode(); + } + + + void _saveSelectedPaymentMode() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + await prefs.setString('selectedPaymentMode', _groupValue); + } + + void _loadSelectedPaymentMode() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + setState(() { + _groupValue = prefs.getString('selectedPaymentMode') ?? 'cheque'; + }); + } + // Function to collect unique order IDs and corresponding order details + Future adduni()async { + final Set uniqueOrderIds = {}; + final List uniqueOrders = []; + // Loop through placed orders and add unique orders to the list + for (var order in _getPlacedOrderController.productRDList) { + if (uniqueOrderIds.add(order.uniqueId)) { + uniqueOrders.add(order); + } + } + final order = uniqueOrders[0]; + + // Combine product names, categories, and quantities into strings + final productNames = order.orderItem + .map((item) => (item.name)) + .join(', '); + final categotyName = order.orderItem + .map((item) => (item.categoryName)) + .join(', '); + final quantity = order.orderItem + .map((item) => (item.quantity)) + .join(', '); + } +@override + void initState() { + // TODO: implement initState + super.initState(); + selectedStatus= widget.placedOrderList?.status ?? 'new'; + // controller.fetchOrderItems(widget.placedOrderList!.id); + } + +// Method to show confirmation dialog + void _showConfirmationDialog() { + String dialogTitle; + String dialogContent; + TextEditingController reasonController = TextEditingController(); + + // Set dialog title and content based on selected status + switch (selectedStatus) { + case "processing": + dialogTitle = "Update Order Status"; + dialogContent = "Are you sure you want to update the status to processing?"; + break; + case "partial processing": + dialogTitle = "Update to Partial Processing"; + dialogContent = "Are you sure you want to update the status to 'Partial Processing'?"; + break; + case "cancelled": + dialogTitle = "Cancellation Reason"; + dialogContent = "Please provide a reason for cancelling the order:"; + break; + default: + dialogTitle = "Update Order Status"; + dialogContent = "Are you sure you want to update the status to '$selectedStatus'?"; + break; + } + + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text(dialogTitle), + content: selectedStatus == "cancelled" + ? Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text(dialogContent), + SizedBox(height: 10), // Space between text and text field + TextField( + controller: reasonController, // Text controller for cancellation reason + decoration: InputDecoration( + labelText: 'Cancellation Reason', + border: OutlineInputBorder(), + ), + ), + ], + ) + : Text(dialogContent), + actions: [ + TextButton( + onPressed: () async { + // Check if the selected status is "cancelled" and if necessary reason is provided + if (selectedStatus == "cancelled" && reasonController.text.isEmpty) { + // Show a warning if the reason is empty + Get.snackbar("Error", "Please provide a reason for cancelling the order."); + return; + } + + // Handle "partial processing" status + if (selectedStatus == "partial processing") { + // Navigate to the Partial Processing screen without dismissing the dialog + Get.to(() => PartialProcessingDialogScreen(productModel: widget.placedOrderList)); + return; // Exit to ensure dialog doesn't close yet + } + + List orderItems = _getPlacedOrderController.productRDList.map((product) { + return RDOrderItem( + productId: product.orderItem[0].productId, + sku: product.orderItem[0].sku, + name: product.orderItem[0].name, // You had an empty name in your code + categoryName: product.orderItem[0].categoryName, + brandName: product.orderItem[0].brandName, + price: product.orderItem[0].price, + gst: product.orderItem[0].gst, + hsnCode: product.orderItem[0].hsnCode, // Fixed hsnCode, hashCode was incorrect + description: product.orderItem[0].description, + image: [], // Ensure images are properly handled + quantity: product.orderItem[0].quantity, + remainingQuantity: product.orderItem[0].remainingQuantity, + processquantity: product.orderItem[0].processquantity, + ); + }).toList(); + +// Updating the placedOrder1 with orderId and items + controller.placedOrder1.value = PlacedOrdersProcessing( + orderId: _getPlacedOrderController.productRDList[0].id, + invoiceItems: orderItems, + ); + +// Debugging: Print the JSON payload + print(controller.placedOrder1.value.toJson()); + + await controller.placeRDOrder(); + + // Call your update status method here + + showSnackbar("Order processed and invoice created successfully"); + + // Delay closing the dialog to ensure the user sees the success message + Future.delayed(Duration(seconds: 1), () { + Get.back(); // Close the dialog after a delay + }); + + setState(() {}); // Refresh the UI + }, + child: Text("Confirm"), + ), + TextButton( + onPressed: () { + Get.back(); // Close the dialog + }, + child: Text("Cancel"), + ), + ], + ); + }, + ); + } + + + @override + Widget build(BuildContext context) { + return Scaffold( + extendBodyBehindAppBar: true, + appBar: AppBar( + backgroundColor: Colors.transparent, + elevation: 0, + leading: GestureDetector( + onTap: () {}, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: SvgPicture.asset( + 'assets/svg/menu.svg', + ), + ), + ), + actions: [ + GestureDetector( + onTap: () => Get.back(), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset( + 'assets/svg/back_arrow.svg', + ), + ), + ), + ], + title: const Text( + "Order Detail", + ), + ), + body: Stack( + fit: StackFit.expand, + children: [ + Image.asset( + 'assets/images/image_1.png', + fit: BoxFit.cover, + ), + SafeArea( + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: Get.height * 0.02, + ), + Card( + margin: const EdgeInsets.symmetric(horizontal: 18), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(19), + side: const BorderSide(color: Color(0xFFFDFDFD)), + ), + color: const Color(0xFFB4D1E5).withOpacity(0.9), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + + Card( + child: Column( + children: [ + SizedBox( + width: Get.width, + child: Padding( + padding: + const EdgeInsets.fromLTRB(8, 8, 8, 0), + child: Text( + "Order Summary", + style: GoogleFonts.roboto( + fontSize: Get.width * 0.05, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + _buildRow("Order ID:", widget.placedOrderList!.uniqueId, Get.width * 0.04), + _buildRow("Order Date:", formatDate("${widget.placedOrderList!.createdAt}"), Get.width * 0.04), + _buildRow("Total Items:", "${widget.placedOrderList!.orderItem.length}", Get.width * 0.04), + _buildRow("Sub Total:", "₹ ${widget.placedOrderList!.subtotal}", Get.width * 0.04), + _buildRow("GST:", "₹ ${widget.placedOrderList!.gstTotal}", Get.width * 0.04), + _buildRow("Total Amount:", "₹ ${widget.placedOrderList!.grandTotal}", Get.width * 0.04), + + + ], + ), + ), + const SizedBox(height: 8), + Card( + child: SizedBox( + height: Get.height * 0.22, + child: Padding( + padding: EdgeInsets.all(Get.width * 0.02), + child: ListView.builder( + padding: EdgeInsets.zero, + itemCount: widget.placedOrderList?.orderItem.length ?? 0, + itemBuilder: (context, index) { + final orderItem = widget.placedOrderList!.orderItem[index]; + return orderItem != null + ? Card( + margin: const EdgeInsets.symmetric(vertical: 5.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Image.asset( + "assets/images/product.png", // Add the image URL here + height: 50, + width: 50, + fit: BoxFit.cover, + ), + const SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + capitalizeFirstLetter(orderItem.name), + style: GoogleFonts.roboto( + fontSize: Get.width * 0.04, + fontWeight: FontWeight.bold, + ), + ), + Text( + "Quantity: ${orderItem.quantity}", + style: GoogleFonts.roboto( + fontSize: Get.width * 0.03, + ), + ), + Text("Price: ${orderItem.price}"), + Text("Subtotal : ${widget.placedOrderList!.subtotal}"), + Text("Gst : ${orderItem.gst}%"), + Text("GST : ${widget.placedOrderList!.gstTotal}"), + Text("Total Amount : ${widget.placedOrderList!.grandTotal}"), + ], + ), + ), + ], + ), + ), + ) + : const SizedBox.shrink(); + }, + ), + ), + ), + ), + const SizedBox(height: 8), + SizedBox( + height: Get.height* 0.19, + child: Card( + child: Column( + children: [ + SizedBox( + width: Get.width, + child: Padding( + padding: + const EdgeInsets.fromLTRB(8, 8, 8, 0), + child: Text( + "Customer Details", + style: GoogleFonts.roboto( + fontSize: Get.width * 0.05, + fontWeight: FontWeight.w500, + ), + ), + ), + ), + _buildRow("Name:", "VAIBHAV", Get.width * 0.04), + _buildRow("Email:", "vaibhav.gurjar20001@gmail.com", Get.width * 0.04), + _buildRow("Mobile Number:", "7779797976", Get.width * 0.04), + + + ], + ), + ), + ), + const SizedBox(height: 8), + Card( + child: Column( + children: [ + SizedBox( + width: Get.width, + child: Padding( + padding: + const EdgeInsets.fromLTRB(8, 8, 8, 0), + child: Text( + "Billing Information", + style: GoogleFonts.roboto( + fontSize: Get.width * 0.05, + fontWeight: FontWeight.w500, + ), + ), + ), + ), + _buildInfoRow("Address", widget.placedOrderList!.billTo, Get.width * 0.04) + + ], + ), + ), + const SizedBox(height: 8), + // Card for displaying shipping information + Card( + child: Column( + children: [ + SizedBox( + width: Get.width, + child: Padding( + padding: + const EdgeInsets.fromLTRB(8, 8, 8, 0), + child: Text( + "Shipping Information", + style: GoogleFonts.roboto( + fontSize: Get.width * 0.05, + fontWeight: FontWeight.w500, + ), + ), + ), + ), + _buildInfoRow("Address", widget.placedOrderList!.shipTo, Get.width * 0.04) + + + ], + ), + ), + const SizedBox(height: 8), + Card( + child: Column( + children: [ + SizedBox( + width: Get.width, + height: Get.height*0.05, + child: Padding( + padding: + const EdgeInsets.fromLTRB(8, 8, 8, 0), + child: Row( + children: [ + Text( + "Payment Mode : ", + style: GoogleFonts.roboto( + fontSize: Get.width * 0.04, + fontWeight: FontWeight.w500, + ), + ), + Text(capitalizeFirstLetter(widget.placedOrderList!.paymentMode)), + // Text("${widget.placedOrderList!.paymentMode}",maxLines: 4, + // overflow:TextOverflow.ellipsis,) + ], + ), + ), + ), + + + ], + ), + ), + const SizedBox(height: 8), + Card( + child: Column( + children: [ + SizedBox( + width: Get.width, + height: Get.height*0.05, + child: Padding( + padding: + const EdgeInsets.fromLTRB(8, 8, 8, 0), + child: Row( + children: [ + Text( + "Order Status :", + style: GoogleFonts.roboto( + fontSize: Get.width * 0.04, + fontWeight: FontWeight.w500, + ), + ), + SizedBox(width: Get.width*0.01,), + Text(capitalizeFirstLetter(selectedStatus)), + // Text("${widget.placedOrderList!.status}",maxLines: 4, + // overflow:TextOverflow.ellipsis,) + ], + ), + ), + ), + + + ], + ), + ), + const SizedBox(height: 8), + SizedBox( + height: Get.height * 0.05, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Text( + "Status: ", + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(width: 10), // Space between label and dropdown + Expanded( + child: DropdownButtonFormField( + value: selectedStatus, + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, // White background + contentPadding: EdgeInsets.symmetric( + vertical: 10, horizontal: 12), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide( + color: Colors.grey, + width: 1, + ), + ), + ), + items: [ + "new", + "processing", + "partial processing", + "cancelled", + + ].map((String status) { + return DropdownMenuItem( + value: status, + child: Text(capitalizeFirstLetter(status)), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + selectedStatus = newValue!; + }); + }, + ), + ), + ], + ), + ), + if (selectedStatus == "processing" || + selectedStatus == "partial processing" || + selectedStatus == "cancelled") + SizedBox( + width: Get.width * 0.4, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: ElevatedButton( + onPressed: () { + // Show confirmation dialog + _showConfirmationDialog(); + }, + // Get.to(() => + // RdOrderDetailScreen( + // placedOrderList: uniqueOrders[index])), // Navigate to detail screen + style: ElevatedButton.styleFrom( + foregroundColor: Colors.white, + backgroundColor: const Color(0xFF004791), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10)), + ), + child: Text("Update Status", style: GoogleFonts.roboto(fontSize: 14, fontWeight: FontWeight.w400)), + ), + ), + ) + + ], + ), + ), + ), + SizedBox(height: Get.height * 0.04), + + ], + ), + ), + ), + ], + ), + ); + } +} +Widget _buildRow(String label, String value, double fontSize) { + return SizedBox( + width: Get.width, + child: Padding( + padding: const EdgeInsets.fromLTRB(8, 8, 8, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + label, + style: GoogleFonts.roboto( + fontSize: fontSize, + fontWeight: FontWeight.bold, + ), + ), + Text(value), + ], + ), + ), + ); +} + +Widget _buildInfoRow(String label, String value, double fontSize) { + return SizedBox( + width: Get.width, + child: Padding( + padding: const EdgeInsets.fromLTRB(8, 8, 8, 0), + child: Row( + children: [ + Text( + "$label ", + style: GoogleFonts.roboto( + fontSize: fontSize, + fontWeight: FontWeight.bold, + ), + ), + Expanded( + child: Text( + value, + maxLines: 4, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ), + ); + +} diff --git a/lib/screens/rd orders/rd_order_screen.dart b/lib/screens/rd orders/rd_order_screen.dart new file mode 100644 index 0000000..31d393a --- /dev/null +++ b/lib/screens/rd orders/rd_order_screen.dart @@ -0,0 +1,343 @@ + +import 'package:cheminova/controller/rd_get_order_controller.dart'; +import 'package:cheminova/models/rd_get_order_model.dart'; +import 'package:cheminova/screens/rd%20orders/rd_cancelled_screen.dart'; +import 'package:cheminova/screens/rd%20orders/rd_delivered_screen.dart'; +import 'package:cheminova/screens/rd%20orders/rd_dispatched_scree.dart'; +import 'package:cheminova/screens/rd%20orders/rd_order_details_screen.dart'; +import 'package:cheminova/screens/rd%20orders/rd_pending_screen.dart'; +import 'package:cheminova/screens/rd%20orders/rd_processing_screen.dart'; +import 'package:cheminova/widgets/input_field.dart'; +import 'package:cheminova/widgets/my_drawer.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:get/get.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:intl/intl.dart'; + +import '../order_management/order_management_detail_screen.dart'; + +class RdOrderScreen extends StatefulWidget { + final PlacedOrdersResponse? getrdProduct; + + RdOrderScreen({super.key, this.getrdProduct}); + + @override + State createState() => _RdOrderScreenState(); +} + +class _RdOrderScreenState extends State { + final _searchController = TextEditingController(); + final List _filterList = [ "new", + "pending", + "processing", + "dispatched", + "cancelled", + "delivered",]; + int _selectedIndex = 0; + final GetProductRDController _getRdProductController = Get.put(GetProductRDController()); + final GlobalKey _refreshIndicatorKey = GlobalKey(); + + @override + void initState() { + super.initState(); + getOrder1(); + } + + Future _onRefresh() async { + await getOrder1(); + await Future.delayed(Duration(seconds: 1)); + } + + Future getOrder1() async { + await _getRdProductController.fetchRDProduct(); + if (_getRdProductController.productRDList.isEmpty) { + print("No orders found."); + } else { + print("Orders fetched successfully"); + } + } + + String capitalizeFirstLetter(String text) { + if (text.isEmpty) return text; + return text[0].toUpperCase() + text.substring(1).toLowerCase(); + } + + String formatDate(String apiDate) { + DateTime parsedDate = DateTime.parse(apiDate); + String formattedDate = DateFormat('dd-MMM-yyyy').format(parsedDate); + return formattedDate; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + extendBodyBehindAppBar: true, + appBar: AppBar( + centerTitle: true, + backgroundColor: Colors.transparent, + elevation: 0, + leading: Builder( + builder: (context) { + return GestureDetector( + onTap: () => Scaffold.of(context).openDrawer(), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: SvgPicture.asset('assets/svg/menu.svg'), + ), + ); + }, + ), + actions: [ + GestureDetector( + onTap: () => Get.back(), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset('assets/svg/back_arrow.svg'), + ), + ), + ], + title: const Text("RD Order"), + ), + drawer: MyDrawer(), + body: Stack( + fit: StackFit.expand, + children: [ + Image.asset('assets/images/image_1.png', fit: BoxFit.cover), + SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), + child: RefreshIndicator( + key: _refreshIndicatorKey, + onRefresh: _onRefresh, + color: Colors.black, + backgroundColor: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + InputField( + hintText: "Search Order", + labelText: "Search Order", + controller: _searchController, + ), + SizedBox(height: Get.height * 0.035), + Card( + margin: const EdgeInsets.symmetric(horizontal: 18), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(19), + side: const BorderSide(color: Color(0xFFFDFDFD)), + ), + color: const Color(0xFFB4D1E5).withOpacity(0.9), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + height: Get.height * 0.05, + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.horizontal, + itemCount: _filterList.length, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: GestureDetector( + onTap: () { + setState(() { + _selectedIndex = index; // Update selected index + }); + // Navigate to different screens based on selected tab + switch (_filterList[index]) { + case "new": + // Get.to(YourScreen1()); // Navigate to "new" orders screen + break; + case "pending": + Get.to(RdOrderPendingScreen()); // Navigate to "pending" orders screen + break; + case "processing": + Get.to(RdOrderProcessingScreen()); // Navigate to "processing" orders screen + break; + // Add more cases for other statuses + case "dispatched": + Get.to(RdDispatchedScreen()); // Navigate to dispatched orders + break; + case "cancelled": + Get.to(RdCancelledScreen()); // Navigate to cancelled orders + break; + case "delivered": + Get.to(RdDeliveredScreen()); // Navigate to delivered orders + break; + default: + // Get.to(YourScreen1()); // Default screen + } + }, + child: Chip( + label: Text(capitalizeFirstLetter( _filterList[index]) + , + style: GoogleFonts.roboto( + fontSize: 14, + fontWeight: FontWeight.w500, + color: _selectedIndex == index ? Colors.white : Colors.black, // Change color when selected + ), + ), + backgroundColor: _selectedIndex == index ? const Color(0xFF004791) : Colors.grey[100], // Change color when selected + ), + ), + ), + ), + ), + SizedBox( + height: Get.height * 0.6, + child: Obx(() { + // if (_getRdProductController.productRDList.isEmpty) { + // return Center( + // child: Text( + // 'No Orders Found', + // style: GoogleFonts.roboto(fontSize: 14), + // ), + // ); + // } + + final Set uniqueOrderIds = {}; + final List uniqueOrders = []; + + for (var order in _getRdProductController.productRDList) { + if (uniqueOrderIds.add(order.id)) { + uniqueOrders.add(order); + } + } + + if (uniqueOrders.isEmpty) { + return Center( + child: Text( + 'No Orders Found', + style: GoogleFonts.roboto(fontSize: 14), + ), + ); + } + + return ListView.builder( + padding: EdgeInsets.zero, + shrinkWrap: true, + itemCount: uniqueOrders.length, + itemBuilder: (context, index) { + final order = uniqueOrders[index]; + + // Combine product names into a single string + final productNames = order.orderItem + .map((item) => capitalizeFirstLetter(item.name)) + .join(', '); + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Card( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(16, 8, 8, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("Order ID: ", style: GoogleFonts.roboto(fontSize: 14, fontWeight: FontWeight.bold)), + Text("${order.uniqueId}") + ], + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(16, 8, 8, 0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, // Aligns the Column to the top of the Text + children: [ + Text( + "Product Names: ", + style: GoogleFonts.roboto( + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, // Aligns text to the right within the Column + children: [ + const SizedBox(height: 4), // Adds a small space between the label and the product names + for (int i = 0; i < productNames.split(",").length; i++) + Text( + '${i + 1}. ${productNames.split(",")[i].trim()}', // Adds index and trims whitespace + textAlign: TextAlign.left, // Aligns text to the right + style: GoogleFonts.roboto( + fontSize: 14, + ), + ), + ], + ), + ), + ], + ), + ), + + + Padding( + padding: const EdgeInsets.fromLTRB(16, 8, 8, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("Order Date: ", style: GoogleFonts.roboto(fontSize: 14, fontWeight: FontWeight.bold)), + Text(formatDate("${order.createdAt}")) + ], + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(16, 8, 8, 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("Status: ", style: GoogleFonts.roboto(fontSize: 14, fontWeight: FontWeight.bold)), + Text(capitalizeFirstLetter("${order.status}")) + ], + ), + ), + SizedBox( + width: Get.width * 0.4, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: ElevatedButton( + onPressed: ()=> + Get.to(() => + RdOrderDetailScreen( + placedOrderList: uniqueOrders[index])), // Navigate to detail screen + style: ElevatedButton.styleFrom( + foregroundColor: Colors.white, + backgroundColor: const Color(0xFF004791), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10)), + ), + child: Text("View Details", style: GoogleFonts.roboto(fontSize: 14, fontWeight: FontWeight.w400)), + ), + ), + ) + ], + ), + ), + ); + }, + ); + }), + ) + ], + ), + ), + ), + ], + ), + ), + ), + ), + ), + ], + ), + ); + } +} + diff --git a/lib/screens/splash_screen.dart b/lib/screens/splash_screen.dart index c4ff951..78f5049 100644 --- a/lib/screens/splash_screen.dart +++ b/lib/screens/splash_screen.dart @@ -24,84 +24,86 @@ class _SplashScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - body: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.fromLTRB( - Get.width * 0.07, 0, Get.width * 0.07, Get.height * 0.01), - child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage( - 'assets/images/px_cheminova_svg.png', + body: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.fromLTRB( + Get.width * 0.07, 0, Get.width * 0.07, Get.height * 0.01), + child: Container( + decoration: const BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage( + 'assets/images/px_cheminova_svg.png', + ), ), ), - ), - child: SizedBox( - width: Get.width * 0.8, - height: Get.height * 0.05, - ), - ), - ), - Container( - margin: EdgeInsets.only(bottom: Get.height * 0.1), - child: Text( - 'HELPING YOU GROW', - style: GoogleFonts.getFont( - 'Roboto', - fontWeight: FontWeight.w500, - fontSize: Get.textScaleFactor * 20, - height: 1.3, - color: const Color(0xFF000000), - ), - ), - ), - Container( - margin: EdgeInsets.only(bottom: Get.height * 0.15), - child: Container( - decoration: const BoxDecoration( - image: DecorationImage( - fit: BoxFit.cover, - image: AssetImage( - 'assets/images/plant_png_barter_new_sales_ims_barter_trade_exchange_network_33.png', - ), + child: SizedBox( + width: Get.width * 0.8, + height: Get.height * 0.05, ), ), - child: SizedBox( - width: Get.width * 0.8, - height: Get.height * 0.4, + ), + Container( + margin: EdgeInsets.only(bottom: Get.height * 0.1), + child: Text( + 'HELPING YOU GROW', + style: GoogleFonts.getFont( + 'Roboto', + fontWeight: FontWeight.w500, + fontSize: Get.textScaleFactor * 20, + height: 1.3, + color: const Color(0xFF000000), + ), ), ), - ), - Container( - margin: EdgeInsets.only(bottom: Get.height * 0.03), - child: Text( - 'Powered By', - style: GoogleFonts.getFont( - 'Roboto', - fontWeight: FontWeight.w500, - fontSize: Get.textScaleFactor * 12, - color: const Color(0xFF000000), + Container( + margin: EdgeInsets.only(bottom: Get.height * 0.15), + child: Container( + decoration: const BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage( + 'assets/images/plant_png_barter_new_sales_ims_barter_trade_exchange_network_33.png', + ), + ), + ), + child: SizedBox( + width: Get.width * 0.8, + height: Get.height * 0.4, + ), ), ), - ), - SizedBox( - height: Get.height * 0.03, - child: Text( - 'codeology.solutions', - style: GoogleFonts.getFont( - 'Roboto', - fontWeight: FontWeight.w500, - fontSize: Get.textScaleFactor * 14, - height: 1.8, - color: const Color(0xFF000000), + Container( + margin: EdgeInsets.only(bottom: Get.height * 0.03), + child: Text( + 'Powered By', + style: GoogleFonts.getFont( + 'Roboto', + fontWeight: FontWeight.w500, + fontSize: Get.textScaleFactor * 12, + color: const Color(0xFF000000), + ), ), ), - ), - ], + SizedBox( + height: Get.height * 0.03, + child: Text( + 'codeology.solutions', + style: GoogleFonts.getFont( + 'Roboto', + fontWeight: FontWeight.w500, + fontSize: Get.textScaleFactor * 14, + height: 1.8, + color: const Color(0xFF000000), + ), + ), + ), + ], + ), ), ); } diff --git a/lib/utils/api_urls.dart b/lib/utils/api_urls.dart index 4cb5822..133bd9c 100644 --- a/lib/utils/api_urls.dart +++ b/lib/utils/api_urls.dart @@ -40,5 +40,14 @@ class ApiUrls { static const String updateKycUrl = '${baseUrl}/api/kyc/update'; //============================== Rd Order Details ==============================// - static const String getRdOrderUrl = '${baseUrl}/api/pd-get-new-orders'; + static const String getRdOrderUrl = '/api/pd-get-new-orders'; + +//============================== Rd Processing Details ==============================// + static const String getRdOrderProcessingUrl = '/api/pd-process-order'; + + //============================== Rd Cancel Details ==============================// + static const String rdCancleOrderUrl = ' api/pd-cancel-order'; + + + } diff --git a/pubspec.lock b/pubspec.lock index 4f0272f..5250f60 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: ddc6f775260b89176d329dee26f88b9469ef46aa3228ff6a0b91caf2b2989692 + sha256: "5534e701a2c505fed1f0799e652dd6ae23bd4d2c4cf797220e5ced5764a7c1c2" url: "https://pub.dev" source: hosted - version: "1.3.42" + version: "1.3.44" args: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" csc_picker: dependency: "direct main" description: @@ -133,18 +133,18 @@ packages: dependency: "direct main" description: name: dio - sha256: e17f6b3097b8c51b72c74c9f071a605c47bcc8893839bd66732457a5ebe73714 + sha256: "5598aa796bbf4699afd5c67c0f5f6e2ed542afc956884b9cd58c306966efc260" url: "https://pub.dev" source: hosted - version: "5.5.0+1" + version: "5.7.0" dio_web_adapter: dependency: transitive description: name: dio_web_adapter - sha256: "36c5b2d79eb17cdae41e974b7a8284fec631651d2a6f39a8a2ff22327e90aeac" + sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.0" fake_async: dependency: transitive description: @@ -157,10 +157,10 @@ packages: dependency: transitive description: name: ffi - sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" file: dependency: transitive description: @@ -173,18 +173,18 @@ packages: dependency: transitive description: name: file_selector_linux - sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + sha256: "712ce7fab537ba532c8febdb1a8f167b32441e74acd68c3ccb2e36dcb52c4ab2" url: "https://pub.dev" source: hosted - version: "0.9.2+1" + version: "0.9.3" file_selector_macos: dependency: transitive description: name: file_selector_macos - sha256: f42eacb83b318e183b1ae24eead1373ab1334084404c8c16e0354f9a3e55d385 + sha256: cb284e267f8e2a45a904b5c094d2ba51d0aabfc20b1538ab786d9ef7dc2bf75c url: "https://pub.dev" source: hosted - version: "0.9.4" + version: "0.9.4+1" file_selector_platform_interface: dependency: transitive description: @@ -197,98 +197,98 @@ packages: dependency: transitive description: name: file_selector_windows - sha256: "2ad726953f6e8affbc4df8dc78b77c3b4a060967a291e528ef72ae846c60fb69" + sha256: "8f5d2f6590d51ecd9179ba39c64f722edc15226cc93dcc8698466ad36a4a85a4" url: "https://pub.dev" source: hosted - version: "0.9.3+2" + version: "0.9.3+3" firebase_analytics: dependency: "direct main" description: name: firebase_analytics - sha256: "7b5ae39d853ead76f9d030dc23389bfec4ea826d7cccb4eea4873dcb0cdd172b" + sha256: "2c4e7b548d41b46e8aa08bc3bd1163146be7e6d48f678f2e6dd3114994e42458" url: "https://pub.dev" source: hosted - version: "11.3.1" + version: "11.3.3" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface - sha256: "0205e05bb37abd29d5dec5cd89aeb04f3f58bf849aad21dd938be0507d52a40c" + sha256: c259ae890c7d4c5d1675d35936be0b1fcd587fce9645948982cd87ad08df6222 url: "https://pub.dev" source: hosted - version: "4.2.3" + version: "4.2.5" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web - sha256: "434807f8b30526e21cc062410c28ee5c6680a13626c4443b5ffede29f84b0c74" + sha256: "5988d1fd022e55515c2a14811c9b5104c32acde115874a9a69ff7c77c4c05cd9" url: "https://pub.dev" source: hosted - version: "0.5.10" + version: "0.5.10+2" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "40921de9795fbf5887ed5c0adfdf4972d5a8d7ae7e1b2bb98dea39bc02626a88" + sha256: "51dfe2fbf3a984787a2e7b8592f2f05c986bfedd6fdacea3f9e0a7beb334de96" url: "https://pub.dev" source: hosted - version: "3.4.1" + version: "3.6.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: f7d7180c7f99babd4b4c517754d41a09a4943a0f7a69b65c894ca5c68ba66315 + sha256: e30da58198a6d4b49d5bce4e852f985c32cb10db329ebef9473db2b9f09ce810 url: "https://pub.dev" source: hosted - version: "5.2.1" + version: "5.3.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: f4ee170441ca141c5f9ee5ad8737daba3ee9c8e7efb6902aee90b4fbd178ce25 + sha256: f967a7138f5d2ffb1ce15950e2a382924239eaa521150a8f144af34e68b3b3e5 url: "https://pub.dev" source: hosted - version: "2.18.0" + version: "2.18.1" firebase_crashlytics: dependency: "direct main" description: name: firebase_crashlytics - sha256: c4fdbb14ba6f36794f89dc27fb5c759c9cc67ecbaeb079edc4dba515bbf9f555 + sha256: "6899800fff1af819955aef740f18c4c8600f8b952a2a1ea97bc0872ebb257387" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.1.3" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface - sha256: "891d6f7ba4b93672d0e1265f27b6a9dccd56ba2cc30ce6496586b32d1d8770ac" + sha256: "97c47b0a1779a3d4118416a3f0c6c564cc59ad89095e899893204d4b2ad08f4c" url: "https://pub.dev" source: hosted - version: "3.6.42" + version: "3.6.44" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: cc02c4afd6510cd84586020670140c4a23fbe52af16cd260ccf8ede101bb8d1b + sha256: eb6e28a3a35deda61fe8634967c84215efc19133ba58d8e0fc6c9a2af2cba05e url: "https://pub.dev" source: hosted - version: "15.1.1" + version: "15.1.3" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: d8a4984635f09213302243ea670fe5c42f3261d7d8c7c0a5f7dcd5d6c84be459 + sha256: b316c4ee10d93d32c033644207afc282d9b2b4372f3cf9c6022f3558b3873d2d url: "https://pub.dev" source: hosted - version: "4.5.44" + version: "4.5.46" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: "258b9d637965db7855299b123533609ed95e52350746a723dfd1d8d6f3fac678" + sha256: d7f0147a1a9fe4313168e20154a01fd5cf332898de1527d3930ff77b8c7f5387 url: "https://pub.dev" source: hosted - version: "3.9.0" + version: "3.9.2" fixnum: dependency: transitive description: @@ -314,10 +314,10 @@ packages: dependency: "direct main" description: name: flutter_local_notifications - sha256: c500d5d9e7e553f06b61877ca6b9c8b92c570a4c8db371038702e8ce57f8a50f + sha256: "49eeef364fddb71515bc78d5a8c51435a68bccd6e4d68e25a942c5e47761ae71" url: "https://pub.dev" source: hosted - version: "17.2.2" + version: "17.2.3" flutter_local_notifications_linux: dependency: transitive description: @@ -596,18 +596,18 @@ packages: dependency: transitive description: name: path_provider - sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "30c5aa827a6ae95ce2853cdc5fe3971daaac00f6f081c419c013f7f57bff2f5e" + sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" url: "https://pub.dev" source: hosted - version: "2.2.7" + version: "2.2.10" path_provider_foundation: dependency: transitive description: @@ -684,58 +684,58 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180 + sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "3d4571b3c5eb58ce52a419d86e655493d0bc3020672da79f72fa0c16ca3a8ec1" + sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e" url: "https://pub.dev" source: hosted - version: "2.2.4" + version: "2.3.2" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7" + sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.5.2" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.1" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "034650b71e73629ca08a0bd789fd1d83cc63c2d1e405946f7cef7bc37432f93a" + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf + sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.4.2" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.1" sky_engine: dependency: transitive description: flutter @@ -913,10 +913,10 @@ packages: dependency: transitive description: name: url_launcher_macos - sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" + sha256: "769549c999acdb42b8bcfa7c43d72bf79a382ca7441ab18a808e101149daf672" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.1" url_launcher_platform_interface: dependency: transitive description: @@ -945,10 +945,10 @@ packages: dependency: transitive description: name: uuid - sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77 + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff url: "https://pub.dev" source: hosted - version: "4.5.0" + version: "4.5.1" vector_graphics: dependency: transitive description: @@ -993,10 +993,10 @@ packages: dependency: transitive description: name: web - sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" win32: dependency: transitive description: @@ -1009,10 +1009,10 @@ packages: dependency: transitive description: name: win32_registry - sha256: "723b7f851e5724c55409bb3d5a32b203b3afe8587eaf5dafb93a5fed8ecda0d6" + sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852" url: "https://pub.dev" source: hosted - version: "1.1.4" + version: "1.1.5" xdg_directories: dependency: transitive description: