getChapterDataByChapterId function Null safety

Future<SingleChapterData> getChapterDataByChapterId(
  1. String chapterId
)

Implementation

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