endSimulation static method
Halts the simulation. Allows the current tick to finish, if there is one.
The Future returned is equivalent to simulationEnded and completes once the simulation has actually ended.
Implementation
static Future<void> endSimulation() async {
_simulationEndRequested = true;
// wait for the simulation to actually end
await simulationEnded;
}