projectsGenerator top-level property

FigGenerator projectsGenerator
final

Implementation

final FigGenerator projectsGenerator = FigGenerator(
  script: ["ng", "config", "projects"],
  postProcess: (String out, [List<String>? tokens]) {
    if (out.trim().isEmpty) return [];
    try {
      final projects = jsonDecode(out) as Map<String, dynamic>;
      return projects.entries.map((e) {
        final details = e.value as Map<String, dynamic>;
        return FigSuggestion(
          name: e.key,
          description: details['projectType'] as String?,
        );
      }).toList();
    } catch (_) {
      return [];
    }
  },
);