PrefixInverseGenerator class

An implementation of InverseGenerator that can either swap an argument's prefix for another, or append a new "generic" prefix if none of the known swap mappings are present.

By default:

  • The prefix with- will be swapped with without-.
  • The prefix enable- will be swapped with disable-.
  • All other arguments will have no- prepended to them.

These defaults are available in defaultGeneric and defaultSwap.

Constructors

PrefixInverseGenerator({String? generic = defaultGeneric, Map<String, String> swap = defaultSwap})
Creates a new generator. swap is a mapping of prefixes, such that any arguments with a prefix as a key in the mapping will have that swapped out with the corresponding value. Any other arguments will have generic prepended as a prefix if it is not null, otherwise no inverse will be generated.

Properties

generic String?
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
swap Map<String, String>
final

Methods

call(String name) String?
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

Constants

defaultGeneric → const String
defaultSwap → const Map<String, String>