searchNodesByName method

Future<List<String>> searchNodesByName(
  1. String name
)

This method is used to find all nodes with the specified display name.

Implementation

Future<List<String>> searchNodesByName(String name) async {
  final results = <String>[];

  final regex = RegExp(name, caseSensitive: false);

  for (final node in nodes.values) {
    if (regex.hasMatch(node.prototype.displayName)) {
      results.add(node.id);
    }
  }

  return results;
}