Skip to main content

sethucms 0.1.1 copy "sethucms: ^0.1.1" to clipboard
sethucms: ^0.1.1 copied to clipboard

Dart and Flutter client for the SethuCMS API. List, filter and page through records in any connected database.

example/example.dart

import 'package:sethucms/sethucms.dart';

/// Lists the first page of paid orders. Replace the address, the token and the
/// connection id with your own.
Future<void> main() async {
  final cms = SethuClient(
    'https://cms.example.com',
    token: () => 'YOUR_API_TOKEN',
  );

  try {
    if (!await cms.isHealthy()) {
      print('The gateway is not ready.');
      return;
    }

    final page = await cms
        .collection('conn_123', 'orders')
        .where(eq('status', 'paid'))
        .orderBy('created_at', descending: true)
        .limit(20)
        .list();

    for (final order in page.data) {
      print(order);
    }
    print('More pages: ${page.nextCursor != null}');
  } on SethuApiError catch (error) {
    print('The gateway answered with an error: $error');
  } finally {
    cms.close();
  }
}
0
likes
160
points
706
downloads

Documentation

API reference

Publisher

verified publishervishwamai.com

Weekly Downloads

Dart and Flutter client for the SethuCMS API. List, filter and page through records in any connected database.

Repository (GitHub)
View/report issues

Topics

#cms #api-client #database

License

MIT (license)

Dependencies

http

More

Packages that depend on sethucms