You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.1 KiB
Dart
25 lines
1.1 KiB
Dart
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<SurahModel> getSurahs() async {
|
|
String url = "${ApiConsts.tangheemUsers}AlSuar_Get";
|
|
var postParams = {};
|
|
return await ApiClient().postJsonForObject((json) => SurahModel.fromJson(json), url, postParams);
|
|
}
|
|
|
|
Future<AyaModel> 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);
|
|
}
|
|
}
|