o tipo 'Lista <dinâmico>' não é um subtipo do tipo 'Lista <Widget>'
Eu tenho um trecho de código que copiei do exemplo do Firestore:
Widget _buildBody(BuildContext context) {
return new StreamBuilder(
stream: _getEventStream(),
builder: (context, snapshot) {
if (!snapshot.hasData) return new Text('Loading...');
return new ListView(
children: snapshot.data.documents.map((document) {
return new ListTile(
title: new Text(document['name']),
subtitle: new Text("Class"),
);
}).toList(),
);
},
);
}
Mas eu recebo este erro
type 'List<dynamic>' is not a subtype of type 'List<Widget>'
O que dá errado aqui?