import 'dart:async'; import 'api_client.dart'; import 'package:tangheem/classes/consts.dart'; import 'package:tangheem/models/aya_model.dart'; import 'package:tangheem/models/surah_model.dart'; class TangheemUserApiClient { static final TangheemUserApiClient _instance = TangheemUserApiClient._internal(); TangheemUserApiClient._internal(); factory TangheemUserApiClient() => _instance; Future getSurahs() async { String url = "${ApiConsts.tangheemUsers}AlSuar_Get"; var postParams = {}; return await ApiClient().postJsonForObject((json) => SurahModel.fromJson(json), url, postParams); } Future getAyaByRange(int itemsPerPage, int currentPageNo, int surahID, int ayahFrom, int ayahTo) async { String url = "${ApiConsts.tangheemUsers}AyatByRange_Get"; var postParams = {"itemsPerPage": itemsPerPage, "currentPageNo": currentPageNo, "sortFieldName": "string", "isSortAsc": true, "surahID": surahID, "ayahFrom": ayahFrom, "ayahTo": ayahTo}; return await ApiClient().postJsonForObject((json) => AyaModel.fromJson(json), url, postParams); } }