second commit

This commit is contained in:
Anbarasu
2026-05-27 10:35:09 +05:30
parent c53794c04c
commit 1435ac47b0
501 changed files with 52818 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
import 'package:get/get.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../Data/Repository/Location/GetLocation/getlocationrepository.dart';
import '../../../Model/Response/Tenantlocation/Getlocationbyidresponse.dart';
class LocationController extends GetxController{
int? tenantId;
int? moduleId;
List<TenantLocationDetails>locations = [];
bool shimmer = true;
GetLocationsRepository getLocationsRepository= GetLocationsRepository();
getLocation()async{
SharedPreferences prefs = await SharedPreferences.getInstance();
tenantId = prefs.getInt('tenantId')??0;
moduleId = prefs.getInt('moduleId')??0;
GetLocationByTenantId? result = await getLocationsRepository.getLocationById();
getLocationByIdResult(result!);
}
getLocationByIdResult(GetLocationByTenantId data) async {
print('location result');
if (data.code == 200) {
SharedPreferences prefs = await SharedPreferences.getInstance();
locations = data.details!;
shimmer = false;
update();
print('usernamesss ${prefs.getString('userName')??''}');
print('gettenantIdinset${prefs.getInt('tenantId')!}');
}
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
}
}