LittlefishObservabilityManager class
The LittlefishObservabilityManager is a singleton that resolves and registers the correct observability, monitoring, and analytics provider implementations based on configuration from ConfigService (LaunchDarkly).
This follows the same singleton pattern as LittlefishAuthManager.
The main application should only reference this manager — it should never directly reference any provider-specific packages (Sentry, Firebase, etc.).
Backward Compatibility
The manager supports two modes:
-
Legacy mode: When
system-observability-settingsis NOT configured in config-service, the manager reads the existing per-service config flags (config_settings_monitoring_enabled,config_settings_analytics_enabled,config_settings_monitoring_trace_mode) and initialises Firebase services with those exact values — replicating the behaviour of the oldinjector.dart. -
New mode: When
system-observability-settingsIS configured, the manager reads theproviderfield to determine whether to use Sentry or Firebase, and reads provider-specific config from the nested objects.
Usage:
await LittlefishObservabilityManager.instance.initialise(
appRunner: () async => runApp(MyApp()),
);
Constructors
- LittlefishObservabilityManager()
-
factory
Properties
- activeProvider → String
-
The name of the currently active provider ('sentry', 'firebase', or 'none').
no setter
- configService → ConfigService
-
no setter
- core → LittleFishCore
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInitialised → bool
-
Whether the manager has been initialised.
no setter
- isLegacyMode → bool
-
Whether the manager is operating in legacy mode (reading old per-service
config flags instead of
system-observability-settings).no setter - logger → LoggerService
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getAppWrapper(
) → ObservabilityWidgetWrapper? - Returns a widget wrapper function if the active observability provider supports it (e.g. Sentry's SentryWidget for screenshot capture).
- Returns the navigator observer from the active analytics provider, or null if analytics is not registered or not ready.
-
initialise(
{Future< void> appRunner()?}) → Future<void> - Initialises the observability stack based on configuration from ConfigService.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited