getCallMethod static method

String getCallMethod(
  1. StackTrace stackTrace
)

Method to get the current call log.

Implementation

static String getCallMethod(StackTrace stackTrace) {
  final String outPut = stackTrace.toString().split('\n')[1];
  final int methodStart = outPut.indexOf('.', 1);
  final int methodEnd = outPut.indexOf(' (', methodStart);
  String method = outPut.substring(methodStart + 1, methodEnd);
  if (method.contains('.<')) {
    method = method.split('.<').first;
  }
  return method;
}