Last updated:
0 purchases
appwrite flutter widgets
Appwrite Flutter Widgets #
A collection (or the start of a collection) of widgets for the Appwrite flutter SDK.
Widgets #
CollectionWidget - Query, handle and represent documents of a collection in the form of widgets.
StorageWidget - Represent the structure of files and files by widgets based on their properties (Work in progress).
CollectionWidget #
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 doc comments of this class for more.
Work in progress/TODO:
The ability to provide data class converters.
Example
Column(
children: [
CollectionWidget<Document>(
database: database,
collectionId: 'settings',
itemsPerPage: 2,
realtime: false,
timeout: 10000,
pageController: pageController,
queries: [Query.equal('firstName', 'Paka')],
orderTypes: const ['ASC'],
orderAttributes: const ['firstName'],
onStartCallback: (data) => print('START'),
onEndCallback: (data) => print('END'),
onTimeout: const Text('Timeout'),
onEmpty: const Text('Empty'),
onWaiting: const CircularProgressIndicator(),
onError: (e, s) => const Text('Error'),
onData: (d) => ListView.builder(
itemCount: d.length,
shrinkWrap: true,
itemBuilder: (c, i) => Text(
d[i].data['firstName'].toString(),
),
),
),
ElevatedButton(
onPressed: () => pageController.previous,
child: const Text('Previous page')),
ElevatedButton(
onPressed: () => pageController.next,
child: const Text('Next page')),
ElevatedButton(
onPressed: () => pageController.refresh,
child: const Text('Refresh current page')),
],
);
copied to clipboard
Contributions #
Contributions are welcome!
Paurini Wiringi
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.