import 'package:get/get.dart';
import 'package:rounded_loading_button_plus/rounded_loading_button.dart';
import '../../Data/Repository/Tenantlocation/Getlocationrepository.dart';
import '../../Model/Response/Tenantlocation/Getlocationbyidresponse.dart';

class TenantLocationController extends GetxController{

  String? latitude;
  String? longitude;
  String? address;

  int selectedAddressIndex = -1;
  int locationId = 0;

  List<TenantLocationDetails>getLocations = [];

  final RoundedLoadingButtonController btnController = RoundedLoadingButtonController();


  GetLocationsRepository getLocationsRepository= GetLocationsRepository();


  getTenantLocation()async {
    GetLocationByTenantId? result = await getLocationsRepository.getTenantLocationById();
    if (result?.code == 200) {
      getLocations = result?.details??[];
      update();
    }

    print('resultgetLocation ${result?.toJson()}');
  }


  @override
  void onInit() {
    getTenantLocation();
    // TODO: implement onInit
    super.onInit();
  }
}