reportError method
Calls onError with the given details, unless it is null.
Implementation
static void reportError(FlutterErrorDetails details) {
assert(details != null);
assert(details.exception != null);
if (onError != null)
onError(details);
}