second commit
This commit is contained in:
27
lib/Data/Repository/Tenants/Tenantsrepository.dart
Normal file
27
lib/Data/Repository/Tenants/Tenantsrepository.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../Helper/Constants/Apiconstants.dart';
|
||||
import '../../../Model/Response/Tenants/Tenantinforesponse.dart';
|
||||
import '../../Provider/Tenants/Tenantsprovider.dart';
|
||||
|
||||
class TenantRepository{
|
||||
int? tenantId;
|
||||
int? locationId;
|
||||
|
||||
TenantsProvider tenantsProvider = TenantsProvider();
|
||||
|
||||
Future<TenantInfo?> getTenantInfo() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
tenantId = prefs.getInt('tenantId') ?? 0;
|
||||
locationId = prefs.getInt('locationId')??0;
|
||||
print(tenantId);
|
||||
var result = await tenantsProvider.getTenantInfo('${ApiConstants.getTenantInfo}/?tenantid=$tenantId&locationid=$locationId');
|
||||
// var result = await tenantsProvider.getTenantInfo('${ApiConstants.tenantInfo}/?tenantid=$tenantId');
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user