ClassSwitchOptions class
Various experimental options allowing deep customization of the generated class switch code. These options aren't global and only affect the generated code for the annotation where they are provided. If you have a common set of options you use regularly create an alias for them to save yourself typing time!
FEEDBACK WANTED: Please let me know if you find any of these options useful and which you prefer in our Discord or on this github issue.
In these early dev releases a wide range of options are included and the library does not yet try to take an opinionated stance on which API is best or which of the options should not be customizable. However expect these options to radically change, be removed, have functionality combined etc in future more stable releases after user feedback on the API.
- Annotations
-
- @experimental
Constructors
- ClassSwitchOptions({String abstractMethodSubTypeSeparator = '', String abstractMethodPrefix = '', String switchFunctionPrefix = '\$switch', DSL_MODE dslMode = DSL_MODE.WRAPPER_CLASS})
-
const
Properties
- abstractMethodPrefix → String
-
For the generated Switcher classes this is an optional prefix that will be
applied to the names of all of the generated abstract sub type methods.
final
- abstractMethodSubTypeSeparator → String
-
For the generated Switcher classes this is an optional separator that will
be placed between the sub type names in the abstract method names.
final
- dslMode → DSL_MODE
-
The dslMode changes the API of the generated classes and functions
for this particular annotation. Multiple different modes are provided
currently as each has different trade-offs with readability vs their
autocomplete experience.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- switchFunctionPrefix → String
-
When annotating the same class multiple times you will need to provide
different
switchFunctionPrefix
s to prevent function name collisions.final
Methods
-
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