import 'package:easy_localization/easy_localization.dart';
import 'package:hmg_patient_app_new/core/common_models/VidaPlusProjectListModel.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/authenticated_user_resp_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/select_device_by_imei.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';

class AppState {
  NavigationService navigationService;

  AppState({required this.navigationService});

  double userLat = 0.0;

  set setUserLat(v) => userLat = v;

  double userLong = 0.0;

  set setUserLong(v) => userLong = v;

  bool isArabic() => EasyLocalization.of(navigationService.navigatorKey.currentContext!)?.locale.languageCode == "ar";

  int getLanguageID() => EasyLocalization.of(navigationService.navigatorKey.currentContext!)?.locale.languageCode == "ar" ? 1 : 2;

  String? getLanguageCode() => EasyLocalization.of(navigationService.navigatorKey.currentContext!)?.locale.languageCode;

  AuthenticatedUser? _authenticatedUser;

  void setAuthenticatedUser(AuthenticatedUser authenticatedUser) {
    _authenticatedUser = authenticatedUser;
  }

  AuthenticatedUser? get getAuthenticatedUser => _authenticatedUser;

  SelectDeviceByImeiRespModelElement? _selectDeviceByImeiRespModelElement;

  void setSelectDeviceByImeiRespModelElement(SelectDeviceByImeiRespModelElement value) {
    _selectDeviceByImeiRespModelElement = value;
  }

  SelectDeviceByImeiRespModelElement? get getSelectDeviceByImeiRespModelElement => _selectDeviceByImeiRespModelElement;

  String appLoginTokenID = "";

  set setAppLoginTokenID(v) => appLoginTokenID = v;

  String deviceToken = "";

  set setDeviceToken(v) => deviceToken = v;

  String voipToken = "";

  set setVoipToken(v) => voipToken = v;

  String appAuthToken = "";

  set setAppAuthToken(v) => appAuthToken = v;

  String sessionId = "";

  set setSessionId(v) => sessionId = v;

  bool isAuthenticated = true;

  set setIsAuthenticated(v) => isAuthenticated = v;

  String deviceTypeID = "";

  set setDeviceTypeID(v) => deviceTypeID = v;

  List<VidaPlusProjectListModel> vidaPlusProjectList = [];

  setVidaPlusProjectList(List<VidaPlusProjectListModel> vidaPlusProjectListModelInput) {
    vidaPlusProjectList = vidaPlusProjectListModelInput;
  }
}
