import 'dart:async';

import 'package:car_customer_app/classes/consts.dart';
import 'package:car_customer_app/models/content_info_model.dart';
import 'package:car_customer_app/models/member_model.dart';
import 'package:car_customer_app/models/surah_model.dart';

import 'api_client.dart';

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

  TangheemUserApiClient._internal();

  factory TangheemUserApiClient() => _instance;

  Future<SurahModel> getSurahs() async {
    String url = "${ApiConsts.baseUrl}AlSuar_Get";
    var postParams = {};
    return await ApiClient().postJsonForObject((json) => SurahModel.fromJson(json), url, postParams);
  }

  Future<MemberModel> getMembers() async {
    String url = "${ApiConsts.baseUrl}Committee_Get";
    var postParams = {};
    return await ApiClient().postJsonForObject((json) => MemberModel.fromJson(json), url, postParams);
  }

  Future<ContentInfoModel> getContentInfo(int contentId) async {
    String url = "${ApiConsts.baseUrl}ContentInfo_Get";
    var postParams = {"contentTypeId": contentId};
    return await ApiClient().postJsonForObject((json) => ContentInfoModel.fromJson(json), url, postParams);
  }
}
