class _SearchState extends State<Search> {
@override
Widget build(BuildContext context) {
widget.id;
return new Scaffold(
appBar: new AppBar(
actions: <Widget>[
new IconButton(
icon: new Icon(Icons.exit_to_app),
onPressed: _getTicketDetails
)
],
centerTitle: true,
title: new Text
("TicketsDetails", style: const TextStyle(
fontFamily: 'Poppins'
,),),),
);
}
_getTicketDetails() async {
print(widget.id);
var userDetails = {};
final response = await http.get(
"https:...", headers: {
HttpHeaders.AUTHORIZATION:
"...
});
List returnTicketDetails = json.decode(response.body);
print(returnTicketDetails);
for (var i = 0; i < (returnTicketDetails?.length ?? 0); i++) {
final ticketresponse = await http.get(
"..${returnTicketDetails[i]["user_id"]
.toString()}", headers: {
HttpHeaders.AUTHORIZATION:
"...
});
userDetails[returnTicketDetails[i]["user_id"]] =
json.decode(ticketresponse.body);
}
print(userDetails);
}
Hi there! In the console the output I get by printing (userDetails) is: {513549601: {first_name: Test, last_name: Account, profile_image: tempURL. However, I would like to create a Listview dynamically with: userDetails[user_id][first_name] userDetails[user_id][last_name] and so on... But my concern is, where am I suppose to implement the Listview? As I already have a Widget build used at the very top.
