setValue method

void setValue (
  1. dynamic value,
  2. {Options options}
)

can be used to set the value property

Implementation

void setValue(dynamic value, {Options options}) async {
  void performUpdate() {
    final prev = this.value;
    this.value = value;
    this._applyOptions(options, 'value', prev, this.value);
  }

  if (this.beforeValueChange != null) {
    try {
      await beforeValueChange(value);
      performUpdate();
    } catch (e) {
      print(e);
    }
  } else {
    performUpdate();
  }
}