Documentation
SDKs
Flutter

Flutter SDK

Installation

flutter pub add moontraze_flutter

Quick Start

import 'package:moontraze_flutter/moontraze_flutter.dart';
 
final moon = MoonSDK(MoonConfig(
  projectId: 'YOUR_PROJECT_ID',
  apiKey: 'YOUR_API_KEY',
));
 
// Auth
final result = await moon.auth.register('user@example.com', 'secret123', 'John');
moon.setToken(result['token']);
 
await moon.auth.login('user@example.com', 'secret123');
moon.auth.logout();
await moon.auth.changePassword('oldSecret', 'newSecret');
 
// Database
await moon.db.set('users/user_123', {'name': 'John'});
final user = await moon.db.get('users/user_123');
await moon.db.updateField('users/user_123', 'status', 'verified');
await moon.db.deleteField('users/user_123', 'phone');
await moon.db.delete('users/user_123');
 
// Storage
final file = File('photo.jpg');
final upload = await moon.storage.upload(file);
final files = await moon.storage.list();
await moon.storage.createFolder('My Folder');
await moon.storage.delete(fileId);
await moon.storage.deleteFolder(folderId);
final quota = await moon.storage.getQuota();
 
// Notifications
await moon.notifications.registerToken(fcmToken, {'platform': 'android'});
await moon.notifications.sendToProject('project_id', title: 'Hello', body: 'World');
await moon.notifications.sendToUser('user_id', title: 'Hi', body: 'There');
await moon.notifications.sendToTopic(topic: 'premium', title: 'Hi', body: 'There');
final history = await moon.notifications.getHistory(50);

Registry