stop method Null safety

Future stop()

Stops the application from running.

Closes every isolate and their channel and stops listening for HTTP requests. The ServiceRegistry will close any of its resources.


Future stop() async {
  _hasFinishedLaunching = false;
  await Future.wait( => s.stop()));
  if (server != null && server!.server != null) {
    await server!.server!.close(force: true);

  await ServiceRegistry.defaultInstance.close();
  _hasFinishedLaunching = false;
  server = null;
  supervisors = [];