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,29 @@
import 'package:shared_preferences/shared_preferences.dart';
import '../../../Helper/Constants/Apiconstants.dart';
import '../../../Model/Response/Tenantlocation/Getlocationbyidresponse.dart';
import '../../../Model/Response/Tenantlocation/Locationbyid/Locationidresponse.dart';
import '../../Provider/Tenantlocation/Getlocationprovider.dart';
class GetLocationsRepository{
GetLocationsProvider getLocationsProvider = GetLocationsProvider();
int? tenantId;
int? locationId;
Future<GetLocationByTenantId?> getTenantLocationById() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
tenantId = prefs.getInt('tenantId')??0;
locationId = prefs.getInt('locationId')??0;
var result = await getLocationsProvider.getTenantLocationById('${ApiConstants.getTenantLocationById}?tenantid=$tenantId&locationid=$locationId');
return result;
}
Future<GetLocationByLocaionId?> getLocationById() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
tenantId = prefs.getInt('tenantId')??0;
locationId = prefs.getInt('locationId')??0;
var result = await getLocationsProvider.getLocationById('${ApiConstants.getLocationsById}?tenantid=$tenantId&locationid=$locationId',);
return result;
}
}