Enum<T> class abstract

Java-like enum While extending this class you can create a static method byValue returning a class field.

Example:

class TransactionType extends Enum<String> {
  const TransactionType(String val) : super(val);

  static const TransactionType IN = TransactionType('in');
  static const TransactionType OUT = TransactionType('out');

  static TransactionType byValue(String value) {
    switch (value) {
      case 'in':
        return IN;
      case 'out':
        return OUT;
      default:
        return OUT;
    }
  }
}
Implementers

Constructors

Enum(T value)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
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