getLine static method

String getLine(
  1. StackTrace stackTrace
)

Get the number of lines in the current call log.

Implementation

static String getLine(StackTrace stackTrace) {
  final String outPut = stackTrace.toString().split('\n')[1];
  final int lineStart = outPut.indexOf(RegExp(r'[0-9]+:'), 1);
  final int lineEnd = outPut.indexOf(RegExp(r':[0-9]'), lineStart);
  return outPut.substring(lineStart, lineEnd);
}