I've been working on a JSON file in my flutter app and I want to merge multiple JSON data in one Listview.builder in FutureBuilder. In my case I have an audio JSON file and text JSON file.
var data;
Future<void> getAll() async{
// text JSON
final url1 = "http://api.alquran.cloud/v1/quran/en.asad";
Uri myUri1 = Uri.parse(url1);
final response1 = await http.get(myUri1);
//audio JSON
final url2 = "http://api.alquran.cloud/v1/quran/ar.alafasy";
Uri myUri2 = Uri.parse(url2);
final response2 = await http.get(myUri2);
/* here I want to combine
response = response1 + response2
then add it to data as */
if (response.statusCode == 200) {
data = json.decode(response.body.toString());
} else {
throw Exception('Failed to load text');
}
}
so how can I combine these? and if I can add two how can I do it with more JSON data?