From 67c3a46cd538369c2c0a1f1eb56a22015448cd28 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Fri, 15 Sep 2023 18:11:13 +0530 Subject: [PATCH] added buypoint upload --- .../destination/destination_controller.dart | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/pages/destination/destination_controller.dart b/lib/pages/destination/destination_controller.dart index e2209c8..8031177 100644 --- a/lib/pages/destination/destination_controller.dart +++ b/lib/pages/destination/destination_controller.dart @@ -629,6 +629,29 @@ class DestinationController extends GetxController { await db.updateBuyPoint(destination, imageurl); PopulateDestinations(); await GallerySaver.saveImage(imageurl); + + if (indexController.currentUser.isNotEmpty) { + double cpNum = destination.cp!; + + int userId = indexController.currentUser[0]["user"]["id"]; + //print("--- Pressed -----"); + String _team = indexController.currentUser[0]["user"]['team_name']; + //print("--- _team : ${_team}-----"); + String _event_code = indexController.currentUser[0]["user"]["event_code"]; + //print("--- _event_code : ${_event_code}-----"); + String _token = indexController.currentUser[0]["token"]; + //print("--- _token : ${_token}-----"); + DateTime now = DateTime.now(); + String formattedDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(now); + + print("------ checkin event $_event_code ------"); + ExternalService() + .makeCheckpoint(userId, _token, formattedDate, _team, cpNum.round(), + _event_code, imageurl) + .then((value) { + print("------Ext service check point $value ------"); + }); + } } Future makeCheckin(