Update project
This commit is contained in:
@@ -347,13 +347,39 @@ class _CartPageState extends State<CartPage> {
|
||||
const Padding(
|
||||
padding: EdgeInsets.all(6.0),
|
||||
child: Text(
|
||||
'No slots available for today.\nPlease try changing dates to schedule orders.',
|
||||
'Your cart is empty.\nBrowse our products to get started.',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
SizedBox(
|
||||
width: 200,
|
||||
height: 46,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
// Switch to the Stores tab (index 1) via the shared GetX controller
|
||||
Get.find<BottomNavController>().currentIndex.value = 1;
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: ColorConstants.primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
'Browse Products',
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ import '../../constants/font_constants.dart';
|
||||
import '../../controllers/cart_controller/cart.dart';
|
||||
import '../../controllers/order_controller/create_order_controller.dart';
|
||||
import '../../modules/orders/create_order.dart';
|
||||
import '../../service/firebase_analytics/analytics_service.dart';
|
||||
import '../../widgets/text_widget.dart';
|
||||
import '../orders/order_succes.dart';
|
||||
|
||||
@@ -99,12 +100,25 @@ class _OrderCountdownPageState extends State<OrderCountdownPage>
|
||||
|
||||
|
||||
if (!widget.orderCtrl.isLoading.value) {
|
||||
|
||||
await AnalyticsService.logEvent(
|
||||
'order_placed',
|
||||
parameters: {
|
||||
'customer_id': widget.order.customerid ?? 0,
|
||||
'tenant_id': widget.order.tenantid ?? 0,
|
||||
'item_count': widget.order.items?.length ?? 0,
|
||||
'payment_type': widget.order.paymenttype ?? 0,
|
||||
},
|
||||
);
|
||||
|
||||
Get.offAll(() => OrderSuccessView());
|
||||
widget.cartCtrl.clearCart();
|
||||
await widget.cartCtrl.notifyAdmin(
|
||||
title: 'Nearle Deals - New Order',
|
||||
body: 'A new order has been placed successfully by ${widget.customerName}!',
|
||||
);
|
||||
print('jeee');
|
||||
print(widget.order.toJson());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user