components property

List<String> components

Split this name into individual '.' separated components (e.g. names of its parent functions).

Implementation

List<String> get components {
  // Break the rest of the name into components.
  final result = scrubbed.split('.');

  // Constructor names look like this 'new <ClassName>.<CtorName>' so
  // we need to concatenate the first two components back to form
  // the constructor name.
  if (result.first.startsWith('new ')) {
    result[0] = '${result[0]}${result[1]}';
    result.removeAt(1);
  }

  return result;
}