import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'package:mohem_flutter_app/models/post_params_model.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;

  String? forgetPasswordTokenID;

  set setForgetPasswordTokenID(token) => forgetPasswordTokenID = token;

  String? get getForgetPasswordTokenID => forgetPasswordTokenID;

  PostParamsModel? _postParams;

  PostParamsModel? get postParamsObject => _postParams;

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

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

  String? _username;

  set setUserName(v) => _username = v;

  String? get getUserName => _username;

  MemberLoginListModel? _memberLoginList;

  MemberLoginListModel? get memberLoginList => _memberLoginList;

  set setMemberLoginListModel(MemberLoginListModel? _memberLoginList) => this._memberLoginList = _memberLoginList;
}
