Flutter, how to return different widget based on future value?

I would like to base on a future bool value, to set different icons pass back to a data card inside a list, I tried .then or FutureBuilder, but still not successful. Scaffold: child: ListView.builder( itemCount: fullList.length, itemBuilder: (BuildContext context, int index) { return dataCard(context, fullList, index); }), dataCard: Row( children: [ Expanded( flex: 8,… Read More Flutter, how to return different widget based on future value?

Screen not updated after calling FutureBuilder again

I have a screen that loads shopping cart items in a ListView.builder: Expanded( child: RefreshIndicator( onRefresh: refresh, child: Container( child: FutureBuilder( future: loadData(), builder: (context, snapshot) { if (snapshot.hasData) { List<dynamic>? filteredList = snapshot.data as List; … The data are loaded using the function loadData() Future<List<LineaCesta>> loadData() async { await fetchLineasCesta(idCesta); return fetchLineasCesta(idCesta); } Then,… Read More Screen not updated after calling FutureBuilder again