create a service extension to terminate an app (#3634)

This commit is contained in:
Devon Carew
2016-04-29 13:34:31 -07:00
parent 7c017898da
commit 53c07045f2

View File

@@ -5,6 +5,7 @@
import 'dart:async';
import 'dart:convert' show JSON;
import 'dart:developer' as developer;
import 'dart:io' show exit;
import 'package:meta/meta.dart';
@@ -100,6 +101,10 @@ abstract class BindingBase {
name: 'reassemble',
callback: reassembleApplication
);
registerSignalServiceExtension(
name: 'exit',
callback: _exitApplication
);
assert(() { _debugServiceExtensionsRegistered = true; return true; });
}
@@ -247,3 +252,8 @@ abstract class BindingBase {
@override
String toString() => '<$runtimeType>';
}
/// Terminate the Flutter application.
void _exitApplication() {
exit(0);
}