getChapterDataByChapterId method Null safety

Future<SingleChapterData> getChapterDataByChapterId(
  1. String chapterId
)

Implementation

static Future<SingleChapterData> getChapterDataByChapterId(
    String chapterId) async {
  var unencodedPath = '/chapter/$chapterId';
  var response = await http.get(Uri.https(authority, unencodedPath));
  var result = SingleChapterData.fromJson(jsonDecode(response.body));
  return result;
}