SymbolToHumanizedNameTransformation class
A transformation to convert a SymbolName into a human-friendly representation. The symbol's name can be camel-, pascal-, snake-, or kebab-cased.
These special considerations are applied during transformation:
- Words that are wholly capitalized are assumed to be acryonyms and are left alone.
- A single capital "I" is left alone.
const transformation = SymbolToHumanizedNameTransformation();
// 'some camel case symbol'
transformation.transform(SymbolName('someCamelCaseSymbol'), 'en_US');
// 'some pascal case symbol'
transformation.transform(SymbolName('SomePascalCaseSymbol'), 'en_US');
// 'some snake case symbol'
transformation.transform(SymbolName('some_snake_case_symbol'), 'en_US');
// 'some kebab case symbol'
transformation.transform(SymbolName('some-kebab-case-symbol'), 'en_US');
// 'some HTML reference'
transformation.transform(SymbolName('someHTMLReference'), 'en_US');
// 'you and I are awesome'
transformation.transform(SymbolName('youAndIAreAwesome'), 'en_US');
- Inheritance
-
- Object
- Transformation<
SymbolName, String> - SymbolToHumanizedNameTransformation
- Available Extensions
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transform(
SymbolName input, String locale) → String -
Transforms
input
into an instance ofU
using the providedlocale
.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited