1

i'm makin a ecommerce app in flutter, and when I want to do de providers it show me an error in the future builder. Ok, the fist error was this: type 'AsyncSnapshot' is not a subtype of type 'List', and the way I solved it was adding (context, AsyncSnapshot<List>), but now a new error it appear in the futurebuilder, the code is this:

return FutureBuilder(
                  // ignore: deprecated_member_use
                  future: Firestore.instance
                      .collection("category")
                      // ignore: deprecated_member_use
                      .document("4ton5n1tQBHMnJ5jmJ4l")
                      .collection("alarmas")
                      // ignore: deprecated_member_use
                      .getDocuments(),
                  builder:
                      (context, AsyncSnapshot<List<Product>> alarmasSnapshot) {
                    if (alarmasSnapshot.connectionState ==
                        ConnectionState.waiting) {
                      return Center(
                        child: CircularProgressIndicator(),
                      );
                    }

Any idea? the error is this: Couldn't interfer type parameter 'T'

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
LizzP
  • 17
  • 4
  • I think you are missing the `key` mapping. Is that the only error message you are receiving? – Andrew Nov 27 '20 at 14:56
  • Yes, that's the only error – LizzP Nov 28 '20 at 18:06
  • Take a look at this [Stackoverflow Question](https://stackoverflow.com/questions/54898767/enumerate-or-map-through-a-list-with-index-and-value-in-dart). I think you need to enumerate over your List. – Andrew Dec 01 '20 at 10:10

0 Answers0