runWithValues method

DepSubscription runWithValues(
  1. void callback(
    1. Map<String, dynamic> values
    ), {
  2. bool runNow = false,
})

Runs callback with a snapshot of the current values of the dependencies.

Useful when your side-effect depends on both A and B values.

Implementation

DepSubscription runWithValues(
    void Function(Map<String, dynamic> values) callback, {
      bool runNow = false,
    }) {
  return run(() {
    final values = <String, dynamic>{};
    for (final n in _fields) {
      values[n] = _deps.form.control<dynamic>(n).value;
    }
    callback(values);
  }, runNow: runNow);
}