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< parameters = const {}, Map<String, String> >String, Map< flags = const {}, Map<String, String> >String, Map< events = const {}, Map<String, String> >String, String> verbs = const {}, Map<String, List< definitions = const {}, Map<NotationDefinition> >String, List< dictionary = const {}})NotationDefinition> > -
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,textsby 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 names models reach for (SDK tool/vocabulary/corpus) for words the
notation has under another name. Each was checked against what the
parser accepts;
test/notation_vocabulary_test.dartexpands every one beside our own spelling. - none → const NotationVocabulary
- No aliases at all.