CounterStyle class

The CounterStyle class represents styles that can be used to generate a text representation of the given counter's value (such as a 'iv' for 4, or 'β' for 2).

See https://www.w3.org/TR/css-counter-styles-3/#counter-styles for more details.

Constructors

CounterStyle.define({required String name, System system = System.symbolic, String negative = '-', String prefix = '', String suffix = '\u002E\u0020', IntRange? range, int padLength = 0, String padCharacter = '', String fallback = 'decimal', List<String> symbols = const [], Map<int, String> additiveSymbols = const {}})
A simple way to define CounterStyle. Based off of systems defined at https://www.w3.org/TR/css-counter-styles-3/#counter-style-system
factory
CounterStyle.defineCustomAlgorithm({required String name, String negative = '', String prefix = '', String suffix = '\u002E\u0020', required String algorithm(int), required IntRange range, int padLength = 0, String padCharacter = '', String fallback = 'decimal'})
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
Identifies the style
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generateCounterContent(int count) String
Generates content using the algorithm of this CounterStyle, applying padding and negative signs as necessary. Does not apply prefix or suffix.
generateMarkerContent(int count) String
Generates a marker using the algorithm of this CounterStyle, applying padding and negative signs as necessary. Also applies the given (or default) prefix and suffix.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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