OmegaIntentName class abstract

Contract for typed intent names (avoids magic strings and eases refactoring).

Implement this interface with an enum or class to define your app's known intents and use OmegaIntent.fromName when creating intents. You get autocomplete and the analyzer catches broken usages when you change the name.

Example with enum:

enum AppIntent implements OmegaIntentName {
  goLogin('navigate.login'),
  goHome('navigate.home'),
  addToCart('cart.add');
  const AppIntent(this.name);
  @override
  final String name;
}
// Usage: OmegaIntent.fromName(AppIntent.goLogin, payload: args);

Constructors

OmegaIntentName()

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
Intent name (e.g. "navigate.login", "cart.add").
no setter
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

Operators

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