printStackTraceIfType function

void printStackTraceIfType(
  1. Object object,
  2. String type
)

Implementation

void printStackTraceIfType(Object object, String type) {
  if (!logOff && logStackTraces) {
    bool shouldPrint;
    if (object.runtimeType.toString() == type ||
      (object is Element && object.widget.runtimeType.toString() == type)) {
      shouldPrint = true;
    } else shouldPrint = false;

    if (shouldPrint) {
      _print('************************************************');
      _print(StackTrace.current);
      _print('************************************************');
    }
  }
}