ISpect class final
The main entry point for initializing and managing logging/error handling.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
Static Properties
- logger → ISpectLogger
-
Returns the global logger instance.
no setter
- loggerIfInitialized → ISpectLogger?
-
Returns the current logger without lazily creating a fallback.
no setter
-
senders
→ List<
NetworkRequestSender> -
Clients registered for request replay/compose (the in-app HTTP composer).
no setter
Static Methods
-
dispose(
) → Future< void> - Disposes current ISpect state (useful for testing or hot restart).
-
initialize(
ISpectLogger logger, {bool force = false}) → bool -
Initializes the logger instance once.
Returns
trueif initialization was successful. -
maybeRead(
BuildContext context) → ISpectScopeModel? -
Like read but returns
nullinstead of throwing when noISpectScopeControlleris an ancestor. Use for context-derived defaults (e.g. resolving ISpect's own brightness) that must stay safe outside the scope, such as in tests or detached overlays. -
read(
BuildContext context) → ISpectScopeModel - Reads the nearest ISpectScopeModel from the widget tree.
-
registerSender(
NetworkRequestSender sender) → void - Registers a client so the composer can send through it, reusing its base URL, auth interceptors, and retries.
-
run<
T> (T callback(), {ISpectLogger? logger, VoidCallback? onInit, VoidCallback? onInitialized, void onZonedError(Object, StackTrace)?, bool isPrintLoggingEnabled = !kReleaseMode, bool isFlutterPrintEnabled = true, bool isZoneErrorHandlingEnabled = true, void onPlatformDispatcherError(Object, StackTrace)?, void onFlutterError(FlutterErrorDetails, StackTrace?)?, void onPresentError(FlutterErrorDetails, StackTrace?)?, void onUncaughtError(Object error, StackTrace? stack)?, ISpectErrorHandlerOptions options = const ISpectErrorHandlerOptions(), List< String> filters = const [], bool? redactionEnabled, RedactionService? redactionService}) → void - Runs the app with centralized logging and error capture.
-
unregisterSender(
String id) → void - Removes a client previously passed to registerSender by its id.