NotationVocabulary class final

The alias table: many names, one meaning. A name here is never a word the notation (or the design system in use) already has: that word wins.

JSON (vocabulary.json in a design system's folder, or a file given to the tools):

{
  "types":      {"RangeSlider": {"to": "Slider", "requires": ["low", "high"], "parameters": {"from": "low", "to": "high"}}},
  "parameters": {"*": {"disabled": "!enabled"}, "ListTile": {"subtitle": "$text"}},
  "flags":      {"*": {"disabled": "enabled=false"}},
  "events":     {"*": {"onClick": "onTap"}},
  "verbs":      {"navigate": "go"}
}

A parameter is read as another key (enabled), as that key with its value negated (!enabled), or as a further string of the line ($text). The key $text is the line's first string, read as the parameter it names ("NumberInput": {"$text": "label"}: NumberInput "Strokes" is NumberInput label="Strokes"), on a word that takes no string. A flag is read as the words written (enabled=false). * holds for every type; a type's own entry comes first.

Constructors

NotationVocabulary({Map<String, TypeAlias> types = const {}, Map<String, Map<String, String>> parameters = const {}, Map<String, Map<String, String>> flags = const {}, Map<String, Map<String, String>> events = const {}, Map<String, String> verbs = const {}, Map<String, List<NotationDefinition>> definitions = const {}, Map<String, List<NotationDefinition>> dictionary = const {}})
const
NotationVocabulary.fromJson(Json json)
factory

Properties

definitions → Map<String, List<NotationDefinition>>
The words defined in the notation itself, by word (docs/design/20-defined-words.md): each is a word we have. Several for one word are its meanings, the one a use fits best read.
final
dictionary → Map<String, List<NotationDefinition>>
The words of the dictionaries a caller gave (a folder of definition files each, withDictionary): words we have, read after a page's own definitions and a design system's or a site's (definitions), by word.
final
events → Map<String, Map<String, String>>
final
flags → Map<String, Map<String, String>>
final
hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
No aliases (definitions aside).
no setter
parameters → Map<String, Map<String, String>>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
types → Map<String, TypeAlias>
final
verbs → Map<String, String>
final

Methods

define(Map<String, String> texts) → NotationVocabulary
This table with the words defined in texts (each a file's text by its name: StickyNote.txt) over its own; what could not be read is left out (readDefinitions says what).
merge(NotationVocabulary other) → NotationVocabulary
This table with other's entries added; where both name a word, other's is the one read (a design system's over the built-in one).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() → String
A string representation of this object.
inherited
withDictionary(Map<String, String> texts, {required String name}) → NotationVocabulary
This table with the dictionary name (a folder of definition files, texts by file name): its words under the ones definitions has, and over any dictionary given before it. What could not be read is left out (readDefinitions says what).

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

core → const NotationVocabulary
The table a reader starts with: the two universal words a control has under its own name (disabled is a control's enabled=false, readonly an input's readOnly): one word on every line, a box's and a control's alike. The notation has one name for everything else; a caller's own words (a design system's, a dictionary's) are the caller's to give.
none → const NotationVocabulary
No aliases at all.
otherNames → const NotationVocabulary
The names models reach for (SDK tool/vocabulary/corpus) for words the notation has under one name. None is read: a line that uses one is said with the line to write, the notation's own word in its place.