getStacktrace static method

List<String> getStacktrace({
  1. int stackIndex = 6,
})

Gets tag with stackIndex how many steps in stacktrace should be taken to grab log call.

Implementation

static List<String> getStacktrace({int stackIndex = 6}) {
  final stackTraceList = StackTrace.current.toString().split('\n');
  return stackTraceList.sublist(stackIndex);
}