crash static method
Crashes app from the native layer. Useful for testing crash reporting.
Method might throw exception.
try {
await Instrumentation.crashNatively();
} catch (e) {
// handle exception
}
Implementation
static Future<void> crash() async {
try {
await channel.invokeMethod<void>('crash');
} on PlatformException catch (e) {
throw Exception(e.details);
}
}