From c6eb97bbb2312d0ef121f1d11814c9fcb161c625 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Fri, 8 Mar 2024 18:19:18 +0530 Subject: [PATCH] updated for retain rogainin after goal --- lib/pages/destination/destination_controller.dart | 8 +++++--- lib/services/external_service.dart | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/pages/destination/destination_controller.dart b/lib/pages/destination/destination_controller.dart index d671559..d042a49 100644 --- a/lib/pages/destination/destination_controller.dart +++ b/lib/pages/destination/destination_controller.dart @@ -425,7 +425,7 @@ class DestinationController extends GetxController { return; } - Future resetRogaining() async { + Future resetRogaining({bool isgoal = false}) async { //print("----- resetting --------"); isInCheckin.value = false; @@ -442,8 +442,10 @@ class DestinationController extends GetxController { DatabaseHelper db = DatabaseHelper.instance; - await db.deleteAllDestinations(); - await db.deleteAllRogaining(); + if (isgoal == false) { + await db.deleteAllDestinations(); + await db.deleteAllRogaining(); + } int? latgoal = await db.latestGoal(); if (latgoal != null) { diff --git a/lib/services/external_service.dart b/lib/services/external_service.dart index 3560319..a3b1905 100644 --- a/lib/services/external_service.dart +++ b/lib/services/external_service.dart @@ -300,7 +300,7 @@ class ExternalService { } } //} - destinationController.resetRogaining(); + destinationController.resetRogaining(isgoal: true); return res2; }