Skip to content

Commit

Permalink
stop server
Browse files Browse the repository at this point in the history
  • Loading branch information
rwema3 committed Mar 5, 2024
1 parent 6950a77 commit 188acba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions flutter/lib/commons/localhost.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ class LocalhostManager {
await server.start();
}
}

Future<void> stopServer() async {
if (isRunning) {
final server = _localhostServer!;
await server.close();
_localhostServer = null;
}
}
}

0 comments on commit 188acba

Please sign in to comment.