update for permission and destination ordering

This commit is contained in:
Mohamed Nouffer
2023-01-19 16:39:25 +05:30
parent 07653e9b9e
commit cf14a85eaf
5 changed files with 99 additions and 40 deletions

View File

@ -643,6 +643,25 @@ class DestinationController extends GetxController {
}
void toggleSelection(Destination dest) async {
DatabaseHelper db = DatabaseHelper.instance;
await db.toggleSelecttion(dest);
destinations.clear();
db.getDestinations().then((value){
destinationCount.value = 0;
currentSelectedDestinations.clear();
for(Destination d in value){
//print("------ destination controller populating destination-------- ${d.checkedin}-------- :::::");
//print("-----populated----- ${d.toMap()}");
if(d.selected!){
currentSelectedDestinations.add(d);
}
destinations.add(d);
}
destinationCount.value = destinations.length;
});
}
void PopulateDestinations(){
print("--------- destination controller populsting destinations ----------- ::::::");