NitroConfig class

Global configuration for the Nitro runtime.

Set before calling any Nitro APIs, typically in main():

NitroConfig.instance
  ..debugMode = true
  ..logLevel = NitroLogLevel.verbose
  ..isolatePoolSize = 4;

All settings are live — changing them mid-run takes effect on the next call / stream event.

Properties

debugMode ↔ bool
When true, Nitro emits structured log lines for every bridge invocation, stream event, and lifecycle transition.
getter/setter pair
effectiveLogLevel → NitroLogLevel
Resolved effective log level — respects debugMode override.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isolatePoolSize ↔ int
Number of persistent worker isolates maintained by NitroRuntime.callAsync.
getter/setter pair
logHandler ↔ void Function(NitroLogLevel level, String tag, String message, [Object? error, StackTrace? stack])
Custom log sink. Replace to integrate with your logger of choice (e.g. package:logging, Crashlytics, etc.).
getter/setter pair
logLevel ↔ NitroLogLevel
Verbosity of the runtime logger.
getter/setter pair
nativeAsyncTimeoutMs ↔ int
Timeout in milliseconds for @nitroNativeAsync calls. When > 0, if the native side fails to post a result within this window (a crashed or buggy native impl), the returned Future completes with a TimeoutException instead of hanging forever, and the underlying ReceivePort + per-call error slot are released. Set to 0 (the default) to wait indefinitely — the native contract is to post exactly one message, so this is opt-in resilience against a misbehaving implementation.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slowCallThresholdUs ↔ int
Threshold in microseconds above which a NitroRuntime.callAsync call emits a NitroLogLevel.warning log. Set to 0 to disable. Slow-call warning threshold for sync calls, in microseconds; 0 disables.
getter/setter pair
timelineTracingEnabled ↔ bool
When true, NitroRuntime wraps bridge calls in dart:developer timeline spans so DevTools can attribute native bridge cost per method.
getter/setter pair

Methods

disable() → void
Disables all Nitro runtime overhead in one call.
enable({NitroLogLevel level = NitroLogLevel.warning, int slowCallThresholdMs = 16}) → void
Enables Nitro logging in one call.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets all settings to their defaults. Useful in tests.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance → NitroConfig
The singleton instance.
final