AppIconToken extension type

O contrato de ícone do Flocks: os nomes que o pacote garante existir.

Todo componente de lib/src desenha ícone a partir daqui — são 55 nomes, contra os ~880 do catálogo AppIcons. A diferença importa: os 55 são o que um AppIconProvider precisa saber servir para o design system funcionar inteiro; o resto é conveniência para quem escreve o app.

É um extension type sobre String, e isso é deliberado. Em tempo de execução um token É o seu slug, sem custo nenhum, e implements String faz com que ele seja aceito em qualquer parâmetro String que já exista — os 33 campos String? icon dos componentes e os call sites dos apps continuam compilando sem uma linha de mudança. O ganho é de leitura e de contrato: values é a lista que o teste de arquitetura cobra do provider padrão.

O slug é o nome do arquivo sem extensão (chevron-downassets/icons/chevron-down.svg). Não é URL: quem transforma slug em pixel é o provider, e trocá-lo troca o set inteiro.

on
Implemented types
Available extensions

Constructors

AppIconToken(String slug)
const

Properties

characters Characters

Available on String, provided by the StringCharacters extension

The Characters of this string.
no setter
codeUnits List<int>
An unmodifiable list of the UTF-16 code units of this string.
no setterinherited
hashCode int
A hash code derived from the code units of the string.
no setterinherited
isEmpty bool
Whether this string is empty.
no setterinherited
isNotEmpty bool
Whether this string is not empty.
no setterinherited
length int
The length of the string.
no setterinherited
runes Runes
An Iterable of Unicode code-points of this string.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slug String
final
toJS JSString

Available on String, provided by the StringToJSString extension

Converts this String to a JSString.
no setter

Methods

allMatches(String string, [int start = 0]) Iterable<Match>
Matches this pattern against the string repeatedly.
inherited
codeUnitAt(int index) int
Returns the 16-bit UTF-16 code unit at the given index.
inherited
compareTo(String other) int
Compares this string to other.
inherited
contains(Pattern other, [int startIndex = 0]) bool
Whether this string contains a match of other.
inherited
endsWith(String other) bool
Whether this string ends with other.
inherited
indexOf(Pattern pattern, [int start = 0]) int
Returns the position of the first match of pattern in this string, starting at start, inclusive:
inherited
lastIndexOf(Pattern pattern, [int? start]) int
The starting position of the last match pattern in this string.
inherited
matchAsPrefix(String string, [int start = 0]) Match?
Matches this pattern against the start of string.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
padLeft(int width, [String padding = ' ']) String
Pads this string on the left if it is shorter than width.
inherited
padRight(int width, [String padding = ' ']) String
Pads this string on the right if it is shorter than width.
inherited
replaceAll(Pattern from, String replace) String
Replaces all substrings that match from with replace.
inherited
replaceAllMapped(Pattern from, String replace(Match match)) String
Replace all substrings that match from by a computed string.
inherited
replaceFirst(Pattern from, String to, [int startIndex = 0]) String
Creates a new string with the first occurrence of from replaced by to.
inherited
replaceFirstMapped(Pattern from, String replace(Match match), [int startIndex = 0]) String
Replace the first occurrence of from in this string.
inherited
replaceRange(int start, int? end, String replacement) String
Replaces the substring from start to end with replacement.
inherited
split(Pattern pattern) List<String>
Splits the string at matches of pattern and returns a list of substrings.
inherited
splitMapJoin(Pattern pattern, {String onMatch(Match)?, String onNonMatch(String)?}) String
Splits the string, converts its parts, and combines them into a new string.
inherited
startsWith(Pattern pattern, [int index = 0]) bool
Whether this string starts with a match of pattern.
inherited
substring(int start, [int? end]) String
The substring of this string from start, inclusive, to end, exclusive.
inherited
toLowerCase() String
Converts all characters in this string to lower case.
inherited
toString() String
A string representation of this object.
inherited
toUpperCase() String
Converts all characters in this string to upper case.
inherited
trim() String
The string without any leading and trailing whitespace.
inherited
trimLeft() String
The string without any leading whitespace.
inherited
trimRight() String
The string without any trailing whitespace.
inherited

Operators

operator *(int times) String
Creates a new string by concatenating this string with itself a number of times.
inherited
operator +(String other) String
Creates a new string by concatenating this string with other.
inherited
operator ==(Object other) bool
Whether other is a String with the same sequence of code units.
inherited
operator [](int index) String
The character (as a single-code-unit String) at the given index.
inherited

Constants

add → const AppIconToken
add.svg
alert → const AppIconToken
alert.svg
apiCloud → const AppIconToken
api-cloud.svg
arrowUp → const AppIconToken
arrow-up.svg
attachment → const AppIconToken
attachment.svg
audio → const AppIconToken
audio.svg
calendar → const AppIconToken
calendar.svg
cancel → const AppIconToken
cancel.svg
car → const AppIconToken
car.svg
chat → const AppIconToken
chat.svg
check → const AppIconToken
check.svg
checkCircle → const AppIconToken
check-circle.svg
chevronDown → const AppIconToken
chevron-down.svg
chevronLeft → const AppIconToken
chevron-left.svg
chevronRight → const AppIconToken
chevron-right.svg
chevronUp → const AppIconToken
chevron-up.svg
clock → const AppIconToken
clock.svg
close → const AppIconToken
close.svg
copy → const AppIconToken
copy.svg
csv → const AppIconToken
csv.svg
dashboard → const AppIconToken
dashboard.svg
dragArrow → const AppIconToken
drag-arrow.svg
errorCircle → const AppIconToken
error-circle.svg
external-link.svg
fileDoc → const AppIconToken
file-doc.svg
filePdf → const AppIconToken
file-pdf.svg
filePpt → const AppIconToken
file-ppt.svg
fileText → const AppIconToken
file-text.svg
fileTxt → const AppIconToken
file-txt.svg
fileXls → const AppIconToken
file-xls.svg
filter → const AppIconToken
filter.svg
group → const AppIconToken
group.svg
hyperlink.svg
imageLandscape → const AppIconToken
image-landscape.svg
info → const AppIconToken
info.svg
infoCircle → const AppIconToken
info-circle.svg
mail → const AppIconToken
mail.svg
map → const AppIconToken
map.svg
microphone → const AppIconToken
microphone.svg
pdf → const AppIconToken
pdf.svg
pencil → const AppIconToken
pencil.svg
plus → const AppIconToken
plus.svg
refresh → const AppIconToken
refresh.svg
remove → const AppIconToken
remove.svg
search.svg
settings → const AppIconToken
settings.svg
stop → const AppIconToken
stop.svg
support → const AppIconToken
support.svg
swapArrow → const AppIconToken
swap-arrow.svg
sync → const AppIconToken
sync.svg
thumbsDown → const AppIconToken
thumbs-down.svg
thumbsUp → const AppIconToken
thumbs-up.svg
user → const AppIconToken
user.svg
values → const List<AppIconToken>
Todos os tokens do contrato. É contra esta lista que test/architecture/icon_axis_test.dart cobra o provider padrão.
videoPlay → const AppIconToken
video-play.svg
zipFile → const AppIconToken
zip-file.svg