added buypoint upload

This commit is contained in:
Mohamed Nouffer
2023-09-15 18:11:13 +05:30
parent 63a86d75d6
commit 67c3a46cd5

View File

@ -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<void> makeCheckin(