bootstrapHeadless static method
Creates a minimal headless ZenithTenantScope for background isolates or Workmanager tasks — does not require Flutter bindings.
Implementation
static Future<ZenithTenantScope> bootstrapHeadless({
required String tenantId,
Object? Function(String tenantId)? storageFactory,
}) async {
final scope = ZenithTenantScope(tenantId);
if (storageFactory != null) {
final storage = storageFactory(tenantId);
if (storage != null) {
scope.container.getOrCreate(
ZenithKey<Object>('__headless_storage__'),
(_) => storage,
);
}
}
return scope;
}