vedartm / paginate_firestore

A flutter package to simplify pagination with firestore data 🗃
https://pub.dev/packages/paginate_firestore
MIT License
113 stars 136 forks source link

PaginateFirestore incompatible with Scrollbar #112

Closed maxsk-ger closed 2 years ago

maxsk-ger commented 2 years ago

While trying to wrap a Scrollbar around the PaginationFirestore, this error is shown:

The Scrollbar's ScrollController has no ScrollPosition attached.

This happens if the isAlwaysShown attribute is set.

return Scrollbar(
      controller: scrollController,
      isAlwaysShown: true,
      child: PaginateFirestore(
        scrollController: scrollController,
        header: header,
        footer: footer,
        emptyDisplay: emptyInfo,
        itemBuilderType: PaginateBuilderType.listView,
        itemBuilder: (index, context, documentSnapshot) =>
            _itemBuilder(index, context, documentSnapshot),
        // orderBy is compulsary to enable pagination
        query: query,
        itemsPerPage: 50,
        isLive: true,
        onLoaded: onLoaded,
      ),
    );
vedartm commented 2 years ago

@maxsk-ger thanks for using the package. Scrollbar is now supported in the latest version v1.0.3+1 🎉

Just use it like this

      Scrollbar(
        isAlwaysShown: true,
        child: PaginateFirestore(
          ...
        )
      )