getChapters static method

Future<ChaptersModel> getChapters({
  1. required String seriesid,
  2. required String seasonnum,
  3. int pagesize = 15,
  4. int page = 1,
})

Implementation

static Future<ChaptersModel> getChapters(
    {required String seriesid,
    required String seasonnum,
    int pagesize = 15,
    int page = 1}) async {
  String url =
      "${AppUrls.baseUrlVCMS}/subscriber/v1/content?objecttype=CONTENT&seasonnum=$seasonnum&seriesid=$seriesid &pagesize=$pagesize&page=$page";
  bool isSafari = await PlayService().isMpegtspackage();
  if (isSafari) {
    url = "$url&mpegtspackage=YES";
  }
  final response = await _dio!.get(url);
  ChaptersModel chaptersModel = ChaptersModel.fromMap(response.data);
  return chaptersModel;
}