ResOption<T> class

Optional resource accessor.

Used when a resource might not exist.

@system
void mySystem(ResOption<Config> config) {
  if (config.value != null) {
    // Use config
  }
}

Constructors

ResOption(T? _value)
Creates an optional resource accessor.

Properties

exists bool
Returns true if the resource exists.
no setter
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?
The resource value, or null if it doesn't exist.
no setter

Methods

call() → T?
Allows using the resource directly in expressions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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