second commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../../Helper/Constants/Apiconstants.dart';
|
||||
import '../../../../Model/Response/Tenantlocation/Getlocationbyidresponse.dart';
|
||||
import '../../../Provider/Location/GetLocation/getlocationprovider.dart';
|
||||
|
||||
|
||||
|
||||
class GetLocationsRepository{
|
||||
GetLocationsProvider getLocationsProvider = GetLocationsProvider();
|
||||
int tenantId = 0;
|
||||
int locationId = 0;
|
||||
|
||||
Future<GetLocationByTenantId?> getLocationById() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
tenantId = prefs.getInt('tenantId')!;
|
||||
locationId = prefs.getInt('locationId')!;
|
||||
var result = await getLocationsProvider.getLocationById('${ApiConstants.getLocationById}?tenantid=$tenantId',);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user