getWidgetName static method

String getWidgetName(
  1. StackTrace stackTrace
)

Get the current call log widget name.

Implementation

static String getWidgetName(StackTrace stackTrace) {
  final String outPut = stackTrace.toString().split('\n')[1];
  final int widgetStart = outPut.indexOf(RegExp(r'[A-Za-z]'), 1);
  final int widgetEnd = outPut.indexOf('.', widgetStart);
  return outPut.substring(widgetStart, widgetEnd);
}