current property

StackTrace current

Returns a representation of the current stack trace.

This is similar to what can be achieved by doing:

try { throw 0; } catch (_, stack) { return stack; }

The getter achieves this without throwing if possible.

Implementation

external static StackTrace get current;

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-core/StackTrace/current.html