EdmaxLabs Core Flutter Package
EdmaxLabs Core is the official Flutter package for projects using Edmaxlabs Services. It provides unified access to your projectβs database, cloud functions, and storage, making it easy to build real-time apps with minimal setup.
π Features
- Realtime database
- Cloud functions
- Storage
- Unified singleton instance for all services
For full usage and advanced features, see EdmaxLabs Docs.
π¦ Installation
Add edmaxlabs_core to your pubspec.yaml:
dependencies:
edmaxlabs_core: ^1.0.0
Then run:
flutter pub get
βοΈ Initialization
All project-specific data can be found in your EdmaxLabs console: https://console.edmaxlabs.com/settings.
import 'package:edmaxlabs_core/edmaxlabs_core.dart';
import 'package:flutter/material.dart';
void main() {
final options = EdmaxLabsOptions(
token: "xxxxx",
project: "xxxxxxx",
authToken: "xxxxx",
);
EdmaxLabs.initialize(options);
runApp(const MyApp());
}
Screenshot: Project settings in EdmaxLabs Console
π Usage Example
import 'package:edmaxlabs_core/edmaxlabs_core.dart';
// Get singleton instance
final db = EdmaxLabs.getInstance.getDatabase;
final fn = EdmaxLabs.getInstance.getFunctions;
final storage = EdmaxLabs.getInstance.getStorage;
// Call a function
final result = await fn.call("getAllTasksDemo");
// Listen to a collection
db.collection("tasks").onSnapshot((snap, event) {
print("Snapshot ${snap.id} received: $event");
});
// Upload a file
final res = await storage.ref("myapp/file.png").uploadBytes(fileBytes, (percent) {
print("Upload progress: $percent%");
});
π§© Example App Structure
lib/
ββ models/ # Data models
ββ widgets/ # Reusable widgets
ββ screens/ # App screens
ββ main.dart # App entry point
π Documentation
For detailed usage, advanced guides, and examples, see EdmaxLabs Docs.
π€ Contributing
Contributions are welcome! Please fork the repo and submit a pull request.
π License
MIT License β see LICENSE.
π Links
- EdmaxLabs Console: https://console.edmaxlabs.com
- Documentation: https://docs.edmaxlabs.com
- GitHub: EdmaxLabs Core Repo