FutureBuilder(
builder: (context, snapshot) {
List showRefund = json.decode(snapshot.data.toString());
if (!snapshot.hasData) {
return CircularProgressIndicator();
}else
return ListView.separated(
separatorBuilder: (BuildContext context, int index) => Divider(),
itemCount: showRefund.length,
itemBuilder: (BuildContext context, int index) {
return TextButton(
onPressed: () {
BlocProvider.of<NavigationBloc>(context)
.add(NavigationEvents.RefundClickedEvent);
},
child: ListTile(
title:
Text('Поставщик: ${showRefund[index]['Контрагент']}'),
subtitle: Text(showRefund[index]['Дата'])),
);
},
);
},
future:
DefaultAssetBundle.of(context).loadString('assets/refund.json'),
),