The GlanceStackTrace interface is a specialized implementation representing the stack trace for the glance library. By reusing Dart’s StackTrace interface, it simplifies the integration of glance stack traces with other libraries that directly accept a StackTrace object as a parameter, such as Firebase’s recordError API, the user can report the jank stack trace like this:
class JankReportError extends Error {
@override
String toString() {
return 'This only indicates jank, not an actual error.';
}
}
class MyJankDetectedReporter extends JankDetectedReporter {
@override
void report(JankReport info) {
FirebaseCrashlytics.instance.recordError(JankReportError(), info.stackTrace, fatal: false);
}
}
The
GlanceStackTrace
interface is a specialized implementation representing the stack trace for theglance
library. By reusing Dart’sStackTrace
interface, it simplifies the integration ofglance
stack traces with other libraries that directly accept aStackTrace
object as a parameter, such as Firebase’s recordError API, the user can report the jank stack trace like this: