fullPathOfView function

String fullPathOfView(
  1. View lastView
)

Implementation

String fullPathOfView(View lastView) {
  final encodedLastViewPath = _encodedPartOfPath(lastView);
  var lastParentView = lastView.parent;
  if (lastParentView == null) {
    return '#$encodedLastViewPath';
  }
  final viewsList = <View>[];
  while (lastParentView != null) {
    viewsList.add(lastParentView);
    lastParentView = lastParentView.parent;
  }
  final buffer = StringBuffer()..write('#');
  for (final view in viewsList.reversed) {
    final encodedViewPath = _encodedPartOfPath(view);
    buffer.write('$encodedViewPath/');
  }
  return buffer.toString() + encodedLastViewPath;
}