getValue method

Future<T> getValue(
  1. String k
)

Asynchronously retrieves the value for the given key, falling back to defaultValue on any error from onGetValue.

Initializes and emits to the subject if no value has been set yet, ensuring reactive streams start with a valid state. Handles exceptions gracefully with .catchError, promoting robust form behavior in ArcaneForm and FieldNode contexts. Returns the resolved Future<T> value.

Implementation

Future<T> getValue(String k) =>
    onGetValue(k).catchError((_) => defaultValue).thenRun((t) {
      if (!subject.hasValue) {
        subject.add(t);
      }
    });