동적으로 요소 목록을 만들고 사용자가 자연스럽게 수정할 수 있도록해야합니다. 아이디어는 해당 요소 또는 해당 요소를 보여주는 배열에 데이터를 삽입 한 후입니다.
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> '유형의 하위 유형이 아닙니다.
관련 오류 원인 위젯은 CreateList였습니다.
FutureBuilder
에서 반환되는 데이터가있을 때만 필요합니다 . Future
즉, 비동기 적으로 .
데이터가 반환 될 때 동 기적으로 귀하의 경우, 당신은 필요가 없습니다 를 FutureBuilder
:
_listConceptos(provider.listado), // instead of FutureBuilder
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다