How to use FirestoreListView (with infinite scroll) in a CustomScrollView in Flutter?

68 Views Asked by At

I have a FirestoreListView (from firebase_ui_firestore) in my home of my page in flutter.

FirestoreListView(
                                      scrollDirection: Axis.vertical,
                                      key: UniqueKey(),
                                      pageSize: 10,
                                      loadingBuilder: (context) => Loading(),
                                      query: FirebaseFirestore.instance
                                              .collection('houses')
                                              .orderBy('datecreation', descending: true)
                                          ,
                                      itemBuilder: (context, snapshot) {
                                        return MyTile(
                                             myHouse: House(id: snapshot.id)
                                              )
                                         } 
                                      } 
                                      )),

Now, I want to put FirestoreListView in a CustomScrollView because I want to put widgets above my FirestoreListView. So, all the widgets will be scrollable together.

I try to write the FirestoreListview inside SliverToBoxAdapter => error, I try to return SliverToBoxAdapter in the itemBuilder => error.

What is the best way to have a FirestoreListView in a CustomScrollView?

Thanks all for your help!

0

There are 0 best solutions below