triggerNativeTestCrash static method

Future<void> triggerNativeTestCrash({
  1. MethodChannel? channel,
})

Asks the native plugin to raise an uncaught exception, crashing the app. On the next launch, drainAndReport should pick the record up. Intended for end-to-end testing of the crash pipeline; do not ship buttons that call this in release builds.

Implementation

static Future<void> triggerNativeTestCrash({MethodChannel? channel}) async {
  final ch = channel ?? _channel;
  await ch.invokeMethod<void>('triggerTestCrash');
}