appwrite_flutter_widgets 0.0.1 copy "appwrite_flutter_widgets: ^0.0.1" to clipboard
appwrite_flutter_widgets: ^0.0.1 copied to clipboard

A collection of widgets for the appwrite flutter SDK.

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')),
  ],
);

Contributions #

Contributions are welcome!

Paurini Wiringi

7
likes
100
pub points
12%
popularity

Publisher

unverified uploader

A collection of widgets for the appwrite flutter SDK.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

appwrite, flutter

More

Packages that depend on appwrite_flutter_widgets