listGenerator top-level property

FigGenerator listGenerator
final

Implementation

final FigGenerator listGenerator = FigGenerator(
  script: ['launchctl', 'list'],
  postProcess: (String out, [List<String>? tokens]) {
    return out
        .split('\n')
        .skip(1)
        .map((line) {
          final parts = line.split(RegExp(r'\s+'));
          if (parts.length > 2) {
            return FigSuggestion(name: parts[2]);
          }
          return null;
        })
        .whereType<FigSuggestion>()
        .toList();
  },
);