previous property

Path previous

Implementation

Path get previous {
  Path previousPath = Path.from(this, growable: true);
  if (isEmpty) {
    return previousPath;
  }
  final last = previousPath.last;
  return previousPath
    ..removeLast()
    ..add(max(0, last - 1));
}