getLevel method
Returns the indentation level of _input
.
An indentation level is determined by finding a non-empty line with the least amount of leading whitespace.
For example, with input:
Hello World
the indentation level is 1, because the line with " World" has the least amount of leading whitespace.
Implementation
int getLevel() {
final lines = _processLines();
return _findCommonIndentationLevel(lines);
}