Created
June 25, 2020 02:32
-
-
Save mhmzdev/8b4885334dc012bdfc2d83e5fe4d59ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QuranAPI { | |
Future<SurahsList> getSurahList() async { | |
String url = "http://api.alquran.cloud/v1/quran/quran-uthmani"; | |
final response = await http.get(url); | |
if (response.statusCode == 200) { | |
return SurahsList.fromJSON(json.decode(response.body)); | |
} else { | |
print("Failed to load"); | |
throw Exception("Failed to Load Post"); | |
} | |
} | |
Future<SajdaList> getSajda() async { | |
String url = "http://api.alquran.cloud/v1/sajda/quran-uthmani"; | |
final response = await http.get(url); | |
if (response.statusCode == 200) { | |
return SajdaList.fromJSON(json.decode(response.body)); | |
} else { | |
print("Failed to load"); | |
throw Exception("Failed to Load Post"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment