nestedArtboardAtPath method

NestedArtboard? nestedArtboardAtPath(
  1. String path
)

Implementation

NestedArtboard? nestedArtboardAtPath(String path) {
  const delimiter = '/';
  final dIndex = path.indexOf(delimiter);
  final artboardName = dIndex == -1 ? path : path.substring(0, dIndex);
  final restOfPath =
      dIndex == -1 ? '' : path.substring(dIndex + 1, path.length);
  if (artboardName.isNotEmpty) {
    final nested = nestedArtboard(artboardName);
    if (nested != null) {
      if (restOfPath.isEmpty) {
        return nested;
      } else {
        return nested.nestedArtboardAtPath(restOfPath);
      }
    }
  }
  return null;
}