NitroResultValue<T extends Object?> class
sealed
Discriminated success/error result for native methods annotated with
@NitroResult().
Wire format returned by the native side: [1B tag: 0=ok, 1=err][payload]
- Tag 0 (ok): payload = record-codec bytes for T
- Tag 1 (err): payload = record-codec string (4B length + UTF-8 message)
Dart receives either NitroOk<T> or NitroErr<T> without an exception being thrown. Call sites pattern-match on the sealed type:
final result = await module.login(user, pass);
switch (result) {
case NitroOk(:final value): print('Logged in: $value');
case NitroErr(:final message): print('Login failed: $message');
}
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
-
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