Summary: I have a stacktrace in dart, where I want to remove frame #0, and then have the whole stacktrace adjust (frame #1 is now frame #0, frame #2 is now frame #1).
Details: I have written my own assert type function in dart, that if fails, will grab the current stacktrace and send to crashlytics.
static void asrt(bool condition)
{
if (condition)
return;
StackTrace stacktrace = StackTrace.current;
Crashlytics.instance.recordError("assert triggered" , stacktrace);
}
The problem is that crashlytics identifies each error based on the first stackframe. So all of my errors are being identified as that same error, because I am grabbing the stacktrace from the same method. I understand I could pass the stacktrace from the caller, but a preferrable solution to me would be to manipulate the stacktrace so the caller does less work.
Is this doable in dart?