Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I unconditionally exit a Dart application?

Tags:

dart

In a server-side VM app, with a few Futures which may or may not return. How to unconditionally exit the app?

like image 933
John Evans Avatar asked May 23 '12 00:05

John Evans


1 Answers

To exit the VM:

import 'dart:io';

main() {
  exit(0); // or non-zero for some error code
}

Which is documented here. Thanks for asking!

like image 133
Seth Ladd Avatar answered Sep 20 '22 04:09

Seth Ladd