CollectionWidget<T> constructor

const CollectionWidget<T>({
  1. Key? key,
  2. required Databases database,
  3. required String collectionId,
  4. required int itemsPerPage,
  5. bool realtime = true,
  6. CollectionPageController? pageController,
  7. int timeout = 10000,
  8. List? queries,
  9. List<String>? orderTypes,
  10. List<String>? orderAttributes,
  11. required Widget onData(
    1. List<T> data
    ),
  12. Widget? onEmpty,
  13. Widget? onWaiting,
  14. Widget? onTimeout,
  15. Widget onError(
    1. Object? error,
    2. StackTrace? stackTrace
    )?,
  16. Widget fallback = const SizedBox.shrink(),
  17. void onStartCallback(
    1. List<T> data
    )?,
  18. void onEndCallback(
    1. List<T> data
    )?,
})

A CollectionWidget allows for refined handling of an Appwrite collection query and how we display that result in the UI; depending on the state of the query and the result itself.

It also provides options for pagination, realtime, start & end bumpers, error handling and your usual appwrite query abilities.

See the README for examples.

Implementation

const CollectionWidget(
    {Key? key,
    required this.database,
    required this.collectionId,
    required this.itemsPerPage,
    this.realtime = true,
    this.pageController,
    this.timeout = 10000,
    this.queries,
    this.orderTypes,
    this.orderAttributes,
    required this.onData,
    this.onEmpty,
    this.onWaiting,
    this.onTimeout,
    this.onError,
    this.fallback = const SizedBox.shrink(),
    this.onStartCallback,
    this.onEndCallback})
    : super(key: key);