etebase 1.0.3 copy "etebase: ^1.0.3" to clipboard
etebase: ^1.0.3 copied to clipboard

Dart client library for etebase using FFI bindings with libetebase

example/etebase_example.dart

// ignore_for_file: avoid_print

import 'dart:convert';
import 'dart:typed_data';

import 'package:etebase/etebase.dart';

import '../test/integration/util/library_loader.dart';

Future<void> main() async {
  print('Initializing etebase...');
  Etebase.ensureInitialized(loadLibEtebase);
  print('Etebase was initialized!');

  final client = await EtebaseClient.create(
    'example-client',
    // serverUrl (optional)
    Uri.http('localhost:3735', '/'),
  );
  try {
    print('Client is valid: ${await client.checkEtebaseServer()}');

    final account = await EtebaseAccount.signup(
      client,
      const EtebaseUser(
        username: 'test',
        email: '[email protected]',
      ),
      'hello-test-123',
    );

    final collectionManager = await account.getCollectionManager();
    final collection = await collectionManager.create(
      'example',
      EtebaseItemMetadata(
        name: 'Example collection',
        description: 'An example collection for testing out etebase-dart',
        mtime: DateTime.now(),
      ),
      Uint8List.fromList(utf8.encode('Hello, World!')),
    );
    await collectionManager.upload(collection);
  } finally {
    await client.dispose();
  }
}
1
likes
140
pub points
16%
popularity

Publisher

verified publisherskycoder42.de

Dart client library for etebase using FFI bindings with libetebase

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

ffi, freezed_annotation, meta, synchronized

More

Packages that depend on etebase