bloom_core library

Flutter-independent core primitives for Bloom (environment config, DI container, structured logger).

These primitives are defined in package:bloom_server and re-exported here so both Flutter applications and pure-Dart backend microservices share identical definitions without code drift or dependencies on dart:ui.

Never import bloom.dart from a server entrypoint — that barrel pulls in package:flutter. Use bloom_core or bloom_server.dart instead.

Example:

import 'package:bloom_framework/bloom_core.dart';

void main() {
  BloomEnv.load();
  BloomLogger.info('Core runtime initialized.');
}

Classes

BloomContainer
Lightweight, high-performance Dependency Injection container for Bloom.
BloomEnv
Environment configuration parser, store, and type-safe reader.
BloomLogger
Standardized structured logging system for Bloom servers, apps, and microservices.
BloomTestOverride<T>
Represents a typed test override instance to be injected into a BloomTestScope.
BloomTestScope
A scoped DI harness for running unit and integration tests with isolated overrides.

Enums

BloomLogLevel
Log severity levels for Bloom applications.

Properties

globalContainer BloomContainer
Accesses the global active Bloom DI container.
no setter
logger BloomLogger
Global standard logger instance for Bloom framework and applications.
final

Functions

inject<T>() → T
Resolves a dependency of type T from the global active Bloom container.
injectOrNull<T>() → T?
Resolves an optional dependency of type T from the global active Bloom container, or returns null if not registered.
provide<T>(FactoryFunc<T> factory) → void
Registers a transient factory on the global active Bloom container.
provideSingleton<T>(FactoryFunc<T> factory, {bool lazy = true}) → void
Registers a singleton factory on the global active Bloom container.
provideValue<T>(T value) → void
Registers an existing instance value on the global active Bloom container.
resetActiveContainer() → void
Resets the global active container to a fresh, empty BloomContainer instance.
setActiveContainer(BloomContainer container) → void
Sets the currently active global container (used by BloomTestScope for test isolation).

Typedefs

BloomLogWriter = void Function(String message)
Callback signature for handling formatted log line outputs.
FactoryFunc<T> = T Function()
Factory function callback that instantiates a dependency of type T.