DefaultUIPayloadCompositeStrategy class

Default composition strategy that flattens and merges payloads.

Rules:

  • If one payload is null, returns the other
  • If both are null, returns null
  • If either is UIPayloads, unwraps and merges the lists
  • Otherwise, wraps both in UIPayloads

Example:

const strategy = DefaultUIPayloadCompositeStrategy();

strategy.compose(null, Failure(...)); // Returns: Failure(...)
strategy.compose(Failure(...), Warning(...)); // Returns: UIPayloads([Failure, Warning])
Inheritance

Constructors

DefaultUIPayloadCompositeStrategy()
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

Methods

compose(UIPayload? a, UIPayload? b) UIPayload?
Combines two payloads into a single payload. Returns null if both inputs are null.
override
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