import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:mc_common_app/models/post_params_model.dart';
import 'package:mc_common_app/models/user/user.dart';
import 'package:mc_common_app/utils/enums.dart';

class AppState {
  static final AppState _instance = AppState._internal();

  AppState._internal();

  factory AppState() => _instance;

  bool isLogged = false;

  set setLogged(v) => isLogged = v;

  bool? get getIsLogged => isLogged;

  AppType currentAppType = AppType.provider;

  void setAppType(AppType appType) {
    currentAppType = appType;
  }

  User? _user = null;

  set setUser(v) => _user = v;

  User get getUser => _user ?? User();

  PostParamsModel? _postParams;

  PostParamsModel? get postParamsObject => _postParams;

  Map<String, dynamic> get postParamsJson => _postParams?.toJson() ?? {};

  void setPostParamsModel(PostParamsModel _postParams) {
    this._postParams = _postParams;
  }

  LatLng currentLocation = const LatLng(0, 0);

  set setCurrentLocation(v) => currentLocation = v;

  LatLng get getCurrentLocation => currentLocation;
}
