fromStackString static method

List<StackFrame> fromStackString(
  1. String stack

Parses a list of StackFrames from the StackTrace.toString method.


static List<StackFrame> fromStackString(String stack) {
  return stack
      .where((String line) => line.isNotEmpty)
      // On the Web in non-debug builds the stack trace includes the exception
      // message that precedes the stack trace itself. fromStackTraceLine will
      // return null in that case. We will skip it here.
      // TODO(polina-c): if one of lines was parsed to null, the entire stack trace
      // is in unexpected format and should be returned as is, without partial parsing.