NetworkLogWebServer class

A local web server that provides a dashboard for viewing network logs.

This server serves a static HTML dashboard and provides API endpoints for accessing network activity logs. Only runs in debug mode or staging environment and on platforms that support server sockets (mobile, desktop).

Platform Support:

  • ✅ Android, iOS, macOS, Windows, Linux
  • ❌ Web (browsers don't support ServerSocket.bind)

Environment Support:

  • ✅ Debug mode (always enabled)
  • ✅ Staging environment (when STAGING_ENV=true)
  • ❌ Production environment (always disabled)

Properties

dashboardUrl String
Returns the URL where the dashboard is accessible.
no setter
hashCode int
The hash code for this object.
no setterinherited
isRunning bool
Returns whether the server is currently running.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

broadcastLog(Map<String, dynamic> logEntry) → void
Broadcasts a new log entry to all connected WebSocket clients.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() Future<bool>
Starts the web server if not already running.
stop() Future<void>
Stops the web server if running.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance NetworkLogWebServer
Returns the singleton instance of NetworkLogWebServer.
no setter
isPlatformSupported bool
Checks if the current platform supports the web server.
no setter