BloomDev class

Developer tooling harness for simulating network latency, outages, and failure rates.

Enables chaos testing in development environments without external proxy tools.

Example:

// Simulate 500ms latency and 20% server 500 errors
BloomDev.simulateNetwork(
  latency: const Duration(milliseconds: 500),
  failureRate: 0.2,
);

Constructors

BloomDev()

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

failureRate double
Simulated network failure probability (0.0 = 0%, 1.0 = 100%).
no setter
failureStatusCode int
HTTP status code returned during simulated failures.
no setter
isOffline bool
Whether the device is currently in a simulated offline state.
no setter
latency Duration?
Artificial latency injected into network requests.
no setter

Static Methods

reset() → void
Resets all network simulation parameters to normal defaults.
setOffline(bool offline) → void
Toggles device offline network state.
simulateNetwork({Duration? latency, double failureRate = 0.0, int failureStatusCode = 500}) → void
Simulates degraded network conditions with latency and probabilistic failureRate (0.0 - 1.0).