【发布时间】:2020-09-18 06:52:39
【问题描述】:
我需要以动态方式创建一个元素列表,并且用户可以自然地修改它们,这个想法是在将数据插入到显示我那个或那些元素的排列中之后
FutureBuilder<List<Detalleconcepto>>(
future: provider.listado,
builder: (BuildContext context,
AsyncSnapshot<List<Detalleconcepto>> snapshot) {
if (snapshot.hasData) {
return _listConceptos(snapshot.data);
} else {
return Center(
child: contenedor(),
);
}
},
),
我将留下我的提供者模型和列表的参考
class ProviderInfo with ChangeNotifier {
List<Detalleconcepto> _listado = new List<Detalleconcepto>();
get listado {
return _listado;
}
set listado(List<Detalleconcepto> listado) {
this._listado = listado;
notifyListeners();
}
}
class Detalleconcepto {
int idOperacionFinanciera;
int idTipoConcepto;
String tipoConcepto;
double importe;
String fecha;
String numeroDocumento;
Detalleconcepto({
this.idOperacionFinanciera,
this.idTipoConcepto,
this.tipoConcepto,
this.importe,
this.fecha,
this.numeroDocumento,
});
════════小部件库捕获的异常═════════════════════════════════════ ═ “List”类型不是“Future>”类型的子类型
相关的导致错误的小部件是 创建列表
【问题讨论】: