notationGlossaryLines function
List<String>
notationGlossaryLines(
- DesignSystem designSystem,
- NotationVocabulary vocabulary, {
- required String prompt,
The lines of the open prompt's glossary of signatures: for each word
designSystem has beyond what the open prompt teaches (the names
notationGlossary gives), one line as a line uses it, with what it is for
in a few words (notationGlossaryComponentLine,
notationGlossaryDefinitionLine). A word defined with several meanings has
a line for each; a component's word, a line for the component and one for
each meaning a definition names (Stepper#steps).
Implementation
List<String> notationGlossaryLines(DesignSystem designSystem, NotationVocabulary vocabulary, {required String prompt}) {
final components = {for (final c in designSystem.list) c.type: c};
return [
for (final n in notationGlossary(designSystem, vocabulary, prompt: prompt)) ...[
if (components[n] case final c?) notationGlossaryComponentLine(c),
for (final d in vocabulary.definitions[n] ?? const <NotationDefinition>[])
if (!components.containsKey(n) || d.name != null) notationGlossaryDefinitionLine(d),
],
];
}