bb_studio (Dart & Flutter SDK)
Official Dart & Flutter client package for BB-Studio.
Installation
Add bb_studio to your pubspec.yaml:
dependencies:
bb_studio: ^1.0.0
Or reference it directly from Git / local path:
dependencies:
bb_studio:
path: ../packages/sdk-dart
Quick Start
import 'package:bb_studio/bb_studio.dart';
Future<void> main() async {
final bb = BBStudio.initialize(
application: 'APP-XXXXXXXX',
endpoint: 'https://bb.previewbox.dpdns.org',
);
final app1 = bb.application('RT-XXXXXXXX');
// Query records
final users = await bb_get(
app1.dataset('users'),
[bb_is('status', 'ACTIVE'), bb_sortDesc('createdAt'), bb_limit(20)],
);
// End-user authentication
await bb_auth.login({'email': 'alice@example.com', 'password': 'Secret123!'});
// Upload bytes to granted bucket1
final uploaded = await bb_uploadBytes(
bucketUrl: 'https://bb.previewbox.dpdns.org/api/v1/storage/b/BKT-XXXXXXXX',
bytes: fileBytes,
filename: 'avatar.png',
);
// Invoke Cloud Function
final fnResult = await bb_invoke('send-welcome', {'name': 'Alice'});
}