import 'dart:async';

import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/models/check_mobile_app_version_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/member_login_list_model.dart';
import 'package:mohem_flutter_app/models/surah_model.dart';

import 'api_client.dart';

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

  LoginApiClient._internal();

  factory LoginApiClient() => _instance;

  Future<CheckMobileAppVersionModel> checkMobileAppVersion() async {
    String url = "${ApiConsts.rest}CheckMobileAppVersion";
    var postParams = {};
    return await ApiClient().postJsonForObject((json) => CheckMobileAppVersionModel.fromJson(json), url, postParams);
  }

  Future<MemberLoginListModel?> memberLogin() async {
    String url = "${ApiConsts.rest}MemberLogin";
    var postParams = {};
    return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json).memberLoginList, url, postParams);
  }

  Future<GenericResponseModel?> mohemmSendActivationCodeByOTPNotificationType() async {
    String url = "${ApiConsts.rest}Mohemm_SendActivationCodebyOTPNotificationType";
    var postParams = {};
    return await ApiClient().postJsonForObject((json) => GenericResponseModel.fromJson(json), url, postParams);
  }
}
