stop static method

Future<void> stop()

Stops the HTTP server and removes the lifecycle observer.

Implementation

static Future<void> stop() async {
  if (!_isRunning || _server == null) return;
  WidgetsBinding.instance.removeObserver(_observer);
  await _server!.close(force: true);
  _server = null;
  _isRunning = false;
  Log.i('[Server] 🛑 Stopped');
}