CollectionWidget<T> class
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.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CollectionWidget
Constructors
-
CollectionWidget({Key? key, required Databases database, required String collectionId, required int itemsPerPage, bool realtime = true, CollectionPageController? pageController, int timeout = 10000, List? queries, List<
String> ? orderTypes, List<String> ? orderAttributes, required Widget onData(List<T> data), Widget? onEmpty, Widget? onWaiting, Widget? onTimeout, Widget onError(Object? error, StackTrace? stackTrace)?, Widget fallback = const SizedBox.shrink(), void onStartCallback(List<T> data)?, void onEndCallback(List<T> data)?}) -
A
CollectionWidgetallows 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.const
Properties
- collectionId → String
-
The collectionId that we're querying.
final
- database → Databases
-
An instance of
Databasesfor the database we're querying.final - fallback → Widget
-
A fallback widget to be displayed if a widget has not been provided where it
is optional.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemsPerPage → int
-
The maximum number of documents per page.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onData
→ Widget Function(List<
T> data) -
A calback that returns a
Widgetto display the data of a query.final - onEmpty → Widget?
-
A widget to be displayed in the case that the internal document list
is empty (or a collection is empty).
final
-
onEndCallback
→ void Function(List<
T> data)? -
A callback triggered when we hit the end of the query.
final
- onError → Widget Function(Object? error, StackTrace? stackTrace)?
-
A callback that returns a widget to be displayed in the case of an error.
The callback also provides access to the error and stacktrace.
final
-
onStartCallback
→ void Function(List<
T> data)? -
A callback triggered when we hit the start of the query.
final
- onTimeout → Widget?
-
A widget to be displayed in the case that a
TimeoutExceptionoccurs.final - onWaiting → Widget?
-
A widget to be displayed in the case that a request to the appwrite
server is in progress and we're awaiting results.
final
-
orderAttributes
→ List<
String> ? -
Array of attributes used to sort results. Maximum of 100 order
attributes are allowed, each 4096 characters long.
final
-
orderTypes
→ List<
String> ? -
Array of order directions for sorting attribtues. Possible values are
DESC for descending order, or ASC for ascending order. Maximum of 100
order types are allowed.
final
- pageController → CollectionPageController?
-
The
CollectionPageControllerthat controlls thisCollectionWidget.final - queries → List?
-
Array of query strings generated using the Query class provided by the
SDK. Learn more about queries. Maximum of 100 queries are allowed, each
4096 characters long.
final
- realtime → bool
-
Whether or not server-side updates are automatically reflected
on the client/UI.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → int
-
The timeout stopwatch in milliseonds.
A
TimeoutExceptionis thrown after this time of which at that point, thisCollectionWidget's state will change toWidgetStates.timeout.final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → CollectionWidgetState< T> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited